Re: [patch V6 10/37] x86/entry: Switch XEN/PV hypercall entry to IDTENTRY

2020-05-21 Thread Thomas Gleixner
Andy Lutomirski writes: > On Wed, May 20, 2020 at 12:17 PM Thomas Gleixner wrote: >> >> Andy Lutomirski writes: >> > Andrew Cooper pointed out that there is too much magic in Xen for this >> > to work. So never mind. >> >> :) >> >> But you made me stare more at that stuff and I came up with a

Re: [patch V6 10/37] x86/entry: Switch XEN/PV hypercall entry to IDTENTRY

2020-05-21 Thread Thomas Gleixner
Boris Ostrovsky writes: > On 5/20/20 3:16 PM, Thomas Gleixner wrote: > > >> +__visible noinstr void xen_pv_evtchn_do_upcall(struct pt_regs *regs) >> +{ >> +struct pt_regs *old_regs; >> +bool inhcall; >> + >> +idtentry_enter(regs); >> +old_regs = set_irq_regs(regs); >> + >> +

Re: [patch V6 10/37] x86/entry: Switch XEN/PV hypercall entry to IDTENTRY

2020-05-20 Thread Boris Ostrovsky
On 5/20/20 3:16 PM, Thomas Gleixner wrote: > +__visible noinstr void xen_pv_evtchn_do_upcall(struct pt_regs *regs) > +{ > + struct pt_regs *old_regs; > + bool inhcall; > + > + idtentry_enter(regs); > + old_regs = set_irq_regs(regs); > + > +

Re: [patch V6 10/37] x86/entry: Switch XEN/PV hypercall entry to IDTENTRY

2020-05-20 Thread Andy Lutomirski
On Wed, May 20, 2020 at 12:17 PM Thomas Gleixner wrote: > > Andy Lutomirski writes: > > Andrew Cooper pointed out that there is too much magic in Xen for this > > to work. So never mind. > > :) > > But you made me stare more at that stuff and I came up with a way > simpler solution. See below.

Re: [patch V6 10/37] x86/entry: Switch XEN/PV hypercall entry to IDTENTRY

2020-05-20 Thread Thomas Gleixner
Andy Lutomirski writes: > Andrew Cooper pointed out that there is too much magic in Xen for this > to work. So never mind. :) But you made me stare more at that stuff and I came up with a way simpler solution. See below. Thanks, tglx 8<-- arch/x86/entry/common.c

Re: [patch V6 10/37] x86/entry: Switch XEN/PV hypercall entry to IDTENTRY

2020-05-20 Thread Andy Lutomirski
On Wed, May 20, 2020 at 8:16 AM Andy Lutomirski wrote: > > On Wed, May 20, 2020 at 7:13 AM Thomas Gleixner wrote: > > > > Andy Lutomirski writes: > > > On Tue, May 19, 2020 at 11:58 AM Thomas Gleixner > > > wrote: > > >> Which brings you into the situation that you call schedule() from the >

Re: [patch V6 10/37] x86/entry: Switch XEN/PV hypercall entry to IDTENTRY

2020-05-20 Thread Andy Lutomirski
On Wed, May 20, 2020 at 7:13 AM Thomas Gleixner wrote: > > Andy Lutomirski writes: > > On Tue, May 19, 2020 at 11:58 AM Thomas Gleixner wrote: > >> Which brings you into the situation that you call schedule() from the > >> point where we just moved it out. If we would go there we'd need to > >>

Re: [patch V6 10/37] x86/entry: Switch XEN/PV hypercall entry to IDTENTRY

2020-05-20 Thread Thomas Gleixner
Andy Lutomirski writes: > On Tue, May 19, 2020 at 11:58 AM Thomas Gleixner wrote: >> Which brings you into the situation that you call schedule() from the >> point where we just moved it out. If we would go there we'd need to >> ensure that RCU is watching as well. idtentry_exit() might have it

Re: [patch V6 10/37] x86/entry: Switch XEN/PV hypercall entry to IDTENTRY

2020-05-20 Thread Andrew Cooper
On 20/05/2020 09:06, Jürgen Groß wrote: > On 19.05.20 21:44, Andy Lutomirski wrote: >> On Tue, May 19, 2020 at 11:58 AM Thomas Gleixner >> wrote: >>> >>> Andy Lutomirski writes: B: Turn this thing around.  Specifically, in the one and only case we care about, we know pretty much

Re: [patch V6 10/37] x86/entry: Switch XEN/PV hypercall entry to IDTENTRY

2020-05-20 Thread Jürgen Groß
On 19.05.20 21:44, Andy Lutomirski wrote: On Tue, May 19, 2020 at 11:58 AM Thomas Gleixner wrote: Andy Lutomirski writes: On Fri, May 15, 2020 at 5:10 PM Thomas Gleixner wrote: @@ -573,6 +578,16 @@ static __always_inline void __idtentry_exit(struct pt_regs *regs)

Re: [patch V6 10/37] x86/entry: Switch XEN/PV hypercall entry to IDTENTRY

2020-05-19 Thread Andy Lutomirski
On Tue, May 19, 2020 at 11:58 AM Thomas Gleixner wrote: > > Andy Lutomirski writes: > > On Fri, May 15, 2020 at 5:10 PM Thomas Gleixner wrote: > >> @@ -573,6 +578,16 @@ static __always_inline void __idtentry_exit(struct > >> pt_regs *regs) > >>

Re: [patch V6 10/37] x86/entry: Switch XEN/PV hypercall entry to IDTENTRY

2020-05-19 Thread Thomas Gleixner
Andy Lutomirski writes: > On Fri, May 15, 2020 at 5:10 PM Thomas Gleixner wrote: >> @@ -573,6 +578,16 @@ static __always_inline void __idtentry_exit(struct >> pt_regs *regs) >> instrumentation_end(); >> return; >>

Re: [patch V6 10/37] x86/entry: Switch XEN/PV hypercall entry to IDTENTRY

2020-05-19 Thread Andy Lutomirski
On Fri, May 15, 2020 at 5:10 PM Thomas Gleixner wrote: > > > Convert the XEN/PV hypercall to IDTENTRY: > > - Emit the ASM stub with DECLARE_IDTENTRY > - Remove the ASM idtentry in 64bit > - Remove the open coded ASM entry code in 32bit > - Remove the old prototypes > > The handler stubs

[patch V6 10/37] x86/entry: Switch XEN/PV hypercall entry to IDTENTRY

2020-05-15 Thread Thomas Gleixner
Convert the XEN/PV hypercall to IDTENTRY: - Emit the ASM stub with DECLARE_IDTENTRY - Remove the ASM idtentry in 64bit - Remove the open coded ASM entry code in 32bit - Remove the old prototypes The handler stubs need to stay in ASM code as it needs corner case handling and adjustment