diff options
author | Nadav Amit <namit@vmware.com> | 2020-06-26 02:23:31 -0700 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-06-26 06:41:51 -0400 |
commit | a529af7c46ad7705663b281b07c6e80a290b0e55 (patch) | |
tree | af99a46a1ca8c66e483bb02680f16a850db578c3 | |
parent | 6b9334e77ab0ad367ab0e8995d5d8d329ea125a3 (diff) | |
download | kvm-unit-tests-a529af7c46ad7705663b281b07c6e80a290b0e55.tar.gz |
x86: realmode: initialize idtr
The realmode test does not initialize the IDTR, assuming that its base
is zero and its limit 0x3ff. Initialize it, as the bootloader might not
set it as such.
Signed-off-by: Nadav Amit <namit@vmware.com>
Message-Id: <20200626092333.2830-2-namit@vmware.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | x86/realmode.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/x86/realmode.c b/x86/realmode.c index 234d607..ef79f7e 100644 --- a/x86/realmode.c +++ b/x86/realmode.c @@ -1799,6 +1799,7 @@ void realmode_start(void) unsigned long long r_gdt[] = { 0, 0x9b000000ffff, 0x93000000ffff }; struct table_descr r_gdt_descr = { sizeof(r_gdt) - 1, &r_gdt }; +struct table_descr r_idt_descr = { 0x3ff, 0 }; asm( ".section .init \n\t" @@ -1819,6 +1820,7 @@ asm( ".text \n\t" "start: \n\t" "lgdt r_gdt_descr \n\t" + "lidt r_idt_descr \n\t" "ljmp $8, $1f; 1: \n\t" ".code16gcc \n\t" "mov $16, %eax \n\t" |