Re: [PATCH kvm-unit-tests] x86: move IDT away from address 0

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

 



> On Jun 24, 2020, at 9:54 AM, Paolo Bonzini <pbonzini@xxxxxxxxxx> wrote:
> 
> Address 0 is also used for the SIPI vector (which is probably something worth
> changing as well), and now that we call setup_idt very early the SIPI vector
> overwrites the first few bytes of the IDT, and in particular the #DE handler.
> 
> Fix this for both 32-bit and 64-bit, even though the different form of the
> descriptors meant that only 32-bit showed a failure.
> 
> Reported-by: Thomas Huth <thuth@xxxxxxxxxx>
> Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
> ---
> x86/cstart.S   | 10 +++++++---
> x86/cstart64.S | 11 ++++++++++-
> 2 files changed, 17 insertions(+), 4 deletions(-)
> 
> diff --git a/x86/cstart.S b/x86/cstart.S
> index 77dc34d..e93dbca 100644
> --- a/x86/cstart.S
> +++ b/x86/cstart.S
> @@ -4,8 +4,6 @@
> .globl boot_idt
> .global online_cpus
> 
> -boot_idt = 0
> -

I think that there is a hidden assumption about the IDT location in
realmode’s test_int(), which this would break:

static void test_int(void)
{
        init_inregs(NULL);

        boot_idt[11] = 0x1000; /* Store a pointer to address 0x1000 in IDT entry 0x11 */
        *(u8 *)(0x1000) = 0xcf; /* 0x1000 contains an IRET instruction */

        MK_INSN(int11, "int $0x11\n\t");

        exec_in_big_real_mode(&insn_int11);
        report("int 1", 0, 1);
}





[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux