I am looking at the hypervisor code to see how Xen setup the IDT. But it seems that the code in protected mode reuses the real mode IDT? In arch/x86/boot/trampoline.S we have at several places: lidt bootsym(idt_48) And idt_48 is defined as: idt_48: .word 0,0,0 # base = limit = 0 And in nowhere we initialize idt_48, which means idt_48 reuses real mode IDT table. However, real mode IDT table has different format than protected mode IDT, so this doesnt look to work for me. Definitely I miss something here. Anybody could enlighten me how IDT setting in protected mode work? Thanks, Jun _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
There is another IDTR reload in x86_32.S at line 15 , where the protected mode IDT vectors are initialized with ignore_int handler firstly. Then trap_init called from __xen_start will setup the formal IDT vectors . 2008/1/31, Jun Koi <junkoi2004@gmail.com>:> I am looking at the hypervisor code to see how Xen setup the IDT. But > it seems that the code in protected mode reuses the real mode IDT? > > In arch/x86/boot/trampoline.S we have at several places: > > lidt bootsym(idt_48) > > And idt_48 is defined as: > > idt_48: .word 0,0,0 # base = limit = 0 > > And in nowhere we initialize idt_48, which means idt_48 reuses real > mode IDT table. However, real mode IDT table has different format than > protected mode IDT, so this doesnt look to work for me. > > Definitely I miss something here. Anybody could enlighten me how IDT > setting in protected mode work? > > Thanks, > Jun > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 1/31/08, 余上 <yusunn@gmail.com> wrote:> There is another IDTR reload in x86_32.S at line 15 , where the > protected mode IDT vectors are initialized with ignore_int handler > firstly. Then trap_init called from __xen_start will setup the formal > IDT vectors .Now I see that. But the the question is: why we have to setup a "dummy" IDT in trampoline.S like that??? Thanks, Jun> > 2008/1/31, Jun Koi <junkoi2004@gmail.com>: > > I am looking at the hypervisor code to see how Xen setup the IDT. But > > it seems that the code in protected mode reuses the real mode IDT? > > > > In arch/x86/boot/trampoline.S we have at several places: > > > > lidt bootsym(idt_48) > > > > And idt_48 is defined as: > > > > idt_48: .word 0,0,0 # base = limit = 0 > > > > And in nowhere we initialize idt_48, which means idt_48 reuses real > > mode IDT table. However, real mode IDT table has different format than > > protected mode IDT, so this doesnt look to work for me. > > > > Definitely I miss something here. Anybody could enlighten me how IDT > > setting in protected mode work? > > > > Thanks, > > Jun > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
I think maybe it is just some kind of coding style ? Or necessary for CPU state transition ? 2008/1/31, Jun Koi <junkoi2004@gmail.com>:> On 1/31/08, 余上 <yusunn@gmail.com> wrote: > > There is another IDTR reload in x86_32.S at line 15 , where the > > protected mode IDT vectors are initialized with ignore_int handler > > firstly. Then trap_init called from __xen_start will setup the formal > > IDT vectors . > > Now I see that. But the the question is: why we have to setup a > "dummy" IDT in trampoline.S like that??? > > Thanks, > Jun > > > > > > 2008/1/31, Jun Koi <junkoi2004@gmail.com>: > > > I am looking at the hypervisor code to see how Xen setup the IDT. But > > > it seems that the code in protected mode reuses the real mode IDT? > > > > > > In arch/x86/boot/trampoline.S we have at several places: > > > > > > lidt bootsym(idt_48) > > > > > > And idt_48 is defined as: > > > > > > idt_48: .word 0,0,0 # base = limit = 0 > > > > > > And in nowhere we initialize idt_48, which means idt_48 reuses real > > > mode IDT table. However, real mode IDT table has different format than > > > protected mode IDT, so this doesnt look to work for me. > > > > > > Definitely I miss something here. Anybody could enlighten me how IDT > > > setting in protected mode work? > > > > > > Thanks, > > > Jun > > > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel