From patchwork Fri Jan 21 09:01:46 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: 12719532 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 0896AC433FE for ; Fri, 21 Jan 2022 09:02:34 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.259284.447379 (Exim 4.92) (envelope-from ) id 1nApoL-0004JI-M1; Fri, 21 Jan 2022 09:02:21 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 259284.447379; Fri, 21 Jan 2022 09:02:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nApoL-0004JB-Hj; Fri, 21 Jan 2022 09:02:21 +0000 Received: by outflank-mailman (input) for mailman id 259284; Fri, 21 Jan 2022 09:02:19 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nApoJ-0004J3-Dj for xen-devel@lists.xenproject.org; Fri, 21 Jan 2022 09:02:19 +0000 Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id d347591d-7a98-11ec-bc18-3156f6d857e4; Fri, 21 Jan 2022 10:02:15 +0100 (CET) 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: d347591d-7a98-11ec-bc18-3156f6d857e4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1642755736; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=xruKqgasY5HYaX+rO9KYoyn+hj/hj/XhJdIt7oNO8ic=; b=d78cipqkOKb+Z9e3xpwJil8xUsnJc4XaIDgX1efLcwRTfrJxmgxRt3O/ 3EQQCtvqnNQvfscrNWJbFH9bt2qGbd1p3CuaUPucHNFsLXfRMYO1SnoIH sm/1aC+1S4wmvCPCf36aTzpntTohYRnysy0g9a7m23PzHie4//O/8PISe M=; Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com IronPort-SDR: fBInysA/FVwYQQCmFSCWLlFHoNkk9xL196/yasiI2Sj0XEi8xKKVyZDbYciDhuUqdG0eCpxhI8 /ZWpV5mNcbfFKxVTiu8+EguBHrzYE4Or6CTaMmSJqdB1/709CjXeIEQ27SYvVpWGpzB3H8uSOi zLYfD9hS9WzPjhZ9cOhdB/0GQHA7reVX5p0/XBDu/JUvgkpqbQ02431CxDISfisVXKUfv16R20 uS0Ie6vs6Mxzxbyo0WNQq408KT4gR4sNA7v1LJCF0qr/UZ4jTbkVTohQrctJ6mfsfhoIe0W5E7 7ssj2k0P1QrSUu0NzwakydE3 X-SBRS: 5.2 X-MesageID: 64629217 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:ILqOu6OcDYeJIBzvrR25kcFynXyQoLVcMsEvi/4bfWQNrUoh32YHy WcZDz/UP/qCZ2XxeNslOYW3/EwEvp7WzNI2TQto+SlhQUwRpJueD7x1DKtR0wB+jCHnZBg6h ynLQoCYdKjYdpJYz/uUGuCJQUNUjMlkfZKhTr6UUsxNbVU8En150Eg6w7dRbrNA2rBVPSvc4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W9yUkqp/VWGmLeXLzYO91a9MwQ/U/WuonlrdCsT9Tpc+CQd9k1wg67VBaM0o9 gsCZ4Y542mePVmGZ6VNN1xMfdfNVa9My4kSFjiWWgPNJt3ck4l+KSHqInc2omRCek1Jd0J6d P8bG8= X-IronPort-AV: E=Sophos;i="5.88,304,1635220800"; d="scan'208";a="64629217" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oB7E2DyHRt4ikf5+v4D1w0NTRVTZs7HLWiFKxj3zW+bWKiaQVn1QFRBpJSD8J/bLHTtxg/3zZWhA8jA2WYeauvdDO1/DAQVGur9iuhPFCuE/oRb4upAA9KH6XDPTm0fgnbdmI4L51+/2O28R+Dx5E9eepw4/tn9snH+P+7NyHaspJFh5qNDTvA6IOXOIN0diLC37F945PSPSV2orotWcxtaHpqSogdU2TefKMbI8rYFVDcd3gCWcQXyuScemffJUt3lVdsq0hI4o92yrLCDA9c/JMBU5WJjd5lrpETR2+lpDSU/C+Zot4RqjC52ywe9/SSSSAq56J4YEKdJWugLo9w== 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=4GQtCO8m3tAl2RPxHrcI+Aqf67JkTTp2rtnhBaDCS/4=; b=gpuNo1drAxVP4ldyJxuIjJjdxcNke+33giF3pK5gPMvk6nJQVpCFd4/5V4b22VoeWmW2kNHoPryoObofjtJUmqWdjK2q8+R61CPBvhdf5j9JhpSDq9FBHQpPTpr5J+pkMIzmlcw4gQY+gAJI/lsqA/E0g5Hz11mR4fm9Y7FkJRNwHrHrvZicULDB/cC3Hm0S7U/lxVE0l4Oy2LmTBVLKJEsmjZlgQDXKw0eCVH+sfgTB904PXTG9S3VqMcpu/G9THi79yQUYl6mCnjaIRCJZooFFeukqbXCbrrc2kSC7dhhKoEAKz3BTbQcAel6sfO71Ai5NBxUnzoBhluaBEOHr1A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=4GQtCO8m3tAl2RPxHrcI+Aqf67JkTTp2rtnhBaDCS/4=; b=NWpBw1kmDzTVqfIiXAZQ/Sqj91SVk9cuAlNJewAOz9lWDwLU9DWp31LbuJXd6SVxoc7dObopV3qkmHraiRMXUcR6Rtf9njOOx5i0D7E1h9MdsjJHjvKK39TScHdsJovEXf8kPn9NDld8XlX7o14DFgnTfs283SYo9yqYbxZbbD4= From: Roger Pau Monne To: CC: Roger Pau Monne , Boris Ostrovsky , Juergen Gross , Stefano Stabellini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , , "H. Peter Anvin" , Subject: [PATCH] xen/x2apic: enable x2apic mode when supported for HVM Date: Fri, 21 Jan 2022 10:01:46 +0100 Message-ID: <20220121090146.13697-1-roger.pau@citrix.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-ClientProxiedBy: MR1P264CA0071.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501:3f::20) 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: d0d5230e-7887-4374-c8f6-08d9dcbcb378 X-MS-TrafficTypeDiagnostic: DM6PR03MB4476:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:556; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ELqzPaYvxeI7oZylrEJHLDJd89io6oJzZ6H2xqeFzxA2n09Er1i1m2n4PhOCcvNbHxVa3xpuykeWlHBDPh4qLa3XWNpDS+EiCNTSyrJwQaThK/BgXFflU8+19ADp8Izk1V77fZqfOMo3RIvd4tYVTFauIynPRJxJbxMwYtkPoUJOLIDe5wz4A+s18YitVbmsbLwAD3/o0ls7bukOsgFhFEZj7Qu0RYesbQdyz8q4ejkOsGvL/DjVyZMvjMf2aQ8rYM/c3YZczwEMQagEnOF1FP1wBx7cGjst13lNA/xhOP0667gzoLI7WXzLP0BPZ/PC+mWZLCb9LMmkMDyR2PKTR5yoDpC8pl7DXZ9nEMZaMZjHtsJs/wwHWJbt8t7w2uyPwKfNVuk71Wb1ZA1r8cxbypC4jJ6QeLeMxpLl9GQ10YYv//kdzGFlhfR/WopKAH7zSzFKIfXPO3CqW7zI0waWZMqYYjKvjuvFXeSAzA72IcB887vLyjkmWf1af/VAxrX8eUTKmvPqNB4vQt6Xo03Gn9SVdSmQPRETL6BJbSuLUHBZsbuaPyhSB5GKz9GqiVwK994vQf8Cg8gKEdrXOVIzYOOu6QshcU9D+IGZntGQ+PTuyKQWnBUDi1dG5x04VOXf4n6NZE8w0LUWd0c7FP+uNg== 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:(4636009)(366004)(2906002)(6486002)(82960400001)(1076003)(8676002)(38100700002)(7416002)(8936002)(2616005)(86362001)(6506007)(6916009)(36756003)(26005)(54906003)(316002)(4326008)(66946007)(66556008)(66476007)(5660300002)(508600001)(6512007)(186003)(6666004)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?FBin9i5XCNuzHwZXDaG/RGrt0hvt?= =?utf-8?q?afyFR/M8g5RdWblJhtXfvVzQwWbPaHYgUN8J8jp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B8NWlOHZ31RqVfuk+jXS85zS?= =?utf-8?q?96hyr6WGKzJHzNJsEgtHt7LIlD+gmrnLVuyV407sdncyfpvVBtlByqlGAyI+sz5pY?= =?utf-8?q?ywpmJyXNqRVOM2jtqwNJ7jGgdAclMIRFW7fWrsgKnUs2lf0rSrolgZvlnf/BXOesm?= =?utf-8?q?KfrEMTBRHyJyou+cjFXlK6OzA6hp1MFUwFAAp2VNZdYW6owK5mKSEgzL6us0RnngR?= =?utf-8?q?JZFAfYv9e4KnBuXhp1u8DQxJWh5r57UNES19mBSyTLR4Hi60uvPX5GG0FZ7LQ8fbS?= =?utf-8?q?kXrdmL+T1GZw1kfVHCIiYEGsfKp2D6q69ibB3nur306ot7qRuLS4ZV8cpTr0RUJMC?= =?utf-8?q?Danlx2Tw9ONnZ/ElkY4DoZgdycWwyKmp0dO4H48rmdpBlMwvgBaczSbTaV68LeOAx?= =?utf-8?q?jAOhXoiqoQHkcb/sY7YhGdH0yYCgjrz3BFsOqNJ4enIXu1t25TnWr2nVQSCTWX2a+?= =?utf-8?q?FK3uko46FS3x/V2XodcmQ7QRKnOhzSdEz+T9f5mfc3Sb4DujF2+5fVaS0hrq+9nFt?= =?utf-8?q?bvPKfRv6ydoD77scXZWPadKDtTT7iTmsdANo8T4IeCI0gwQxXNbxMQZeXy3bPQj20?= =?utf-8?q?e1HZgW+d7zBcKhAYowF6CpXNf1tMgOBmFQ1s/Ya5DnynNcPjYqQ4N5c=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: d0d5230e-7887-4374-c8f6-08d9dcbcb378 X-MS-Exchange-CrossTenant-AuthSource: DS7PR03MB5608.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2022 09:02:07.4978 (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: iwxy0fEnFy0k9qPoL4LClPuypx8w963hBoL1hlzm+E2rIB0j0L49B5uK5ZA0mBMCHvWGffOb/smIGLAHvuQ5Ww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR03MB4476 X-OriginatorOrg: citrix.com There's no point in disabling x2APIC mode when running as a Xen HVM guest, just enable it when available. Remove some unneeded wrapping around the detection functions, and simply provide a xen_x2apic_available helper that's a wrapper around x2apic_supported. Signed-off-by: Roger Pau Monné Reviewed-by: Boris Ostrovsky --- Changes since v1: - Remove useless code around x2APIC detection for Xen. --- Cc: Boris Ostrovsky Cc: Juergen Gross Cc: Stefano Stabellini Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: x86@kernel.org Cc: "H. Peter Anvin" Cc: xen-devel@lists.xenproject.org --- arch/x86/include/asm/xen/hypervisor.h | 14 -------------- arch/x86/xen/enlighten_hvm.c | 13 ++++--------- 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/arch/x86/include/asm/xen/hypervisor.h b/arch/x86/include/asm/xen/hypervisor.h index 1bf2ad34188a..16f548a661cf 100644 --- a/arch/x86/include/asm/xen/hypervisor.h +++ b/arch/x86/include/asm/xen/hypervisor.h @@ -43,20 +43,6 @@ static inline uint32_t xen_cpuid_base(void) return hypervisor_cpuid_base("XenVMMXenVMM", 2); } -#ifdef CONFIG_XEN -extern bool __init xen_hvm_need_lapic(void); - -static inline bool __init xen_x2apic_para_available(void) -{ - return xen_hvm_need_lapic(); -} -#else -static inline bool __init xen_x2apic_para_available(void) -{ - return (xen_cpuid_base() != 0); -} -#endif - struct pci_dev; #ifdef CONFIG_XEN_PV_DOM0 diff --git a/arch/x86/xen/enlighten_hvm.c b/arch/x86/xen/enlighten_hvm.c index 42300941ec29..6448c5071117 100644 --- a/arch/x86/xen/enlighten_hvm.c +++ b/arch/x86/xen/enlighten_hvm.c @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -242,15 +243,9 @@ static __init int xen_parse_no_vector_callback(char *arg) } early_param("xen_no_vector_callback", xen_parse_no_vector_callback); -bool __init xen_hvm_need_lapic(void) +static __init bool xen_x2apic_available(void) { - if (xen_pv_domain()) - return false; - if (!xen_hvm_domain()) - return false; - if (xen_feature(XENFEAT_hvm_pirqs) && xen_have_vector_callback) - return false; - return true; + return x2apic_supported(); } static __init void xen_hvm_guest_late_init(void) @@ -312,7 +307,7 @@ struct hypervisor_x86 x86_hyper_xen_hvm __initdata = { .detect = xen_platform_hvm, .type = X86_HYPER_XEN_HVM, .init.init_platform = xen_hvm_guest_init, - .init.x2apic_available = xen_x2apic_para_available, + .init.x2apic_available = xen_x2apic_available, .init.init_mem_mapping = xen_hvm_init_mem_mapping, .init.guest_late_init = xen_hvm_guest_late_init, .runtime.pin_vcpu = xen_pin_vcpu,