[PATCH v2 60/70] x86: Use control flow typechecking where possible

Andrew Cooper posted 70 patches 3 years, 12 months ago
There is a newer version of this series
[PATCH v2 60/70] x86: Use control flow typechecking where possible
Posted by Andrew Cooper 3 years, 12 months ago
Now all callees have been annotated, turn on typechecking to catch issues in
the future.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>

RFC.  This is still an experimental compiler extention
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102953

However, it is also the entire basis of being able to sanely use
-mmanual-endbr in the first place, so is very important.
---
 xen/arch/x86/arch.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/arch.mk b/xen/arch/x86/arch.mk
index 8b88f0240e85..1710d056af3f 100644
--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -49,6 +49,7 @@ CFLAGS-$(CONFIG_INDIRECT_THUNK) += -fno-jump-tables
 
 ifdef CONFIG_XEN_IBT
 CFLAGS += -fcf-protection=branch -mmanual-endbr
+$(call cc-option-add,CFLAGS,CC,-fcf-check-attribute=no)
 else
 $(call cc-option-add,CFLAGS,CC,-fcf-protection=none)
 endif
-- 
2.11.0


Re: [PATCH v2 60/70] x86: Use control flow typechecking where possible
Posted by Jan Beulich 3 years, 11 months ago
On 14.02.2022 13:51, Andrew Cooper wrote:
> Now all callees have been annotated, turn on typechecking to catch issues in
> the future.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Roger Pau Monné <roger.pau@citrix.com>
> CC: Wei Liu <wl@xen.org>
> 
> RFC.  This is still an experimental compiler extention
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102953

Hmm, the last update to that bugzilla entry was in November. I'm not
sure it is a good idea to carry code for something which hasn't even
reached gcc's master branch yet.

Jan