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 6CCF8CAC5B0 for ; Mon, 29 Sep 2025 23:36:34 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1133393.1471518 (Exim 4.92) (envelope-from ) id 1v3NPs-0006iF-Pn; Mon, 29 Sep 2025 23:36:24 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1133393.1471518; Mon, 29 Sep 2025 23:36:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1v3NPs-0006i6-MW; Mon, 29 Sep 2025 23:36:24 +0000 Received: by outflank-mailman (input) for mailman id 1133393; Mon, 29 Sep 2025 23:36:24 +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 1v3NPr-0006dW-Vn for xen-devel@lists.xenproject.org; Mon, 29 Sep 2025 23:36:24 +0000 Received: from CY7PR03CU001.outbound.protection.outlook.com (mail-westcentralusazlp170100005.outbound.protection.outlook.com [2a01:111:f403:c112::5]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 1b2c5f83-9d8d-11f0-9d14-b5c5bf9af7f9; Tue, 30 Sep 2025 01:36:22 +0200 (CEST) Received: from PH7P221CA0026.NAMP221.PROD.OUTLOOK.COM (2603:10b6:510:32a::21) by IA1PR12MB7663.namprd12.prod.outlook.com (2603:10b6:208:424::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9160.17; Mon, 29 Sep 2025 23:36:15 +0000 Received: from SN1PEPF000397B2.namprd05.prod.outlook.com (2603:10b6:510:32a:cafe::a8) by PH7P221CA0026.outlook.office365.com (2603:10b6:510:32a::21) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9137.20 via Frontend Transport; Mon, 29 Sep 2025 23:36:15 +0000 Received: from satlexmb08.amd.com (165.204.84.17) by SN1PEPF000397B2.mail.protection.outlook.com (10.167.248.56) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9160.9 via Frontend Transport; Mon, 29 Sep 2025 23:36:14 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.2562.17; Mon, 29 Sep 2025 16:36:12 -0700 Received: from satlexmb07.amd.com (10.181.42.216) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 29 Sep 2025 18:36:12 -0500 Received: from [172.18.5.186] (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.17 via Frontend Transport; Mon, 29 Sep 2025 16:36:11 -0700 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: 1b2c5f83-9d8d-11f0-9d14-b5c5bf9af7f9 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CHoxdNpi2lHkCSUPPhQHKBfEZgSz2rdnUsk8xZlequs+C9rTJ8yf9Xas6yRWToHZ9qyn+4+ptyyWmzWciwkpp90vo7Hq0DIpusf5QZ/UH8MDGYd8vT5pJNI9CKH9ZoPdZv+rFYUeQysc+yxf3eBOBgpUliNS6rrOj82sgVVa/45vOxhrtxPRpakvkbItVwpBjS9HklQwP31cCgKrxZnbIZbZAn6/E+2AbOp7KY3Jm+KMYpYip42Ob1nJY+fGX0M660XiI7cnqbQfGeU0hNNTQI2pfkU8OsfRmgylfBZbIrynMoFciKfATSkwSSQp3dgiE4vuyBbF82fOeFKslWep8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=zrvGxInsz7lDVevik18YGd1tnHZPsAU+GrVZlq+lKU0=; b=uJoMkU/MVNXXTXoG4g76uixS1gLF/lT4NElndemAUAgLPUGpGsrJM+vQzwL/i2gsqVxIwQ4uvQVmUAGAB5srSf+ZM7VmYEGQbo6/HUFwuXUd51LAX3Qch0OBXWMww9SXmPHiYaqhrNjrQ6MPkvMNF39apWdzF8dzdasx3yTBUmcssGTmTxeex71q9aTpAgTS44VfDqCPCafqZ8t43Fn1S18JL/rGvllFwbjSx8BWB7pSwelzfEKZsvAhX65pYmKrh9woXTtMzpnCGgidbh1vT89H8zBUmHgA/PTiJf3x0ysRt4UGnFbzd4QiiWE9u+APZ3y+sydR1J+bRHFt0zR+Jg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zrvGxInsz7lDVevik18YGd1tnHZPsAU+GrVZlq+lKU0=; b=yVwPXvEQvvYivEi/R5GTK8ebKebcHhX5/ZqXOmMrwFoiFS0Ji2UECwjrhv1tQtb6p8OJjlGAIdVk+UlTyB0+WrUq/LcZ3KzP7RrYKnlFjNz7w5E1USHyEeDgPvYKbYh4/W9dee7fM5OsKpdMZFPuXa0yZMA5fgLzUg40KvwTHuk= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb08.amd.com; pr=C Message-ID: <1439ec29-4319-43d0-b4ff-0eb5bfe9405b@amd.com> Date: Mon, 29 Sep 2025 19:36:10 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] x86: guard synthetic feature and bug enumerators To: Jan Beulich , "xen-devel@lists.xenproject.org" CC: Andrew Cooper , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= References: <8ecbf8b7-91fe-4f9e-9542-7ec22b6a47bb@suse.com> <48dcc0e0-2772-49b9-9383-5bf69f922053@suse.com> Content-Language: en-US From: Jason Andryuk In-Reply-To: <48dcc0e0-2772-49b9-9383-5bf69f922053@suse.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000397B2:EE_|IA1PR12MB7663:EE_ X-MS-Office365-Filtering-Correlation-Id: 251839ad-2d34-483e-3e04-08ddffb0fb0e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|1800799024|36860700013|7053199007; X-Microsoft-Antispam-Message-Info: =?utf-8?B?bUV1Y0pleUNiZU9McGwwT1hKUncrZHZRT3VRTGE0eV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UViaUV4VkQ2b2wyb1hnR2g3SFNzTnk0VDRjbmd1eEdM?= =?utf-8?B?SiswaXFSOGJvMVh0QTVBckwvYjdkbFEwaGFXcldDUm9XRnhFdVV2aFQ4YUdZ?= =?utf-8?B?c1VYVG8rVlZGOFRQTjRwTnAyeGhwZzM2RTIvbTZIZHhsczFwMTVBQ3E4OVFQ?= =?utf-8?B?Nmd6Njc4aWFDaW5nbGlRMGlvbElSMStYbWpZN0xoWHBENFBURTFQNnFZc2sy?= =?utf-8?B?RU84NGN3bndJV3RMcXhyZ3lucGpURVQ3RHpxK2JFMFowSjJ3Z2ZwV0gzUXlY?= =?utf-8?Q?O7HE=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(1800799024)(36860700013)(7053199007);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2025 23:36:14.7125 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 251839ad-2d34-483e-3e04-08ddffb0fb0e X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb08.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF000397B2.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7663 On 2025-09-25 06:48, Jan Beulich wrote: > While adding new enumerators one may overlook the (rare) need to bump > X86_NR_{SYNTH,BUG}. Guard against that happening by adding respective > checking. The use of BUILD_BUG_ON_ZERO(), however, entails a number of > other changes, as the expansion may not appear in the assembly produced. > Furthermore inputs to file-scope asm() are only supported in gcc15 (or > newer). > > No difference in generated code (debug info, however, grows quite a bit). > > An implication from the changes is that users of the alternatives patching > macros may not use unnamed asm() input operands anymore, as the "injected" > new operands would break numbering expectations. > > Signed-off-by: Jan Beulich > > --- a/xen/arch/x86/include/asm/alternative.h > +++ b/xen/arch/x86/include/asm/alternative.h > @@ -70,12 +70,12 @@ extern void alternative_instructions(voi > alt_repl_len(n2)) "-" alt_orig_len) > > #define ALTINSTR_ENTRY(feature, num) \ > - " .if (" STR(feature & ~ALT_FLAG_NOT) ") >= " STR(NCAPINTS * 32) "\n" \ > + " .if (%c" #feature " & " STR(~ALT_FLAG_NOT) ") >= " STR(NCAPINTS * 32) "\n" \ > " .error \"alternative feature outside of featureset range\"\n" \ > " .endif\n" \ > " .long .LXEN%=_orig_s - .\n" /* label */ \ > " .long " alt_repl_s(num)" - .\n" /* new instruction */ \ > - " .word " STR(feature) "\n" /* feature bit */ \ > + " .word %c" #feature "\n" /* feature bit */ \ > " .byte " alt_orig_len "\n" /* source len */ \ > " .byte " alt_repl_len(num) "\n" /* replacement len */ \ > " .byte " alt_pad_len "\n" /* padding len */ \ > @@ -127,14 +127,14 @@ extern void alternative_instructions(voi > */ > #define alternative(oldinstr, newinstr, feature) \ > asm_inline volatile ( \ > - ALTERNATIVE(oldinstr, newinstr, feature) \ > - ::: "memory" ) > + ALTERNATIVE(oldinstr, newinstr, [feat]) \ > + :: [feat] "i" (feature) : "memory" ) > > #define alternative_2(oldinstr, newinstr1, feature1, newinstr2, feature2) \ > asm_inline volatile ( \ > - ALTERNATIVE_2(oldinstr, newinstr1, feature1, \ > - newinstr2, feature2) \ > - ::: "memory" ) > + ALTERNATIVE_2(oldinstr, newinstr1, [feat1], \ > + newinstr2, [feat2]) \ > + :: [feat1] "i" (feature1), [feat2] "i" (feature2) : "memory" ) > > /* > * Alternative inline assembly with input. > @@ -148,14 +148,14 @@ extern void alternative_instructions(voi > */ > #define alternative_input(oldinstr, newinstr, feature, input...) \ > asm_inline volatile ( \ > - ALTERNATIVE(oldinstr, newinstr, feature) \ > - :: input ) > + ALTERNATIVE(oldinstr, newinstr, [feat]) \ > + :: [feat] "i" (feature), ## input ) > > /* Like alternative_input, but with a single output argument */ > #define alternative_io(oldinstr, newinstr, feature, output, input...) \ > asm_inline volatile ( \ > - ALTERNATIVE(oldinstr, newinstr, feature) \ > - : output : input ) > + ALTERNATIVE(oldinstr, newinstr, [feat]) \ > + : output : [feat] "i" (feature), ## input ) > > /* > * This is similar to alternative_io. But it has two features and > @@ -168,9 +168,9 @@ extern void alternative_instructions(voi > #define alternative_io_2(oldinstr, newinstr1, feature1, newinstr2, \ > feature2, output, input...) \ > asm_inline volatile ( \ > - ALTERNATIVE_2(oldinstr, newinstr1, feature1, \ > - newinstr2, feature2) \ > - : output : input ) > + ALTERNATIVE_2(oldinstr, newinstr1, [feat1], \ > + newinstr2, [feat2]) \ > + : output : [feat1] "i" (feature1), [feat2] "i" (feature2), ## input ) > > /* Use this macro(s) if you need more than one output parameter. */ > #define ASM_OUTPUT2(a...) a > --- a/xen/arch/x86/include/asm/cpufeatures.h > +++ b/xen/arch/x86/include/asm/cpufeatures.h > @@ -6,9 +6,16 @@ > /* Number of capability words covered by the featureset words. */ > #define FSCAPINTS FEATURESET_NR_ENTRIES > > +#if !defined(__ASSEMBLY__) && __GNUC__ >= 15 > +#include > +#define X86_CHECK_FEAT_NR(x, n) BUILD_BUG_ON_ZERO((x) / 32 >= X86_NR_ ## n) > +#else > +#define X86_CHECK_FEAT_NR(x, n) 0 > +#endif > + > /* Synthetic words follow the featureset words. */ > #define X86_NR_SYNTH 2 > -#define X86_SYNTH(x) (FSCAPINTS * 32 + (x)) > +#define X86_SYNTH(x) (FSCAPINTS * 32 + (x) + X86_CHECK_FEAT_NR(x, SYNTH)) > > /* Synthetic features */ > XEN_CPUFEATURE(CONSTANT_TSC, X86_SYNTH( 0)) /* TSC ticks at a constant rate */ > @@ -47,7 +54,8 @@ XEN_CPUFEATURE(XEN_REP_MOVSB, X86_SY > > /* Bug words follow the synthetic words. */ > #define X86_NR_BUG 1 > -#define X86_BUG(x) ((FSCAPINTS + X86_NR_SYNTH) * 32 + (x)) > +#define X86_BUG(x) ((FSCAPINTS + X86_NR_SYNTH) * 32 + (x) + \ > + X86_CHECK_FEAT_NR(x, BUG)) > > #define X86_BUG_FPU_PTRS X86_BUG( 0) /* (F)X{SAVE,RSTOR} doesn't save/restore FOP/FIP/FDP. */ > #define X86_BUG_NULL_SEG X86_BUG( 1) /* NULL-ing a selector preserves the base and limit. */ > --- a/xen/arch/x86/include/asm/cpufeatureset.h > +++ b/xen/arch/x86/include/asm/cpufeatureset.h > @@ -12,8 +12,13 @@ enum { > }; > #undef XEN_CPUFEATURE > > +#if __GNUC__ >= 15 > +#define XEN_CPUFEATURE(name, value) asm (".equ X86_FEATURE_" #name ", %c0" \ > + :: "i" (X86_FEATURE_##name)); > +#else > #define XEN_CPUFEATURE(name, value) asm (".equ X86_FEATURE_" #name ", " \ > __stringify(value)); > +#endif > #include > #include > > --- a/xen/arch/x86/include/asm/pdx.h > +++ b/xen/arch/x86/include/asm/pdx.h > @@ -13,9 +13,9 @@ > asm_inline goto ( \ > ALTERNATIVE( \ > "", \ > - "jmp %l0", \ > - ALT_NOT(X86_FEATURE_PDX_COMPRESSION)) \ > - : : : : label ) > + "jmp %l1", \ > + [feat]) \ > + : : [feat] "i" (ALT_NOT(X86_FEATURE_PDX_COMPRESSION)) : : label ) > > static inline unsigned long pfn_to_pdx(unsigned long pfn) > { > --- a/xen/arch/x86/include/asm/spec_ctrl.h > +++ b/xen/arch/x86/include/asm/spec_ctrl.h > @@ -73,7 +73,7 @@ static always_inline void spec_ctrl_new_ > > /* (ab)use alternative_input() to specify clobbers. */ > alternative_input("", "DO_OVERWRITE_RSB xu=%=", X86_BUG_IBPB_NO_RET, > - : "rax", "rcx"); > + "i" (0) : "rax", "rcx"); "i" (0) is to work around the trailing comma in alternative_input() and does nothing? Thanks, Jason > } > > extern int8_t opt_ibpb_ctxt_switch; > @@ -163,7 +163,7 @@ static always_inline void __spec_ctrl_en > * (ab)use alternative_input() to specify clobbers. > */ > alternative_input("", "DO_OVERWRITE_RSB xu=%=", X86_FEATURE_SC_RSB_IDLE, > - : "rax", "rcx"); > + "i" (0) : "rax", "rcx"); > } > > /* WARNING! `ret`, `call *`, `jmp *` not safe after this call. */ > --- a/xen/arch/x86/include/asm/tsc.h > +++ b/xen/arch/x86/include/asm/tsc.h > @@ -29,8 +29,7 @@ static inline uint64_t rdtsc_ordered(voi > alternative_io_2("lfence; rdtsc", > "mfence; rdtsc", X86_FEATURE_MFENCE_RDTSC, > "rdtscp", X86_FEATURE_RDTSCP, > - ASM_OUTPUT2("=a" (low), "=d" (high), "=c" (aux)), > - /* no inputs */); > + ASM_OUTPUT2("=a" (low), "=d" (high), "=c" (aux))); > > return (high << 32) | low; > } > >