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

[PATCH v3 2/5] build: permit Kconfig control over how to deal with unsatisfiable choices


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 26 Jul 2023 12:33:54 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TBwtNBln1PoPHd4P5QDMVI0TR5/7gNq72VnGJQQ+6LE=; b=hTX9lA5Ds1kpSxMCuHEdGG0otfSroxP2chakMD7qwUbLt+/B41PwIL1z8Qlx7mDRvHDprQDeO/F9YRw6luIiuHN3CLOOwVO9o37bcF9dnN+w65Li09mPztO3qdvmRHANqVZHiWPqCbDdqqYekl03xSxU/WS5k3sT8c0GIcAGzQizEYjrjz9iu7lv7lbhBYAJnl2Fu0jqO+FpftECrrNZRGDn+9uMhgwRq8sf2nvDGCmSiuK5kvYeAmoozvNNxZL0TismpQDhO+DXju3uKGz/6Xg7zYUKv8cHPsgBzSrMdbCKuOzNp5xEwQLNuFLNrbeIr9w1PZu6Wn0smXsJC4nJUw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eIlGtv243838urcZISZZpaCepcZ0enGGrTcprCxv0A3SV2m/hkRUMutPlRVLhoMVrXmJhZH3g8KmqbQ2/e5ckV6bbYIlnmO3UrfvGg7FLOclX41XH3vpeTH3qI1lAG+bCbXpPX9QM7CaygRee5gJORyp97k7A14M0gHSD1YWrSaUahWvsHYeNPAc+E4Y6c2MkiepQI15fHshvcSoF+TXmkGW+miHKh7FtamBso6hvTlMsl/wWm9IqCo+rmHUGxvh9pH9DoOEMPduoibeuNVgTPpQ/Gj/Uz0rn/bx/7D+KX8hpbKAfIY2l60zGweibIWH4AxL2mlc63Pcg0rzq3+EzA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>
  • Delivery-date: Wed, 26 Jul 2023 10:34:01 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Some options we allow the build admin to select may require new enough
tool chain components to fulfill (partly or entirely). Provide yet
another control to pick what action to take at the end of the build
process - be silent about this, warn, or fail the build.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
This may not be fine grained enough: Optimization settings (like added
by "x86: allow Kconfig control over psABI level") may want dealing with
differently than security relevant ones (like XEN_SHSTK or XEN_IBT).

Whether to do this uniformly at the end of the build is up for
discussion: In the "warn" case we will want the resulting output late,
so it is more likely to be noticed. In the "fail build" case though we
may want the failure to occur early.
---
v3: New.

--- a/xen/Kconfig
+++ b/xen/Kconfig
@@ -64,6 +64,25 @@ config UNSUPPORTED
          preview features as defined by SUPPORT.md. (Note that if an option
          doesn't depend on UNSUPPORTED it doesn't imply that is supported.)
 
+choice
+       prompt "How to deal with settings which cannot be satisified"
+       default UNSATISFIED_WARNING
+       help
+         Some selectable options may depend on e.g. tool chain functionality.
+         Select here how to deal with such when actually building a such
+         configured hypervisor.
+
+config UNSATISFIED_SILENT
+       bool "silent"
+
+config UNSATISFIED_WARNING
+       bool "emit warnings"
+
+config UNSATISFIED_ERROR
+       bool "fail the build"
+
+endchoice
+
 config LTO
        bool "Link Time Optimisation"
        depends on BROKEN
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -588,6 +588,10 @@ $(TARGET): outputmakefile FORCE
        $(Q)$(MAKE) $(build)=arch/$(SRCARCH) include
        $(Q)$(MAKE) $(build)=. arch/$(SRCARCH)/include/asm/asm-offsets.h
        $(Q)$(MAKE) $(build)=. MKRELOC=$(MKRELOC) 'ALL_OBJS=$(ALL_OBJS-y)' 
'ALL_LIBS=$(ALL_LIBS-y)' $@
+ifneq ($(CONFIG_UNSATISFIED_SILENT),y)
+       $(Q)$(if $(strip $(XEN_CONFIG_UNSATISFIED)),$(MAKE),:) \
+           $(build)=. 'XEN_CONFIG_UNSATISFIED=$(XEN_CONFIG_UNSATISFIED)' 
check_unsatisfied
+endif
 
 SUBDIRS = xsm arch common crypto drivers lib test
 define all_sources
--- a/xen/build.mk
+++ b/xen/build.mk
@@ -88,3 +88,11 @@ targets += prelink.o
 
 $(TARGET): prelink.o FORCE
        $(Q)$(MAKE) $(build)=arch/$(SRCARCH) $@
+
+PHONY += check_unsatisfied
+check_unsatisfied:
+       $(Q): $(if $(filter y,$(CONFIG_UNSATISFIED_WARNING)), \
+                  $(warning The following selections could not be satisfied:), 
\
+                  $(shell echo 'The following selections could not be 
satisfied:' >&2)) \
+             $(foreach c,$(sort $(XEN_CONFIG_UNSATISFIED)),$(shell echo ' - 
CONFIG_$c' >&2)) \
+             $(if $(filter y,$(CONFIG_UNSATISFIED_ERROR)),$(error Failing 
build))




 


Rackspace

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