[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v4 5/8] x86/emul: Make condition coverage warning non-fatal



Randconfig with GCC-14 (Debian Trixie) found:

  In file included from arch/x86/x86_emulate/x86_emulate.c:11,
                   from arch/x86/x86_emulate.c:27:
  arch/x86/x86_emulate/x86_emulate.c: In function 'x86_emulate':
  arch/x86/x86_emulate/private.h:482:8: error: Too many conditions (found 826); 
giving up coverage [-Werror=coverage-too-many-conditions]
    482 | ({  if ( (p) ) {                                                      
    \
        |        ^
  arch/x86/x86_emulate/x86_emulate.c:1283:5: note: in expansion of macro 
'generate_exception_if'
   1283 |     generate_exception_if((mode_vif() &&
        |     ^~~~~~~~~~~~~~~~~~~~~

which is a consequence of having a new enough compiler to allow
CONFIG_CONDITIONAL_COVERAGE in to the mix.

In the short term make warning non-fatal.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
CC: Anthony PERARD <anthony.perard@xxxxxxxxxx>
CC: Michal Orzel <michal.orzel@xxxxxxx>
CC: Julien Grall <julien@xxxxxxx>
CC: Stefano Stabellini <sstabellini@xxxxxxxxxx>
CC: Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>

v4:
 * New

Full failure logs:
  https://gitlab.com/xen-project/hardware/xen-staging/-/jobs/11331286819
---
 xen/arch/x86/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index d7aed7d92c15..a0bba5d9085e 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -98,6 +98,9 @@ $(obj)/usercopy.o: CFLAGS-y += -iquote .
 ifneq ($(CONFIG_HVM),y)
 $(obj)/x86_emulate.o: CFLAGS-y += -Wno-unused-label
 endif
+ifneq ($(CONFIG_CONDITION_COVERAGE),y)
+$(obj)/x86_emulate.o: CFLAGS-y += $(call 
cc-option,$(CC),-Wno-error=coverage-too-many-conditions)
+endif
 
 efi-y := $(shell if [ ! -r $(objtree)/include/xen/compile.h -o \
                       -O $(objtree)/include/xen/compile.h ]; then \
-- 
2.39.5




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.