From: Paolo Bonzini <pbonzini@redhat.com>
To: Nadav Amit <namit@vmware.com>
Cc: kvm@vger.kernel.org
Subject: Re: [kvm-unit-tests PATCH 1/3] x86: realmode: initialize idtr
Date: Fri, 26 Jun 2020 12:41:14 +0200 [thread overview]
Message-ID: <305a746a-95d4-e5b9-9aa6-812f7acb554d@redhat.com> (raw)
In-Reply-To: <20200626092333.2830-2-namit@vmware.com>
On 26/06/20 11:23, Nadav Amit wrote:
> 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.
Rather the bootloader: realmode.flat is started as multiboot, that is in
a 32-bit protected mode environment---which includes an IDT.
Paolo
> 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"
>
next prev parent reply other threads:[~2020-06-26 10:41 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 ` [kvm-unit-tests PATCH 1/3] x86: realmode: initialize idtr Nadav Amit
2020-06-26 10:41 ` Paolo Bonzini [this message]
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=305a746a-95d4-e5b9-9aa6-812f7acb554d@redhat.com \
--to=pbonzini@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=namit@vmware.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox