RE: [PATCH v13 26/35] x86/fred: FRED entry/exit and dispatch code

2023-12-07 Thread Li, Xin3
> > In my opinion, cross-checking is the better approach, because it means that > > violations of the assumptions get noticed more quickly, and hopefully by > > whomever is working on the new feature which alters the assumptions. > > Yeah, I can make the change. Hi Andrew, Following is the upd

Re: [PATCH v13 26/35] x86/fred: FRED entry/exit and dispatch code

2023-12-06 Thread Brian Gerst
On Wed, Dec 6, 2023 at 2:19 PM Li, Xin3 wrote: > > > >>> + case X86_TRAP_OF: > > >>> + exc_overflow(regs); > > >>> + return; > > >>> + > > >>> + /* INT3 */ > > >>> + case X86_TRAP_BP: > > >>> + exc_int3(regs); > > >>> + return; > > >> ... neither OF nor BP will ever

RE: [PATCH v13 26/35] x86/fred: FRED entry/exit and dispatch code

2023-12-06 Thread H. Peter Anvin
On December 6, 2023 11:19:26 AM PST, "Li, Xin3" wrote: >> >>> +case X86_TRAP_OF: >> >>> +exc_overflow(regs); >> >>> +return; >> >>> + >> >>> +/* INT3 */ >> >>> +case X86_TRAP_BP: >> >>> +exc_int3(regs); >> >>> +

RE: [PATCH v13 26/35] x86/fred: FRED entry/exit and dispatch code

2023-12-06 Thread Li, Xin3
> >>> + case X86_TRAP_OF: > >>> + exc_overflow(regs); > >>> + return; > >>> + > >>> + /* INT3 */ > >>> + case X86_TRAP_BP: > >>> + exc_int3(regs); > >>> + return; > >> ... neither OF nor BP will ever enter fred_intx() because they're > >> type SWEXC not SWINT. > > Pe

Re: [PATCH v13 26/35] x86/fred: FRED entry/exit and dispatch code

2023-12-06 Thread Andrew Cooper
On 06/12/2023 7:45 am, Li, Xin3 wrote: >>> + case X86_TRAP_OF: >>> + exc_overflow(regs); >>> + return; >>> + >>> + /* INT3 */ >>> + case X86_TRAP_BP: >>> + exc_int3(regs); >>> + return; >> ... neither OF nor BP will ever enter fred_intx() because they'r

RE: [PATCH v13 26/35] x86/fred: FRED entry/exit and dispatch code

2023-12-05 Thread Li, Xin3
> > diff --git a/arch/x86/entry/entry_fred.c b/arch/x86/entry/entry_fred.c > > new file mode 100644 index ..215883e90f94 > > --- /dev/null > > +++ b/arch/x86/entry/entry_fred.c > > @@ -0,0 +1,230 @@ > > ... > > +static noinstr void fred_intx(struct pt_regs *regs) { > > + switch (regs-

RE: [PATCH v13 26/35] x86/fred: FRED entry/exit and dispatch code

2023-12-05 Thread Li, Xin3
> > +static noinstr void fred_intx(struct pt_regs *regs) { > > + switch (regs->fred_ss.vector) { > > + /* INT0 */ > > INTO (for overflow), not INT-zero.  However... > > > + case X86_TRAP_OF: > > + exc_overflow(regs); > > + return; > > + > > + /* INT3 */ > > + case X8

Re: [PATCH v13 26/35] x86/fred: FRED entry/exit and dispatch code

2023-12-05 Thread Andrew Cooper
On 05/12/2023 10:50 am, Xin Li wrote: > diff --git a/arch/x86/entry/entry_fred.c b/arch/x86/entry/entry_fred.c > new file mode 100644 > index ..215883e90f94 > --- /dev/null > +++ b/arch/x86/entry/entry_fred.c > @@ -0,0 +1,230 @@ > ... > +static noinstr void fred_intx(struct pt_regs *reg