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

[PATCH 1/6] x86/Kconfig: add selection of default x2APIC destination mode


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Thu, 23 Jun 2022 10:24:23 +0200
  • 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=7D3+9B1wNBssAOS6U4CtpT3AYDnVm0sewLbpEyQ/iCE=; b=If/mSBDx8cbzhFT1GZJAkkBKJSuQeAJ2tUa3qbYt3uUCAWIeOl4/QJelSBjbuqlky6H94J51458ybzkNYcN8TvUYNn17BXxqYUO7SYIPoKUisR0U+V2QZmOrioumkW6p9BKK6HKzYzgC8bq/T0a/aiq/OFlm4EcxNpEIa6KiVIXJYG9fKyA+ErfmybmiPa4SYVo6YCJA+Ed9cGpEpzROWhqOBsEG0ofBWIp4W9PfK2Hm5vRuGHiwy4zyLDtI1OqYByYN1e3eSS1/4Rzt8qBlgMisSQEfImwnRXoKTXI1346FKRnHScQ1ezZ7QWtOvGZp5kDByExpQlhJAsU0ytU0Uw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CdkAzbg6Gg9lG8qBl9jAzxBuo5vKWuVYmCpURHXq6LKK+8+IuOdE+fWRaQ+Y/KWo89W6rSM+bUSHgibCkrhL9COz49OHjPasic/xCQZHizreN2J/ApTX9iZtKLZsemXIXLXfAZzshpp+gOuqtkLA+1KhXLT1XKmAiB5WpQDV4DQSqCXgrUsT9uanEwJEz7wf6piHD8plDdbZz3P9hihL9iHL6i71UMTzdLZEXbcAZ8nJEcQrBFCTgVwt79tzmfrOZYpNXgtG9dRkQWKGZG04bWC2qWhuz9HeWY+QMkOW/dj81pM9xys1ZbaoahlbI0sDZbwp0g4/YnGFrHseXcgb3A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Thu, 23 Jun 2022 08:25:27 +0000
  • Ironport-data: A9a23:bBaqlK+7EiuI4WHy9zBFDrUD9H+TJUtcMsCJ2f8bNWPcYEJGY0x3y msaW22POfiCMzD2KdkjO9jn805UuJXdx95iQQVp+Cs8E34SpcT7XtnIdU2Y0wF+jyHgoOCLy +1EN7Es+ehtFie0Si+Fa+Sn9T8mvU2xbuKU5NTsY0idfic5DnZ74f5fs7Rh2NQw34LjW1/lV e7a+KUzBnf0g1aYDUpMg06zgEsHUCPa4W5wUvQWPJinjXeG/5UnJMt3yZKZdhMUdrJ8DO+iL 9sv+Znilo/vE7XBPfv++lrzWhVirrc/pmFigFIOM0SpqkAqSiDfTs/XnRfTAKtao2zhojx/9 DlCncO0VxoUY7+SodYifDlxFChvJrFt6IaSdBBTseTLp6HHW13F5qw0SW0TY8gf8OsxBnxS/ /sFLjxLdgqEm++93LO8TK9rm9gnK87oeogYvxmMzxmAVapgHc+FHvSMvIEJtNszrpkm8fL2f c0WZCApdB3dSxZOJk0WGNQ1m+LAanzXLGEC8wzP/fZfD2774i9S9OXBaPnvXMWVQ59IglyUv m+e1jGsav0dHJnFodafyVq8i+mKkS7lVYY6ELyj6uUskFCV3nYUChAdSR28u/bRoky0Vs9bK kcU0jEztqV0/0uuJvHiWzWorXjCuQQTM+e8CMU/4QCJj6bRvQCQAzFeSiYbMYJ38sgrWTYty 1mF2cvzAiBiu6GUTnTb8aqIqTS1Om4eKmpqiTI4cDbpKuLL+Okb5i8jhP44eEJpprUZwQ3N/ g0=
  • Ironport-hdrordr: A9a23:+A0boa9G51zemGK+0xZuk+FKdb1zdoMgy1knxilNoENuH/Bwxv rFoB1E73TJYVYqN03IV+rwWpVoJkmsj6KdgLNhRotKOTOLhILGFvAH0WKP+V3d8mjFh5dgPM RbAtdD4aPLfD9HZK/BiWHXcurIguP3iJxA7d2us0uFJjsaDp2IgT0JaTpyRSZNNXR77NcCZd Ohz/sCgwDlVWUcb8y9CHVAd+/fp+fTnJajRRIdHRYo5CSHkDvtsdfBYlOl9yZbdwkK7aYp8G DDnQC8zqK/s8ujwhuZ82PI9ZxZlPbo19MGLs2Rjco+LCnql2+TFcxccozHmApwjPCk6V4snt WJixA8P/5r43eURW2xqQuF4XiV7B8er1vZjXOIi3rqpsL0ABggDdBauI5fehzFr2I9odBVys twri2knqsSKSmFsDX25tDOWR0vvFGzu2AenekaiGEaeZcCaYVWsZcU8CpuYds99RrBmcEa+d RVfYHhDK48SyLYU5mZhBgj/DWUZAV8Iv/cKXJy+PB80FBt7QVEJgUjtYkid0w7heMAoql/lp r525tT5cFzp7ctHMRA7cc6MLyK4z/2MGTx2Fz7GyWVKIg3f1TwlrXQ3JIZoMmXRb1g9upBpH 2GaiITiVIP
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Allow selecting the default x2APIC destination mode from Kconfig.
Note the default destination mode is still Logical (Cluster) mode.

Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/arch/x86/Kconfig          | 29 +++++++++++++++++++++++++++++
 xen/arch/x86/genapic/x2apic.c |  6 ++++--
 2 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index 1e31edc99f..f560dc13f4 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -226,6 +226,35 @@ config XEN_ALIGN_2M
 
 endchoice
 
+choice
+       prompt "x2APIC default destination mode"
+       default X2APIC_LOGICAL
+       ---help---
+         Specify default destination mode for x2APIC.
+
+         If unsure, choose "Logical".
+
+config X2APIC_LOGICAL
+       bool "Logical mode"
+       ---help---
+         Use Logical Destination mode.
+
+         When using this mode APICs are addressed using the Logical
+         Destination mode, which allows for optimized IPI sending,
+         but also reduces the amount of vectors available for external
+         interrupts when compared to physical mode.
+
+config X2APIC_PHYS
+       bool "Physical mode"
+       ---help---
+         Use Physical Destination mode.
+
+         When using this mode APICs are addressed using the Physical
+         Destination mode, which allows using all dynamic vectors on
+         each CPU independently.
+
+endchoice
+
 config GUEST
        bool
 
diff --git a/xen/arch/x86/genapic/x2apic.c b/xen/arch/x86/genapic/x2apic.c
index de5032f202..4b9bbe2f3e 100644
--- a/xen/arch/x86/genapic/x2apic.c
+++ b/xen/arch/x86/genapic/x2apic.c
@@ -228,7 +228,7 @@ static struct notifier_block x2apic_cpu_nfb = {
    .notifier_call = update_clusterinfo
 };
 
-static s8 __initdata x2apic_phys = -1; /* By default we use logical cluster 
mode. */
+static int8_t __initdata x2apic_phys = -1;
 boolean_param("x2apic_phys", x2apic_phys);
 
 const struct genapic *__init apic_x2apic_probe(void)
@@ -241,7 +241,9 @@ const struct genapic *__init apic_x2apic_probe(void)
          * the usage of the high 16 bits to hold the cluster ID.
          */
         x2apic_phys = !iommu_intremap ||
-                      (acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL);
+                      (acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL) ||
+                      (IS_ENABLED(CONFIG_X2APIC_PHYS) &&
+                       !(acpi_gbl_FADT.flags & ACPI_FADT_APIC_CLUSTER));
     }
     else if ( !x2apic_phys )
         switch ( iommu_intremap )
-- 
2.36.1




 


Rackspace

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