aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/boot
diff options
context:
space:
mode:
authorJan Beulich <JBeulich@suse.com>2012-05-31 10:18:13 +0200
committerJan Beulich <JBeulich@suse.com>2012-05-31 10:18:13 +0200
commit9f78a9e4d9a64d75ef74b2ebbde7b79ba4045381 (patch)
tree58e1f51777587b24f8b28a2c074737edb01b786e /xen/arch/x86/boot
parentef4abe73e1a406fa1a9733324d1d5224241db38b (diff)
downloadxen-9f78a9e4d9a64d75ef74b2ebbde7b79ba4045381.tar.gz
xen-9f78a9e4d9a64d75ef74b2ebbde7b79ba4045381.tar.bz2
xen-9f78a9e4d9a64d75ef74b2ebbde7b79ba4045381.zip
x86/EDD: check MBR for BIOS magic before considering signature valid
Signed-off-by: Jan Beulich <JBeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/boot')
-rw-r--r--xen/arch/x86/boot/edd.S6
1 files changed, 5 insertions, 1 deletions
diff --git a/xen/arch/x86/boot/edd.S b/xen/arch/x86/boot/edd.S
index 59874ce4c6..2c8df8ccc8 100644
--- a/xen/arch/x86/boot/edd.S
+++ b/xen/arch/x86/boot/edd.S
@@ -53,12 +53,16 @@ edd_mbr_sig_read:
jc edd_mbr_sig_done # on failure, we're done.
cmpb $0, %ah # some BIOSes do not set CF
jne edd_mbr_sig_done # on failure, we're done.
+ cmpw $0xaa55, bootsym(boot_edd_info)+0x1fe
+ jne .Ledd_mbr_sig_next
movl bootsym(boot_edd_info)+EDD_MBR_SIG_OFFSET,%eax
movb %dl, (%bx) # store BIOS drive number
movl %eax, 4(%bx) # store signature from MBR
incb bootsym(boot_mbr_signature_nr) # note that we stored something
- incb %dl # increment to next device
addw $8, %bx # increment sig buffer ptr
+.Ledd_mbr_sig_next:
+ incb %dl # increment to next device
+ jz edd_mbr_sig_done
cmpb $EDD_MBR_SIG_MAX,bootsym(boot_mbr_signature_nr)
jb edd_mbr_sig_read
edd_mbr_sig_done: