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

Re: [Xen-devel] [PATCH v4 16/27] x86/traps: factor out pv_trap_init



On Fri, Jun 23, 2017 at 01:31:22PM +0100, Andrew Cooper wrote:
> On 08/06/17 18:11, Wei Liu wrote:
> > Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
> > ---
> >  xen/arch/x86/traps.c           | 22 ++++++++++++++--------
> >  xen/include/asm-x86/pv/traps.h |  4 ++++
> >  2 files changed, 18 insertions(+), 8 deletions(-)
> >
> > diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
> > index 8861dfd332..29a83994bd 100644
> > --- a/xen/arch/x86/traps.c
> > +++ b/xen/arch/x86/traps.c
> > @@ -1871,14 +1871,8 @@ void __init init_idt_traps(void)
> >      this_cpu(compat_gdt_table) = boot_cpu_compat_gdt_table;
> >  }
> >  
> > -extern void (*const autogen_entrypoints[NR_VECTORS])(void);
> > -void __init trap_init(void)
> > +void __init pv_trap_init(void)
> >  {
> > -    unsigned int vector;
> > -
> > -    /* Replace early pagefault with real pagefault handler. */
> > -    set_intr_gate(TRAP_page_fault, &page_fault);
> > -
> >      /* The 32-on-64 hypercall vector is only accessible from ring 1. */
> >      _set_gate(idt_table + HYPERCALL_VECTOR,
> >                SYS_DESC_trap_gate, 1, entry_int82);
> > @@ -1886,6 +1880,19 @@ void __init trap_init(void)
> >      /* Fast trap for int80 (faster than taking the #GP-fixup path). */
> >      _set_gate(idt_table + 0x80, SYS_DESC_trap_gate, 3, &int80_direct_trap);
> >  
> > +    open_softirq(NMI_MCE_SOFTIRQ, nmi_mce_softirq);
> > +}
> > +
> > +extern void (*const autogen_entrypoints[NR_VECTORS])(void);
> > +void __init trap_init(void)
> > +{
> > +    unsigned int vector;
> > +
> > +    pv_trap_init();
> 
> This call should be at the end of trap_init(), but I guess you hit the
> assertion?
> 

Yes, that would hit the assertion.

> The !CONFIG_PV case will similarly hit the assertion.
> 
> For !CONFIG_PV, 0x80 and 0x82 would best become general interrupt
> handlers, which means you need to tweak entry.S autogen_stubs, and also
> tweak init_irq_data()
> 

Good point. I will tweak both locations.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.