From patchwork Thu Jun 23 08:24:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 12891928 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EAFF5CCA480 for ; Thu, 23 Jun 2022 08:25:39 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.354578.581757 (Exim 4.92) (envelope-from ) id 1o4I9O-0005kg-39; Thu, 23 Jun 2022 08:25:18 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 354578.581757; Thu, 23 Jun 2022 08:25:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1o4I9O-0005kX-06; Thu, 23 Jun 2022 08:25:18 +0000 Received: by outflank-mailman (input) for mailman id 354578; Thu, 23 Jun 2022 08:25:16 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1o4I9M-0005Uq-M4 for xen-devel@lists.xenproject.org; Thu, 23 Jun 2022 08:25:16 +0000 Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com [216.71.145.155]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 013765d6-f2ce-11ec-bd2d-47488cf2e6aa; Thu, 23 Jun 2022 10:25:15 +0200 (CEST) Received: from mail-dm6nam12lp2169.outbound.protection.outlook.com (HELO NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.169]) by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 23 Jun 2022 04:25:12 -0400 Received: from DS7PR03MB5608.namprd03.prod.outlook.com (2603:10b6:5:2c9::18) by MN2PR03MB5008.namprd03.prod.outlook.com (2603:10b6:208:1ac::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.15; Thu, 23 Jun 2022 08:25:11 +0000 Received: from DS7PR03MB5608.namprd03.prod.outlook.com ([fe80::40af:d5f4:95eb:d534]) by DS7PR03MB5608.namprd03.prod.outlook.com ([fe80::40af:d5f4:95eb:d534%7]) with mapi id 15.20.5353.022; Thu, 23 Jun 2022 08:25:11 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 013765d6-f2ce-11ec-bd2d-47488cf2e6aa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1655972715; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=f10z1FY1cEzgBr5aQzVFoWFCR34qa1FghZWIHlDrVVk=; b=ihXQi4ubWa5LSdoAzs65tqCvD8F/MdLQ4h5ILDm0SUX8RqxniHlWbxaN w5iz96Ie57Dj+eJISzFuM3Gwvcgb9GqwQfYs3gQ0kEYcg86jpgiguu8Ih Kswa2Md7TpcxUUqVuPJPE3IPsRLF2UWY3rNPQxRGA5JOpRNIiZ8p3OLvU U=; X-IronPort-RemoteIP: 104.47.59.169 X-IronPort-MID: 74236204 X-IronPort-Reputation: None X-IronPort-Listener: OutboundMail X-IronPort-SenderGroup: RELAY_O365 X-IronPort-MailFlowPolicy: $RELAYED IronPort-Data: A9a23:bBaqlK+7EiuI4WHy9zBFDrUD9H+TJUtcMsCJ2f8bNWPcYEJGY0x3y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4snt WJixA8P/5r43eURW2xqQuF4XiV7B8er1vZjXOIi3rqpsL0ABggDdBauI5fehzFr2I9odBVys twri2knqsSKSmFsDX25tDOWR0vvFGzu2AenekaiGEaeZcCaYVWsZcU8CpuYds99RrBmcEa+d RVfYHhDK48SyLYU5mZhBgj/DWUZAV8Iv/cKXJy+PB80FBt7QVEJgUjtYkid0w7heMAoql/lp r525tT5cFzp7ctHMRA7cc6MLyK4z/2MGTx2Fz7GyWVKIg3f1TwlrXQ3JIZoMmXRb1g9upBpH 2GaiITiVIP X-IronPort-AV: E=Sophos;i="5.92,215,1650945600"; d="scan'208";a="74236204" 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== 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-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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7D3+9B1wNBssAOS6U4CtpT3AYDnVm0sewLbpEyQ/iCE=; b=X19pl1H3V1PVUKEEgPY3Sm+x79WDnOA06+aMIFRiBg+G+okhW0/MWtyFe64y5XIuxQK+I1IMh8mgQSdUWEmLKPiToxa5GwfUJud7BkO70u4JLfNWjoQKKVYfCqpj3HDfR1/jgDPRrt6DVcM9ouVabu4wpVyBH+1vVHXAndYE0Cs= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com; From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Roger Pau Monne , Jan Beulich , Andrew Cooper , Wei Liu Subject: [PATCH 1/6] x86/Kconfig: add selection of default x2APIC destination mode Date: Thu, 23 Jun 2022 10:24:23 +0200 Message-Id: <20220623082428.28038-2-roger.pau@citrix.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220623082428.28038-1-roger.pau@citrix.com> References: <20220623082428.28038-1-roger.pau@citrix.com> X-ClientProxiedBy: LO4P123CA0086.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:190::19) To DS7PR03MB5608.namprd03.prod.outlook.com (2603:10b6:5:2c9::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5c426ef9-13df-4ac6-dd43-08da54f1e3bf X-MS-TrafficTypeDiagnostic: MN2PR03MB5008:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1qaOju36ZDvS39oZEdLbat6Z5da2uQk/21u+2QN65Gh1V3c2n2lVXAQ/X5Zy5oz6ib1Yil1eN5hMGXsnvbLcXFOjt88bFFUZPO/EDTbdm2SNf5tI1j4HsN8ey741SlB9LaruuO6DqfFq9Ne9oE+ChzR+38RjkAzJgRT0mvceqbWhDblN2ZGVgdHkhQUTF1quarf6Blx9wpYJKxARe9j/rgSKT42KNt0XO15Y1aMa6Tf8Q3p98GoqmYOUb3D4+9lx+5IV0JP2VbKU9HdN7zUVsUa1hlpIYRsCmY2mF5BZ3sZU5c5wpIgcoGVtEZgELDsl08HKuxYYRd2cE1LryFm50+IooW0Is0cgbIuqG2NXmQEy+1QT9Fi+Iu/hQOxtyerraXyhloMRIp+A7a3jZ/SXC1tpxsdEOJJIe0z2oVekm1HnMtQ1AZF22AXaSMNHuMulR8Hz0R3PbOhk+Io5aZuh7BK7EJo76W9Pr59vYxPTkuia1WVwU6pTrfAx1xjtZAhk8tEldzJbXofQ1ApP37laJVnMxAKyl9BAxHJWIzni1Dma4IT/NFPrEtbpSqdUaHzN1dWZDprcIPGGXT3rDxGtovc1d8LH4ubNjgZvPlB+kbd97F1k63BIHKQpt69sEcZQUVo8RRZsTq5tW4G1kD9aW4rjNvzPm4BePwo7l9E7qwh5LL+KHNN6iIqOki0s7qkZ19ilKsWr/G+VD/wkvnGKbw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR03MB5608.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(136003)(366004)(376002)(396003)(346002)(39860400002)(82960400001)(6916009)(2906002)(6486002)(38100700002)(5660300002)(316002)(86362001)(8936002)(6512007)(66556008)(8676002)(36756003)(54906003)(2616005)(4326008)(66946007)(6506007)(83380400001)(1076003)(26005)(41300700001)(478600001)(66476007)(186003)(6666004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?/RLdRQQtMJvpcs/PYXvFdM/s1UVC?= =?utf-8?q?3uuaSWbL0LeAK96m4MfH2Rf0r5bHHQBR7d3XOPk2HmxgYUUtYZJt8MUtRJ8uyG4KL?= =?utf-8?q?qjsBYQ6I7G83sJv21yDO2C/UGaexgLF4bcxhyBQkfjeHPSTUGHx9hCC6Afj/GvTU9?= =?utf-8?q?sQbaqgwP01Dz6/4jNE9Z52yxvYtxFa4xdv/PcBViECKQ2EOvN7oxF6eLQp9NgEJkb?= =?utf-8?q?mhoZHKXCKfJ52EsRUsksCJrbwYv19uYJABzjf5BKgZzkvWQk96w5usmYnYfMRXXuz?= =?utf-8?q?N4ivI5L5ksCQGQ82uRom3Qd2hgn3unspaVp7Nim4yCdsbbGd5fghLM1QcVqfPKOOu?= =?utf-8?q?xWCnJd4kDruewBH6PpGi2jG6TifWzG0RGaXhHQacKJ7a1Ttt7CWMSW5toboA5eJ3r?= =?utf-8?q?yFDVX6NgWufiU8ES3/azSsaLZ6/7ZA0xuLhho17QzcEeO2lfJT0cV8eADx8C98nGN?= =?utf-8?q?vB851JMeSF8+XQavrNCmngo6TNc6Am4y+0v5Q/Pg6zWdAZ2ezx+IDNPFh0lN9D3Ey?= =?utf-8?q?SpcmMypXBhXIGJ3HCOl+sptoasULG9PKLE0+hcr1NWcZQzjCWaAaC2elczUnwNDR/?= =?utf-8?q?TKPPkEy2xj6JNxescCui9hyMxwgMxm158QxwW79kewcTq7AW0f2Ntc1lsEOCDYJPR?= =?utf-8?q?e/4pAgEG66WUnWgl6R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= X-OriginatorOrg: citrix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5c426ef9-13df-4ac6-dd43-08da54f1e3bf X-MS-Exchange-CrossTenant-AuthSource: DS7PR03MB5608.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jun 2022 08:25:11.2619 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vUNBIsXR+F2uvv68TB0aStpxT9JNDNR/nKrlHZ/lSM4XXMjQKyy/k01HLye2i+YlAiqnhnJnBIR7CUnA4X30YA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR03MB5008 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é --- 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 )