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

Re: [PATCH 02/12] x86: Add more granularity to the vendors in Kconfig


  • To: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Tue, 10 Feb 2026 09:26:20 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=CjSN/Rlu0A1f/HskoZbZyNfLTMUksjbEaTD7vOqqY/U=; b=yEVF2ooxszeRDy6Xvn902mt4+L9T6XotVs4QQ8mKQDWX/jA+/Rc0phwd0Z83Jjr6EchyY5gudoWl5TZIfzwjGi5+F3d79pPZhFVXrAzeWtxXNAekCwIDcVfPkuiBb9/YbMKPsFtZrPyFXpsFczTwOTfwehV42i/8zSPZx9aNM9LcK2MYg0YuZ8ByrsJzIt0CM0p3KIm7ND+1kClg0mqnQrMVNBk5ICAwPnhtr/W5qKyas36e1rU9gGU2XB3uF03/D/0HlGmQSumkd/Z+SkfGQkB2HIV1fyAw4qJEjsRHU7av3L3iCFE3ZO0UGPLMPlFnZoIh+LqmE5K+ntNn/fxkew==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FN0dkTwHHaWhXp5T6AvjxO4HBgUrA6WBoIo0o0a0Lfwkx+dSDHz2TXL8FcKtNF8C+PYA4iDBr1ynxsvf//9smLRLb7jOp6gDBeY38VYQiwBxvvSUV2fuRvIuKxDAHQ9D34Grm7T4YTeFGaHsCVhGVosY9DVtLOLSu5rMZI+LNw70ArNum8ueI+Rjv1npXIdCso9wNQ+vOJv2xaruR8Cwha+IyaGm2WIobECmuSX1obPvvt4vz/FmoGpqSZzJYu5tDR55EutaEYPSHJBuJGkvoWD6HX45Z2eE8lDMnUvX9Rwgy2+uW/YgRiQ84L3+p/gJyImuPN8KF1/lbJcbveGAlA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Jason Andryuk <jason.andryuk@xxxxxxx>
  • Delivery-date: Tue, 10 Feb 2026 08:26:35 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, Feb 06, 2026 at 05:15:24PM +0100, Alejandro Vallejo wrote:
> This enables very aggressive DCE passes on single-vendor builds in later
> patches, as it will allow most vendor checks to become statically chosen
> branches. A lot of statics go away and a lot more inlining will be allowed.
> 
> A prerequisite for such optimisation is to expand Kconfig to have the
> full set of vendors. Adds Hygon, Centaur, Shanghai and the unknown-vendor
> path. Have Hygon select AMD, and Centaur|Shanghai select Intel.
> 
> Not a functional change.
> 
> Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
> ---
> rfc -> v1:
>   * s/depends on/select/
>   * s/UNKNOWN_CPU/UNKNOWN_CPU_VENDOR/
>   * Removed "if unsure, say Y"
> ---
>  xen/arch/x86/Kconfig.cpu  | 43 +++++++++++++++++++++++++++++++++++++++
>  xen/arch/x86/cpu/Makefile |  6 +++---
>  2 files changed, 46 insertions(+), 3 deletions(-)
> 
> diff --git a/xen/arch/x86/Kconfig.cpu b/xen/arch/x86/Kconfig.cpu
> index 5fb18db1aa..f895cfe97a 100644
> --- a/xen/arch/x86/Kconfig.cpu
> +++ b/xen/arch/x86/Kconfig.cpu
> @@ -19,4 +19,47 @@ config INTEL
>         May be turned off in builds targetting other vendors.  Otherwise,
>         must be enabled for Xen to work suitably on Intel platforms.
>  
> +config HYGON
> +     bool "Support Hygon CPUs"
> +     select AMD
> +     default y
> +     help
> +       Detection, tunings and quirks for Hygon platforms.
> +
> +       May be turned off in builds targetting other vendors.  Otherwise,
> +       must be enabled for Xen to work suitably on Hygon platforms.
> +
> +
> +config CENTAUR
> +     bool "Support Centaur CPUs"
> +     select INTEL
> +     default y
> +     help
> +       Detection, tunings and quirks for Centaur platforms.
> +
> +       May be turned off in builds targetting other vendors.  Otherwise,
> +       must be enabled for Xen to work suitably on Centaur platforms.
> +
> +config SHANGHAI
> +     bool "Support Shanghai CPUs"
> +     select INTEL
> +     default y
> +     help
> +       Detection, tunings and quirks for Shanghai platforms.
> +
> +       May be turned off in builds targetting other vendors.  Otherwise,
> +       must be enabled for Xen to work suitably on Shanghai platforms.
> +
> +config UNKNOWN_CPU_VENDOR
> +     bool "Support unknown CPU vendors"
> +     default y
> +     help
> +       This option prevents a panic on boot when the host CPU vendor isn't
> +       supported by going into a legacy compatibility mode and not applying
> +       any relevant tunings or quirks.
> +
> +       Not selecting this options while selecting multiple vendors doesn't 
> have
> +       any major effect on code size, but selecting a single vendor with this
> +       option cleared produces a much smaller build.
> +
>  endmenu
> diff --git a/xen/arch/x86/cpu/Makefile b/xen/arch/x86/cpu/Makefile
> index 7cfe28b7ec..84b060aa41 100644
> --- a/xen/arch/x86/cpu/Makefile
> +++ b/xen/arch/x86/cpu/Makefile
> @@ -3,13 +3,13 @@ obj-y += microcode/
>  obj-y += mtrr/
>  
>  obj-y += amd.o
> -obj-y += centaur.o
> +obj-$(CONFIG_CENTAUR) += centaur.o

Maybe I'm missing some context here, but I think this would break the
build?

cpu/centaur.c exports centaur_cpu_dev which is referenced from
cpu/common.c, and I don't see you making that reference in
cpu/common.c conditional to CONFIG_CENTAUR being defined?

I think the same applies to Hygon and Shanghai.

Thanks, Roger.



 


Rackspace

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