From nobody Sun Feb 8 18:44:18 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1767795126; cv=none; d=zohomail.com; s=zohoarc; b=l8p1xzhEfEs8C8L0PjotYFWVwspypl1LjIVF+nLuQRYR+BHFsT9hY5sP1eSwIc3WqrZ9qjEA4imZ/vp7L/+T3yqBTjNJd8TqxAiAt/vlirGDTgCOKan/uc5T8tIY2MWT/Y1TWdOB2Pr5kR9KsYKqQZwvrAtJ7VLx++8RNDjaO0Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767795126; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ypGd9Yz2mBlv45UcH36jOo23VuYex6K+KrlBsHB222c=; b=VM4kGCyyFKKCiUsNQTrx4siM00tx3Oj0y00DtI/wOmC68vaJ5uUJbvB34PlmONmen77j4ugpizCMzuASPz8bXanaUo/GWCPOLUbW3RPK9gDO8LmaI5v5LRo0OlsmL3I2GeNU9EIDrjHcy2ciA0PsIwdZ7KDb7XfTJFKRODGwJXQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1767795126404178.2572053642183; Wed, 7 Jan 2026 06:12:06 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1196722.1514459 (Exim 4.92) (envelope-from ) id 1vdUGE-0003Dl-KZ; Wed, 07 Jan 2026 14:11:42 +0000 Received: by outflank-mailman (output) from mailman id 1196722.1514459; Wed, 07 Jan 2026 14:11:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vdUGE-0003De-Hu; Wed, 07 Jan 2026 14:11:42 +0000 Received: by outflank-mailman (input) for mailman id 1196722; Wed, 07 Jan 2026 14:11:41 +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 1vdUGD-0003DW-K0 for xen-devel@lists.xenproject.org; Wed, 07 Jan 2026 14:11:41 +0000 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [2a00:1450:4864:20::334]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id c8ff43fb-ebd2-11f0-b15e-2bf370ae4941; Wed, 07 Jan 2026 15:11:39 +0100 (CET) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4775e891b5eso10048255e9.2 for ; Wed, 07 Jan 2026 06:11:39 -0800 (PST) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47d87167832sm13687545e9.7.2026.01.07.06.11.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 07 Jan 2026 06:11:38 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: c8ff43fb-ebd2-11f0-b15e-2bf370ae4941 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1767795099; x=1768399899; darn=lists.xenproject.org; h=content-transfer-encoding:autocrypt:subject:from:cc:to :content-language:user-agent:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=ypGd9Yz2mBlv45UcH36jOo23VuYex6K+KrlBsHB222c=; b=F51dyi726ifoqslEwwB3bVlduwKk+kh8pNZGOM3Jz9kbKXPU0XFGaJLkKVhuOvvF43 EvGrOI1eJ/zwZ7cmlPqeRTnYa8L2z9E/h41wIIi6V3PgoxxC2wU+Z9n7AFPVDd4WG2+D gVgJYRSbTr6H6j44JefgwEs1UJfMNrMCxoGQj847t0NzU4OFKBB1k2rLs/cwggF0p7zo eTvWe3l5V5Mb5a0pFV7vfZ0/zkh0GNJCd0rYoVgjOULCB3vG6H2srPqi/M0j3huBls95 zVSZjTSCPEO7tZBm3PIDoAyW2wh7Jcz8unvlHq9dISL+u0o0ryEUAW6g/8VNuHxLBu3B xb+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767795099; x=1768399899; h=content-transfer-encoding:autocrypt:subject:from:cc:to :content-language:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ypGd9Yz2mBlv45UcH36jOo23VuYex6K+KrlBsHB222c=; b=XZ0KSxGFdAdqwHlGKLOl4HvXkxDR2xxSw5/pO0vqwjbGc0bNYgxkdYaBKWEMI3G39a 9IfuIvl/pGk0rCN+H1CV7qsXwnpEKIaHNp3wc7k/PDzcTDns4oNqzuatnJbf3iazRz6a 66rxRT9X6WO4n5wwTrh6yygeYqAgZ0RBL9y9UQbc9n2UhsgsZd0iIwz7yGKlwpTMUIec F9g7k3+00aItUSl22qR03dAQ2CPWoxD0/trV4mUxkIpEhVb1xQjTPWIRYONXmI7PkGfz qf4aMD/hSCGRkUX3VdGujAoKs/lvsUKP59N1G8BsfRsDDIjJmlHxHSBnrjkiisQcBtJM dw+A== X-Gm-Message-State: AOJu0YwkgwkcopZZcIn+eiB1DkBVpVlD3tf8WfEe83YSB/fPohv31cFo utHEuAoSa5sQkMNoLqE33e7PTUmZAT+rF4vn0jR/YRHSY/Pjgzi7L/ibP197ZH8GBXsHHLSz81p dqJQ= X-Gm-Gg: AY/fxX4u6tVN/UOOy+Nw6SpY71iGrpwZlzP7ZOr+PfY3kTZBNLWiptbWZkQdcBCTJv6 SBQvOLGR0IeTjPtHPi68/Ws0jjShvnyXzEDkSPUWfP6D2pdKJlCqycFGKPSQnhbfC5ZdVftsUzE BnbHwR1BbKiWr4atQ1m0RijEFQkSlbjdRZ396fl5Jm8yOdJbvG8PQU5LXpb0ejOpeTW3FD/7Ue4 mCHZZyIsL9YRCngA2pJM1ceXXOeGZ3HmG8WYTMc71osww/Y3DkbiLgqLevuaiPJo0I9rkiv+fFT QgrzcYMcap335KvxdhJfMaw6x6wSmx8B3RrhMsdwHSKeoRbREtQGqLYcEYoktxIuETkH3Qjwbz6 l/5iSVsyxIGjSU6msIaG0s+sL5EJKnaehBmeGA3XuNZfLJS2KhFUWOhqy857KSmL+hhncas6u7t g1RANwPbPNNjRhintRpPE7zJuvRpnJnApbOTDWuM6S9t4AF5/mFU0FZk9Ow+IUvy15E3ZL5ygNu Xws6kej66oyng== X-Google-Smtp-Source: AGHT+IEdZqCNBgtszHwJM8ODdWo62CUx8G8aX8owGhlsnlqWQawi+6BqAnTgaJDVETr1utJqg2Wr3A== X-Received: by 2002:a05:600c:1392:b0:477:6d96:b3c8 with SMTP id 5b1f17b1804b1-47d84b34673mr32171905e9.23.1767795099069; Wed, 07 Jan 2026 06:11:39 -0800 (PST) Message-ID: <239a5d80-c0af-410b-a053-5fa84273aecd@suse.com> Date: Wed, 7 Jan 2026 15:11:37 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , Jason Andryuk From: Jan Beulich Subject: [PATCH v2] x86: guard synthetic feature and bug enumerators Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1767795129564158500 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Jason Andryuk --- v2: Fix shim build. Use named label operand in pdx.h. --- 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) =20 #define ALTINSTR_ENTRY(feature, num) \ - " .if (" STR(feature & ~ALT_FLAG_NOT) ") >=3D " STR(NCAPINTS * 32)= "\n" \ + " .if (%c" #feature " & " STR(~ALT_FLAG_NOT) ") >=3D " STR(NCAPINT= S * 32) "\n" \ " .error \"alternative feature outside of featureset range\"\n" \ " .endif\n" \ " .long .LXEN%=3D_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" ) =20 #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" ) =20 /* * 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 ) =20 /* 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 ) =20 /* * 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), ## inpu= t ) =20 /* 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 =20 +#if !defined(__ASSEMBLER__) && __GNUC__ >=3D 15 +#include +#define X86_CHECK_FEAT_NR(x, n) BUILD_BUG_ON_ZERO((x) / 32 >=3D 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)) =20 /* Synthetic features */ XEN_CPUFEATURE(CONSTANT_TSC, X86_SYNTH( 0)) /* TSC ticks at a constan= t rate */ @@ -47,7 +54,8 @@ XEN_CPUFEATURE(XEN_REP_MOVSB, X86_SY =20 /* 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)) =20 #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 prese= rves 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 =20 +#if __GNUC__ >=3D 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 =20 --- a/xen/arch/x86/include/asm/guest/xen-hcall.h +++ b/xen/arch/x86/include/asm/guest/xen-hcall.h @@ -31,11 +31,13 @@ long res, tmp__; \ asm volatile ( \ ALTERNATIVE_2("call early_hypercall", \ - "vmmcall", ALT_NOT(X86_FEATURE_USE_VMCALL), \ - "vmcall", X86_FEATURE_USE_VMCALL) \ + "vmmcall", [vmmcall], \ + "vmcall", [vmcall]) \ : "=3Da" (res), "=3DD" (tmp__) ASM_CALL_CONSTRAINT = \ : "0" (hcall), \ - "1" ((long)(a1)) \ + "1" ((long)(a1)), \ + [vmmcall] "i" (ALT_NOT(X86_FEATURE_USE_VMCALL)), \ + [vmcall] "i" (X86_FEATURE_USE_VMCALL) \ : "memory" ); \ (type)res; \ }) @@ -45,12 +47,14 @@ long res, tmp__; \ asm volatile ( \ ALTERNATIVE_2("call early_hypercall", \ - "vmmcall", ALT_NOT(X86_FEATURE_USE_VMCALL), \ - "vmcall", X86_FEATURE_USE_VMCALL) \ + "vmmcall", [vmmcall], \ + "vmcall", [vmcall]) \ : "=3Da" (res), "=3DD" (tmp__), "=3DS" (tmp__) = \ ASM_CALL_CONSTRAINT \ : "0" (hcall), \ - "1" ((long)(a1)), "2" ((long)(a2)) \ + "1" ((long)(a1)), "2" ((long)(a2)), \ + [vmmcall] "i" (ALT_NOT(X86_FEATURE_USE_VMCALL)), \ + [vmcall] "i" (X86_FEATURE_USE_VMCALL) \ : "memory" ); \ (type)res; \ }) @@ -60,12 +64,14 @@ long res, tmp__; \ asm volatile ( \ ALTERNATIVE_2("call early_hypercall", \ - "vmmcall", ALT_NOT(X86_FEATURE_USE_VMCALL), \ - "vmcall", X86_FEATURE_USE_VMCALL) \ + "vmmcall", [vmmcall], \ + "vmcall", [vmcall]) \ : "=3Da" (res), "=3DD" (tmp__), "=3DS" (tmp__), "=3Dd" (tmp__)= \ ASM_CALL_CONSTRAINT \ : "0" (hcall), \ - "1" ((long)(a1)), "2" ((long)(a2)), "3" ((long)(a3)) \ + "1" ((long)(a1)), "2" ((long)(a2)), "3" ((long)(a3)), \ + [vmmcall] "i" (ALT_NOT(X86_FEATURE_USE_VMCALL)), \ + [vmcall] "i" (X86_FEATURE_USE_VMCALL) \ : "memory" ); \ (type)res; \ }) @@ -76,13 +82,15 @@ register long _a4 asm ("r10") =3D ((long)(a4)); \ asm volatile ( \ ALTERNATIVE_2("call early_hypercall", \ - "vmmcall", ALT_NOT(X86_FEATURE_USE_VMCALL), \ - "vmcall", X86_FEATURE_USE_VMCALL) \ + "vmmcall", [vmmcall], \ + "vmcall", [vmcall]) \ : "=3Da" (res), "=3DD" (tmp__), "=3DS" (tmp__), "=3Dd" (tmp__)= , \ "=3D&r" (tmp__) ASM_CALL_CONSTRAINT \ : "0" (hcall), \ "1" ((long)(a1)), "2" ((long)(a2)), "3" ((long)(a3)), \ - "4" (_a4) \ + "4" (_a4), \ + [vmmcall] "i" (ALT_NOT(X86_FEATURE_USE_VMCALL)), \ + [vmcall] "i" (X86_FEATURE_USE_VMCALL) \ : "memory" ); \ (type)res; \ }) --- 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 %l[" #label "]", \ + [feat]) \ + : : [feat] "i" (ALT_NOT(X86_FEATURE_PDX_COMPRESSION)) : : label ) =20 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_ =20 /* (ab)use alternative_input() to specify clobbers. */ alternative_input("", "DO_OVERWRITE_RSB xu=3D%=3D", X86_BUG_IBPB_NO_RE= T, - : "rax", "rcx"); + "i" (0) : "rax", "rcx"); } =20 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=3D%=3D", X86_FEATURE_SC_RSB= _IDLE, - : "rax", "rcx"); + "i" (0) : "rax", "rcx"); } =20 /* 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("=3Da" (low), "=3Dd" (high), "=3Dc" (aux)= ), - /* no inputs */); + ASM_OUTPUT2("=3Da" (low), "=3Dd" (high), "=3Dc" (aux)= )); =20 return (high << 32) | low; }