[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/2] x86: guard synthetic feature and bug enumerators


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Tue, 7 Oct 2025 15:38:32 -0400
  • 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)
  • 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=pjGkiM4NQhhkGV0pfxkfc085tHkjLE2xfA+8syp0u7E=; b=ZaC/MmOz0JCkBcML2BrGGYsa0LKCI4znM7V55vOOB0Q+weI66iXf8dfBrNrmSwxn1bsgiZoGe9Z3l+Qy+UmGaR3WXEdMLWd8ZOawzlFxHGFzeyGDuUErTKHKJOvAfTQOaMKiuUBKMMoqzWjRHCaaaKipz1d/2f4mRIBXk/kAxG3pnEzE5CzdB//K8A+q0j5WlJ5Iw4ccbiIg6uH4Ety54yLYFGLEDgyEUwSObzGdm286qbmlKqNCsoApEYgMLR/SAUeAoQEzD2aBPvlFUBLgRyHxzdVE71gvQ9m7dB0xbOJXTV35tY4uHLxZNkZj+tP2pRv80HAlIFyr3mN8XhAtPw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=V/8Gq1h9dAecgf7HbCVwhRWGUtE6cwSxRFhruk7Qb+FbHYtnlcnivg3ao7uHSwvLeIyc+vOR/2SsGX9i2Ewm3Hk4HE9110YAb6oW/guHgSfcxJiAaJxHx9sAx+1Kgq2yos1UlYjDW8///Tefo3VP5XOu8m3xRC0SaMtwZahD2gPZ/Pnhj1IHa8kyPo25P/PaIfO6fmzOn4plNkw0QNh4lKM00hBUA62ZkT4XbxIWH0fVmrpJJhorcNNUOOu1YS/Mgo1nPx5qfOeyy4JYSI0O59i1UyzeLHmm84KkqXjHz3qTzpnzfCOj4xUw7ygGiKLFHAdOSrwGf5lKdF1/u3ZcbQ==
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 07 Oct 2025 19:39:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2025-10-07 08:22, Jan Beulich wrote:
On 30.09.2025 01:36, Jason Andryuk wrote:
On 2025-09-25 06:48, Jan Beulich wrote:
--- 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?

Yes. If more such "uses" appeared, we may want to introduce some kind of
abstraction.

Thanks for confirming.

Reviewed-by: Jason Andryuk <jason.andryuk@xxxxxxx>

Though I also wondered if just #define X86_BUG_MAX/X86_SYNTH_MAX combined with a BUILD_BUG_ON might be good enough. Your approach avoids the extra define but is more complicated. Anyway, just a thought.

Regards,
Jason



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.