Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1720629
| From | Juergen Gross <jgross@suse.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [patch V2 35/44] x86/idt: Switch early trap init to IDT tables |
| Date | 2017-08-26 13:00 +0200 |
| Message-ID | <uiGYO-7X-13@gated-at.bofh.it> (permalink) |
| References | <uiuNX-Yh-7@gated-at.bofh.it> <uiuNX-Yh-5@gated-at.bofh.it> <uiz1f-3Ni-1@gated-at.bofh.it> <uiEtY-7d5-17@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 26/08/17 10:16, Thomas Gleixner wrote:
> On Fri, 25 Aug 2017, Boris Ostrovsky wrote:
>> On 08/25/2017 05:47 PM, Thomas Gleixner wrote:
>>>
>>> -/* Set of traps needed for early debugging. */
>>> -void __init early_trap_init(void)
>>> -{
>>> - /*
>>> - * Don't use IST to set DEBUG_STACK as it doesn't work until TSS
>>> - * is ready in cpu_init() <-- trap_init(). Before trap_init(),
>>> - * CPU runs at ring 0 so it is impossible to hit an invalid
>>> - * stack. Using the original stack works well enough at this
>>> - * early stage. DEBUG_STACK will be equipped after cpu_init() in
>>> - * trap_init().
>>> - */
>>> - set_intr_gate(X86_TRAP_DB, debug);
>>> - /* int3 can be called from all */
>>> - set_system_intr_gate(X86_TRAP_BP, &int3);
>>> -#ifdef CONFIG_X86_32
>>> - set_intr_gate(X86_TRAP_PF, page_fault);
>>> -#endif
>>> - load_idt(&idt_descr);
>>
>> This breaks 64-bit Xen PV guests: idt_setup_early_handler() is called
>> from x86_64_start_kernel(), which is not executed on those guests.
>
> early_trap_init() is called from setup_arch(), not from
> x86_64_start_kernel().
>
> This patch merily renames the function and moves the code into a different
> source file. So it's not changing the behaviour in any way.
It does: the IDT entries are now statically defined. Before that any
call of set_intr_gate() would have registered the trap handler with
the hypervisor, now this is done only when the IDT is being activated.
Boris' patch is doing that.
>
>> The patch below fixes it.
>
> I doubt that :)
Me not. :-)
Juergen
>
> Thanks,
>
> tglx
>
>> diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c
>> index 03fb07d..ed0fb8a 100644
>> --- a/arch/x86/xen/enlighten_pv.c
>> +++ b/arch/x86/xen/enlighten_pv.c
>> @@ -1374,6 +1374,7 @@ asmlinkage __visible void __init
>> xen_start_kernel(void)
>> i386_start_kernel();
>> #else
>> cr4_init_shadow(); /* 32b kernel does this in i386_start_kernel() */
>> + load_idt(&idt_descr);
>> x86_64_start_reservations((char *)__pa_symbol(&boot_params));
>> #endif
>> }
>
>
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[patch V2 35/44] x86/idt: Switch early trap init to IDT tables Thomas Gleixner <tglx@linutronix.de> - 2017-08-26 00:00 +0200
Re: [patch V2 35/44] x86/idt: Switch early trap init to IDT tables Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2017-08-26 04:30 +0200
Re: [patch V2 35/44] x86/idt: Switch early trap init to IDT tables Thomas Gleixner <tglx@linutronix.de> - 2017-08-26 10:20 +0200
Re: [patch V2 35/44] x86/idt: Switch early trap init to IDT tables Juergen Gross <jgross@suse.com> - 2017-08-26 13:00 +0200
Re: [patch V2 35/44] x86/idt: Switch early trap init to IDT tables Thomas Gleixner <tglx@linutronix.de> - 2017-08-26 15:10 +0200
Re: [patch V2 35/44] x86/idt: Switch early trap init to IDT tables Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2017-08-26 17:10 +0200
csiph-web