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

[PATCH] x86/boot: Fix edd=off to skip mbr


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Mon, 13 Oct 2025 17:11:39 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org 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=XXe8zTKYF8x6DO9Gyq6hh+L+Uww1AxrCS0EUCz3I5Sg=; b=abUEi8sTyO1uohYrXxgWYX3cUTTtaUQXjMrW8hXf8swpXQAuEuAnJCmUvmx4q/7rwQpTu4P2vd92a/uN9f7JEz/QQAHPqsqc5Y+tkmRegJyCvPRLFhaOmIH0QMAhI0Ai/vF560+9P3DawogDOffFI/RybLzrWI429og7OC9GkdnloYzfs7n0/VyVGvIEqDyqZ8GJcwNUYsoV7y6WWT38MH3wxLKEaMcbnZYcy+JeFUUjHIDpz1tOhTt31hpBcxGSjo+lYmFDALIEJK8dL3s/M3muZ2JBv83jwY/F8o+0IvfkS3wMkY9r8eRvrHpfGXJD0DD9fg+kUeQ80sQmzyZ4Hw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=s+Ll1+vSCg40be+YwDkbLp5QWG919yR0/H4iigNMIO552kz1WW8YkYi6n7iQgSGeV2ln4tnkLxJeB8R+ZRGhjFf4OK8/bous7P8VkHLblLbz+xEn/UHS9VLe8bGSgdyK2u4Mojwf1iH3wae2gJIgvPk+Mm8n8/Fj/Zc0R+I08wNCL/WEUHVP34+s3bQwTDfuHukMbQ3sIBJiuiq7DI10ALFAjj24pXn7migwzYiJgi0lDwgl6cS73CmaTPYCCyJjL8kugN39vzIwe1W6qLRtm62gceyD+4ug4gomhnKHuITY78AQITDp0bo386CTSY+JEEW4ukZc2rb86n6H9hdl0Q==
  • Cc: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, Jason Andryuk <jason.andryuk@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Mon, 13 Oct 2025 21:11:51 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

When the fixes commit re-arranged the code, it made edd=off jump to the
mbr code instead of returning from the function.  Previously edd_done
was immediately before ret and skipped the MBR check.

Replace edd_done with .Ledd_mbr_sig for the start of the MBR checking,
and replace .Ledd_mbr_sig_skip with .Ledd_done to exit from the function.

edd=off jumps to .Ledd_done to return from the function, and internal
jumps go to .Ledd_mbr_sig to check edd=skipmbr.

Fixes: 5ec164fd61bd ("x86/boot: re-arrange how/when we do disk I/O")
Signed-off-by: Jason Andryuk <jason.andryuk@xxxxxxx>
---
 xen/arch/x86/boot/edd.S | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/boot/edd.S b/xen/arch/x86/boot/edd.S
index 3df712bce1..02437511b2 100644
--- a/xen/arch/x86/boot/edd.S
+++ b/xen/arch/x86/boot/edd.S
@@ -25,7 +25,7 @@
 
 get_edd:
         cmpb    $2, bootsym(opt_edd)            # edd=off ?
-        je      edd_done
+        je      .Ledd_done
 
 # Do the BIOS Enhanced Disk Drive calls
 # This consists of two calls:
@@ -48,7 +48,7 @@ edd_check_ext:
         movb    $0x41, %ah                      # 0x41 Check Extensions Present
         movw    $0x55AA, %bx                    # magic
         int     $0x13                           # make the call
-        jc      edd_done                        # no more BIOS devices
+        jc      .Ledd_mbr_sig                   # no more BIOS devices
 
         cmpw    $0xAA55, %bx                    # is magic right?
         jne     edd_next                        # nope, next...
@@ -96,13 +96,13 @@ edd_legacy_done:
 
 edd_next:
         incb    %dl                             # increment to next device
-        jz      edd_done
+        jz      .Ledd_mbr_sig
         cmpb    $EDD_INFO_MAX,bootsym(boot_edd_info_nr)
         jb      edd_check_ext
 
-edd_done:
+.Ledd_mbr_sig:
         cmpb    $1, bootsym(opt_edd)            # edd=skipmbr ?
-        je      .Ledd_mbr_sig_skip
+        je      .Ledd_done
 
 # Read the first sector of each BIOS disk device and store the 4-byte signature
 .Ledd_mbr_sig_start:
@@ -160,7 +160,7 @@ edd_done:
         jb      .Ledd_mbr_sig_read
 .Ledd_mbr_sig_done:
         popw    %es
-.Ledd_mbr_sig_skip:
+.Ledd_done:
         ret
 
 GLOBAL(boot_edd_info_nr)
-- 
2.51.0




 


Rackspace

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