Re: [kvm-unit-tests PATCH 1/3] x86: realmode: initialize idtr

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

 



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@xxxxxxxxxx>
> ---
>  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"
> 




[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