[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] x86/mm: slightly relax TLB-flush-local check again
- To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Fri, 29 Apr 2022 15:20:58 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=7ZzJDH6f8FIiK74a5RGH7pg8PNMuStwl3xMqiFiX1TU=; b=DCJZM5XhBDBTgamUX/1yL/sH2pSg/hs1/Ha3RRrTRX/nbgKv96W3SyJy0hRvE9nhecpe3gIIlRKVmLYJYz4bJQsiLzZ/cNvN5t6yeIjoqdR99YqJEkARIRPm9IW3nis5fcJG+ielv1nTP8RpF0jaocJG2z3SE4S0yO/H9B2oHV41ZEdnBNZn0Z1mmKEVsJCSkwrnrJgPgO2gXu/uTUmUdeab9Z6ReuhRoVyDZrPeBPpZyulojIWKnxa3p01/Oc9Ip4NIB/j/BrX4NHq+qqOk0nx33iROQIw5Y5KkCBJsWAmDVOFvO1uy6aJ2cPs/l34KHhBGgIlByC9LDP397/gR6A==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PX1ffaPNRK1FY2CHsOsxhQnhq9KRAuuqr5Oiy+kS1DNAsRbwcHISqIhtKxBt1zApsmm9ocipgcp/mSEv9z9ph8nkc0SiLNF/gEjPCJuK3G+8UWbBgnizsepEvrHupEgal2S+4+N1b6mTKDpzsrfgix4+7ss9yMrbGSGoji1m3xK3t2k+9E15WmKhm5KTkMCBK/ztg/xalGNODaINcA1vVQuqrmqXW2hRHa0ScHVehYG0yWjjckRG458GCepGC2fj/N0IA2rgV3Y/LnNS9RkbXW9fSr+OlnQO/0QjE/J4Y6wr7RGM3hVWS1n5TA2UC2vKRqEQhZ3uMLf84BF+7NH5NQ==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, David Vrabel <dvrabel@xxxxxxxxxx>
- Delivery-date: Fri, 29 Apr 2022 13:21:23 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
system_state changes to SYS_STATE_smp_boot before alternative_branches()
is invoked, yet that function, with CET-SS enabled, needs to invoke
modify_xen_mappings(). Convert to check for the number of online CPUs,
just like was done also in 88a037e2cfe1 / fa6dc0879ffd ("page_alloc:
assert IRQs are enabled in heap alloc/free", both instance of which
needed reverting for other reasons).
Fixes: 78e072bc3750 ("x86/mm: avoid inadvertently degrading a TLB flush to
local only")
Reported-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
Only build-tested, as I don't have suitable hardware at hand.
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5074,7 +5074,7 @@ l1_pgentry_t *virt_to_xen_l1e(unsigned l
* map_pages_to_xen() can be called early in boot before any other
* CPUs are online. Use flush_area_local() in this case.
*/
-#define flush_area(v,f) (system_state < SYS_STATE_smp_boot ? \
+#define flush_area(v,f) (num_online_cpus() <= 1 ? \
flush_area_local((const void *)v, f) : \
flush_area_all((const void *)v, f))
|