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

Re: [PATCH v2 2/4] x86: allow Kconfig control over psABI level


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Wed, 19 Jul 2023 11:04:58 +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=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=rlYpYnPJfzYMFldqzB+wsYVPb5M2tzyK6CbsXxYmFNg=; b=l79FFGuHqvrYMp5hGuHXPGOJOrTGI++k5qUuuf361JUWMrf3lL3wcDuyfdi3lCy7mcDu6e4wgfy+N05CTxujgvKK3PJTcITqI8G5glqPRANVG9ZY6pAuO4/T5eUrXPij30Jjaq/YJiZU9Rgn5xJf3PbAWr16zssDrTK4Thq1ieCJcPzojzEkCc38aR0Vqf6St496SRrELgiTm9rQu7RbvLE89IT3iqsFyn1xyB2ACcKlKSr6p2S4GFsYD8nA/l8AhGJwcRlWPN1bXJx1p0waCPcIZYplYQPQe3LKRVgR6jlYxk9UBT9cN7+AxFHjdPx0X79bj1XPs4oPljs6Q8ijHg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DOqNXjY/Ds9ikYpbkX/7o3XJWl2Kv8Uns1YqWLjTiWklQUPEr+bkhVzmRwvMpW88WUqX33WUSb/k4ZPU0r2Cqu2QtW5lYemB9SEgNeCiP7q+OIEVUZqIKIWhFBWSdmzKOGqXxnJSLkzu3R6VKPVi0qwuHy1nBWUPuNzR6eJxuVs1ULSI4iyP7J0QkS+Ke83/lFqzEPSOLJPsEarM/LgmJnQW1pRAl7woIiowFZ92zwlOdUsvYArFZ53OxV/A4xyz4LYzZfFpiBeTvwX9o9WoZvNe9kumUqxPMV4VFp4hhjaQR7X/bRLAquXvgUUp09tEGnKapfGqPMuk2KJdIu5Wxg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Wed, 19 Jul 2023 10:05:29 +0000
  • Ironport-data: A9a23:azNzLqooKLvhjRXYxSM2jGMcOw5eBmI1ZBIvgKrLsJaIsI4StFCzt garIBnSParbNjDxf4okYNyz804DvJ7Tz983S1Rk/iBhEipHo5uZCYyVIHmrMnLJJKUvbq7FA +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYWYpA1c/Ek/NsDo788YhmIlknNOlNA2Ev NL2sqX3NUSsnjV5KQr40YrawP9UlKq04GpwUmAWP6gR5weBzihNVfrzGInqR5fGatgMdgKFb 76rIIGRpgvx4xorA9W5pbf3GmVirmn6ZFXmZtJ+AsBOszAazsAA+v9T2Mk0MC+7vw6hjdFpo OihgLTrIesf0g8gr8xGO/VQO3kW0aSrY9YrK1Dn2SCY5xWun3cBX5yCpaz5VGEV0r8fPI1Ay RAXACtQVRHd2b2H+fGAFNYzge4oAsXpOKpK7xmMzRmBZRonabbqZvyQoPN9gnI3jM0IGuvCb c0EbzYpdA7HfxBEJlYQDtQ5gfusgX78NTZfrTp5p4JuuzSVkFM3jemraYSFEjCJbZw9ckKwj 2TK5WnmRDodM8SS02Gt+XOwnO7f2yj8Xer+EZXhr6A12wbPmzZ75Bs+bFC7/KeWsmeCfcsOE khTqhss9/lp6xn+JjX6d1jiyJKehTYeUddNF+wx6CmW17HZpQ2eAwAsXjNHLdArqsIybTgrz UOS2cPkAyR1t7+YQm7b8a2bxRutPQAFIGlEYjULJTbp+PHmqYA3yx7KENBqFffvisWvQG+gh TeXsCI5mrMfy9YR0Lm29kzGhDTqoYXVSgky5UPcWWfNAh5FWbNJrreAsTDzhcus5q7AJrVdl BDoQ/Sj0d0=
  • Ironport-hdrordr: A9a23:pudJl6mFHAb6wWDPBmD7ALEgTAXpDfIH3DAbv31ZSRFFG/Fw9v re+cjzsCWf5Qr5N0tNpTntAsa9qArnhOdICOoqTNWftWvd2FdARbsKhbcKpQePJ8SUzJ8/6U 4PSclD4erLfDxHZJbBizVQy+xQu+VvKprY49s2Ek0dKj2Ct5sQlzuR1DzraHFLeA==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 19/07/2023 10:44 am, Jan Beulich wrote:
> --- a/xen/arch/x86/Kconfig
> +++ b/xen/arch/x86/Kconfig
> @@ -118,6 +118,36 @@ config HVM
>  
>         If unsure, say Y.
>  
> +choice
> +     prompt "base psABI level"
> +     default X86_64_BASELINE
> +     help
> +       The psABI defines 4 levels of ISA extension sets as a coarse granular
> +       way of identifying advanced functionality that would be uniformly
> +       available in respectively newer hardware.  While v4 is not really of
> +       interest for Xen, the others can be selected here, making the
> +       resulting Xen no longer work on older hardware.  This option won't
> +       have any effect if the toolchain doesn't support the distinction.
> +
> +       If unsure, stick to the default.
> +
> +config X86_64_BASELINE
> +     bool "baseline"
> +
> +config X86_64_V2
> +     bool "v2"
> +     help
> +       This enables POPCNT and CX16, besides other extensions which are of
> +       no interest here.
> +
> +config X86_64_V3
> +     bool "v3"
> +     help
> +       This enables BMI, BMI2, LZCNT, MOVBE, and XSAVE, besides other
> +       extensions which are of no interest here.
> +
> +endchoice
> +
>  config XEN_SHSTK
>       bool "Supervisor Shadow Stacks"
>       depends on HAS_AS_CET_SS
> --- a/xen/arch/x86/arch.mk
> +++ b/xen/arch/x86/arch.mk
> @@ -36,6 +36,10 @@ CFLAGS += -mno-red-zone -fpic
>  # the SSE setup for variadic function calls.
>  CFLAGS += -mno-mmx -mno-sse $(call cc-option,$(CC),-mskip-rax-setup)
>  
> +# Enable the selected baseline ABI, if supported by the compiler.
> +CFLAGS-$(CONFIG_X86_64_V2) += $(call cc-option,$(CC),-march=x86-64-v2)
> +CFLAGS-$(CONFIG_X86_64_V3) += $(call cc-option,$(CC),-march=x86-64-v3)

I know we're having severe disagreements over Kconfig compiler checking,
but this patch cannot cannot go in in this form.

You're asking the user unconditionally for the psABI level, then
ignoring the answer on toolchains which don't understand it.

The makefile needs to be unconditional, and the Kconfig options need to
depend on suitable toolchain support.  This is the only way we don't get
a false statement written into the .config, and embedded in hypfs.

~Andrew



 


Rackspace

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