From: Nadav Amit <namit@vmware.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: <kvm@vger.kernel.org>, Nadav Amit <namit@vmware.com>
Subject: [kvm-unit-tests PATCH 1/3] x86: realmode: initialize idtr
Date: Fri, 26 Jun 2020 02:23:31 -0700 [thread overview]
Message-ID: <20200626092333.2830-2-namit@vmware.com> (raw)
In-Reply-To: <20200626092333.2830-1-namit@vmware.com>
The realmode test does not initialize the IDTR, assuming that its base
is zero and its limit 0x3ff. Initialize it, as the BIOS might not set it
as such.
Signed-off-by: Nadav Amit <namit@vmware.com>
---
x86/realmode.c | 2 ++
1 file changed, 2 insertions(+)
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"
--
2.20.1
next prev parent reply other threads:[~2020-06-26 9:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-26 9:23 [kvm-unit-tests PATCH 0/3] x86: realmode: fixes Nadav Amit
2020-06-26 9:23 ` Nadav Amit [this message]
2020-06-26 10:41 ` [kvm-unit-tests PATCH 1/3] x86: realmode: initialize idtr Paolo Bonzini
2020-06-26 9:23 ` [kvm-unit-tests PATCH 2/3] x86: realmode: hlt loop as fallback on exit Nadav Amit
2020-06-26 9:23 ` [kvm-unit-tests PATCH 3/3] x86: realmode: fix lss test Nadav Amit
2020-06-26 10:43 ` [kvm-unit-tests PATCH 0/3] x86: realmode: fixes Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200626092333.2830-2-namit@vmware.com \
--to=namit@vmware.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.