Re: [RFC PATCH 1/1] x86/traps: Get rid of exception handlers' second argument error code

2023-08-05 Thread Thomas Gleixner
On Fri, Aug 04 2023 at 21:01, Peter Zijlstra wrote: > On Fri, Aug 04, 2023 at 05:35:11PM +, Li, Xin3 wrote: >> > > The commit d99015b1abbad ("x86: move entry_64.S register saving out of >> > > the macros") introduced the changes to set orig_ax to -1, but I can't >> > > see why it's required.

Re: [RFC PATCH 1/1] x86/traps: Get rid of exception handlers' second argument error code

2023-08-04 Thread Peter Zijlstra
On Fri, Aug 04, 2023 at 05:35:11PM +, Li, Xin3 wrote: > > > The IDT event delivery of X86_TRAP_DF, X86_TRAP_TS, X86_TRAP_NP, > > > X86_TRAP_SS, X86_TRAP_GP, X86_TRAP_AC and X86_TRAP_CP pushes an error > > > code into the orig_ax member of the pt_regs structure, and the error > > > code is

RE: [RFC PATCH 1/1] x86/traps: Get rid of exception handlers' second argument error code

2023-08-04 Thread Li, Xin3
> > The IDT event delivery of X86_TRAP_DF, X86_TRAP_TS, X86_TRAP_NP, > > X86_TRAP_SS, X86_TRAP_GP, X86_TRAP_AC and X86_TRAP_CP pushes an error > > code into the orig_ax member of the pt_regs structure, and the error > > code is passed as the second argument of their C-handlers, although > > the

RE: [RFC PATCH 1/1] x86/traps: Get rid of exception handlers' second argument error code

2023-08-04 Thread Li, Xin3
> > On 04/08/2023 8:57 am, Xin Li wrote: > >> I haven't checked Xen implications with this change, i.e., does Xen > >> hypervisor need to adjust how it passes arguments to PV guests? > > > > This is an internal detail of how Linux handles data on it's stacks, > > isn't it? > > > > The Xen code in

RE: [RFC PATCH 1/1] x86/traps: Get rid of exception handlers' second argument error code

2023-08-04 Thread Li, Xin3
> On 04/08/2023 8:57 am, Xin Li wrote: > > I haven't checked Xen implications with this change, i.e., does Xen > > hypervisor need to adjust how it passes arguments to PV guests? > > This is an internal detail of how Linux handles data on it's stacks, isn't it? Yes, it is completely internal to

Re: [RFC PATCH 1/1] x86/traps: Get rid of exception handlers' second argument error code

2023-08-04 Thread Juergen Gross
On 04.08.23 12:25, Andrew Cooper wrote: On 04/08/2023 8:57 am, Xin Li wrote: I haven't checked Xen implications with this change, i.e., does Xen hypervisor need to adjust how it passes arguments to PV guests? This is an internal detail of how Linux handles data on it's stacks, isn't it? The

Re: [RFC PATCH 1/1] x86/traps: Get rid of exception handlers' second argument error code

2023-08-04 Thread Andrew Cooper
On 04/08/2023 8:57 am, Xin Li wrote: > I haven't checked Xen implications with this change, i.e., does Xen > hypervisor need to adjust how it passes arguments to PV guests? This is an internal detail of how Linux handles data on it's stacks, isn't it? The Xen code in Linux will need adjustment

Re: [RFC PATCH 1/1] x86/traps: Get rid of exception handlers' second argument error code

2023-08-04 Thread Peter Zijlstra
On Fri, Aug 04, 2023 at 12:57:34AM -0700, Xin Li wrote: > The IDT event delivery of X86_TRAP_DF, X86_TRAP_TS, X86_TRAP_NP, > X86_TRAP_SS, X86_TRAP_GP, X86_TRAP_AC and X86_TRAP_CP pushes an error > code into the orig_ax member of the pt_regs structure, and the error > code is passed as the second

[RFC PATCH 1/1] x86/traps: Get rid of exception handlers' second argument error code

2023-08-04 Thread Xin Li
The IDT event delivery of X86_TRAP_DF, X86_TRAP_TS, X86_TRAP_NP, X86_TRAP_SS, X86_TRAP_GP, X86_TRAP_AC and X86_TRAP_CP pushes an error code into the orig_ax member of the pt_regs structure, and the error code is passed as the second argument of their C-handlers, although the pt_regs structure is