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

Proposal for consistent Kconfig usage by the hypervisor build system


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 29 Sep 2022 15:28:25 +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=sz5ivruGwQ7eYnIntAddcPznpIkbdaPX6SM0pE+4IHo=; b=kcVgtXOsAqwMVLPkVfRRqTQ+tiE3Xa9q4htv30Y3/r8dgKuMvyyNyEb1+yEe717Iu/i4n5fXoVehGisoFL0akOgjiQfh8xVWQY1VnKDBYYHMhcrl5iUzsM15YxbT+FMd/wTWjEFWmHq8r+li5Lc7o7DIiON41nEIoabGf9jCwfVi807UBjH+Pm83S3hQAwpUxwZ1gDNgsDR0u+0NlcBVFtAmHFQ1S41A5TMnXMccCvSi9BOwdiBw2AvIbNB/hMjbivHz8RyGk54vOIZMyxz6DjSKXp/LJXCh90r4LEq/aB2EAONTpo1f3vysNdUNBeW/rBCUXnxCpThMYT6hAkIbpw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UU1VjUGyM+BFKosLL2/szadoDW7tvBmUW3Z7YhPNpq/9ombWJnXYnAD3tOWxsepDO9IjJ04AuZj6iZE5U+H6sdMrS9AEKvhPFT3GMADUKtf6XXKUPqWDzvXrTfHY2fwLKefPHzotJqhpdf7p5W6sevYO80BgAtTEQ6WWqw63EfeIAJfwf/13PPuaNlezNOAqyHP4fJvYVhYhAy1Degtg2ZL9I/f3xXf/MP+3Tx3JB/YvPfFHmV4+mhqSYKvDwfFcygqOqttlIiCOOOXtRTxEgu+h/QxwRZagdzCst87UFlnEAw47L12gD5XJFsh2dZPT7PPIGPAEQ+/zcwUJ/Slk3A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Delivery-date: Thu, 29 Sep 2022 13:28:48 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

At present we use a mix of Makefile and Kconfig driven capability checks for
tool chain components involved in the building of the hypervisor.  What approach
is used where is in some part a result of the relatively late introduction of
Kconfig into the build system, but in other places also simply a result of
different taste of different contributors.  Switching to a uniform model,
however, has drawbacks as well:
 - A uniformly Makefile based model is not in line with Linux, where Kconfig is
   actually coming from (at least as far as we're concerned; there may be
   earlier origins).  This model is also being disliked by some community
   members.
 - A uniformly Kconfig based model suffers from a weakness of Kconfig in that
   dependent options are silently turned off when dependencies aren't met.  This
   has the undesirable effect that a carefully crafted .config may be silently
   converted to one with features turned off which were intended to be on.
   While this could be deemed expected behavior when a dependency is also an
   option which was selected by the person configuring the hypervisor, it
   certainly can be surprising when the dependency is an auto-detected tool
   chain capability.  Furthermore there's no automatic re-running of kconfig if
   any part of the tool chain changed.  (Despite knowing of this in principle,
   I've still been hit by this more than once in the past: If one rebuilds a
   tree which wasn't touched for a while, and if some time has already passed
   since the updating to the newer component, one may not immediately make the
   connection.)

Therefore I'd like to propose that we use an intermediate model: Detected tool
chain capabilities (and alike) may only be used to control optimization (i.e.
including their use as dependencies for optimization controls) and to establish
the defaults of options.  They may not be used to control functionality, i.e.
they may in particular not be specified as a dependency of an option controlling
functionality.  This way unless defaults were overridden things will build, and
non-default settings will be honored (albeit potentially resulting in a build
failure).

For example

config AS_VMX
        def_bool $(as-instr,vmcall)

would be okay (as long as we have fallback code to deal with the case of too
old an assembler; raising the baseline there is a separate topic), but instead
of what we have currently

config XEN_SHSTK
        bool "Supervisor Shadow Stacks"
        default HAS_AS_CET_SS

would be the way to go.

It was additionally suggested that, for a better user experience, unmet
dependencies which are known to result in build failures (which at times may be
hard to associate back with the original cause) would be re-checked by Makefile
based logic, leading to an early build failure with a comprehensible error
message.  Personally I'd prefer this to be just warnings (first and foremost to
avoid failing the build just because of a broken or stale check), but I can see
that they might be overlooked when there's a lot of other output.  In any event
we may want to try to figure an approach which would make sufficiently sure that
Makefile and Kconfig checks don't go out of sync.

Jan



 


Rackspace

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