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

Re: [PATCH v10] x86: use / "support" UDB


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Wed, 8 Apr 2026 19:04:46 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • 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=11fOth0B8XPCVasLcgdCnme1hOOqNAG0D/6bxLNNwzg=; b=JcvxDTQeTC1B2bfl07/SpQoHhrqiPjEkgQUNV7rpALy25LzcLl2gADg5M7ERSl6YU/08QYrc3MOUKu88BIQyNc3dUk9r1Yp3+lTfXsfI7JyvNR8Gxv0faOw623VhOgkwuv0crTgYwO0AxcI/0xFVjwY54XVPGKb9T1C6lpkyETt5Oly7dRTsSw/E+8efdtIIExCaQrurub3JAFHtKlqc+Ic5Q9CCrgsy5rO8yHscNnxx8xUteEeC9+QIL6jYqeJxABvBY9VVcWfRcVut/8VgkpYO01f3rL+Que8e7GdKpD5ZeQgDtPj+aQ+UsQqubUOQZk0VjwNbddn6GsW1fNey9w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GuMxXx/+CDY7dlUT9dMpiUKgqpxOhWzMk2k9/SWTJjTA0VqAX6qjsV0zyKNpJSoFw4icS1aUJYoCFt6XK+rUjGhhP40cCEtzuPYK8Vn/rhA/NULO37gUCyDe2tH1RD7sjrgm16K9hjR7lNXqFUT9PMDUknoKVyzoAj++Lzj2YtpT/3WfheIBibOZoEQwXSYERA48HdvY4cpMOvUvsGh/Z8+KVwgifhD4mzz4ohraRUxnT+VA2Y3tTbwK2X9HIJO8ofQd6zAnDnmjsJqkTgQo5pZihjhAvKZrhXD/6slkrT0WymE13iyn7XHMgAxxs3WpzkiUWEMua+tx/H9TVgGZCw==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>
  • Delivery-date: Wed, 08 Apr 2026 18:05:01 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 08/04/2026 1:12 pm, Jan Beulich wrote:
> With opcode D6h now firmly reserved as another #UD-raising one in 64-bit
> mode, use that instead of the two-byte UD2 for bug frame marking.
>
> While there also make a minor adjustment to the emulator.
>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

For the patch itself, Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

> ---
> One of the table entries in stub_selftest() uses UD1, yet in not quite
> an appropriate way: The 0x90 following it (presumably meant to be a NOP)
> really is a ModR/M byte, requiring a displacement to follow. Wouldn't we
> better adjust that (e.g. using 0xcc instead)?

That looks too much like breakpoint padding as opposed to nop padding.

What about:

diff --git a/xen/arch/x86/extable.c b/xen/arch/x86/extable.c
index a9b6c6b904f5..24440ccd03e3 100644
--- a/xen/arch/x86/extable.c
+++ b/xen/arch/x86/extable.c
@@ -157,7 +157,7 @@ int __init cf_check stub_selftest(void)
         union stub_exception_token res;
     } tests[] __initconst = {
 #define endbr64 0xf3, 0x0f, 0x1e, 0xfa
-        { .opc = { endbr64, 0x0f, 0xb9, 0x90 }, /* ud1 */
+        { .opc = { endbr64, 0x0f, 0xb9, 0x00 }, /* ud1 (%rax),%eax */
           .res.fields.trapnr = X86_EXC_UD },
         { .opc = { endbr64, 0x90, 0x02, 0x00 }, /* nop; add (%rax),%al */
           .rax = 0x0123456789abcdef,

which also brings it in line with the adjacent example?

~Andrew



 


Rackspace

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