Re: [PATCH 09/11] x86/fault: Rename no_context() to kernelmode_fixup_or_oops()

2021-02-03 Thread Borislav Petkov
On Wed, Feb 03, 2021 at 12:14:24PM -0800, Andy Lutomirski wrote: > Hmm. I'm not convinced this is really much better. Maybe it is. Let > me think about it. I feel like it's somehow too close to the previous > tangle where too many functions did too many different things. I know what you mean.

Re: [PATCH 09/11] x86/fault: Rename no_context() to kernelmode_fixup_or_oops()

2021-02-03 Thread Andy Lutomirski
On Wed, Feb 3, 2021 at 12:07 PM Borislav Petkov wrote: > > On Wed, Feb 03, 2021 at 11:53:03AM -0800, Andy Lutomirski wrote: > > I feel like that would be more obfuscated — then the function would > > return without fixing anything for usermode faults, return after > > fixing it for kernel mode

Re: [PATCH 09/11] x86/fault: Rename no_context() to kernelmode_fixup_or_oops()

2021-02-03 Thread Borislav Petkov
On Wed, Feb 03, 2021 at 11:53:03AM -0800, Andy Lutomirski wrote: > I feel like that would be more obfuscated — then the function would > return without fixing anything for usermode faults, return after > fixing it for kernel mode faults, or oops. You practically pretty much have it already with

Re: [PATCH 09/11] x86/fault: Rename no_context() to kernelmode_fixup_or_oops()

2021-02-03 Thread Andy Lutomirski
> On Feb 3, 2021, at 11:39 AM, Borislav Petkov wrote: > > On Sun, Jan 31, 2021 at 09:24:40AM -0800, Andy Lutomirski wrote: >> The name no_context() has never been very clear. It's only called for >> faults from kernel mode, so rename it and change the no-longer-useful >> user_mode(regs)

Re: [PATCH 09/11] x86/fault: Rename no_context() to kernelmode_fixup_or_oops()

2021-02-03 Thread Borislav Petkov
On Sun, Jan 31, 2021 at 09:24:40AM -0800, Andy Lutomirski wrote: > The name no_context() has never been very clear. It's only called for > faults from kernel mode, so rename it and change the no-longer-useful > user_mode(regs) check to a WARN_ON_ONCE. > > Cc: Dave Hansen > Cc: Peter Zijlstra >

Re: [PATCH 09/11] x86/fault: Rename no_context() to kernelmode_fixup_or_oops()

2021-02-01 Thread Andy Lutomirski
On Mon, Feb 1, 2021 at 1:14 AM Christoph Hellwig wrote: > > On Sun, Jan 31, 2021 at 09:24:40AM -0800, Andy Lutomirski wrote: > > + kernelmode_fixup_or_oops(regs, error_code, address, pkey, > > si_code); > > > if (!user_mode(regs)) { > > - no_context(regs,

Re: [PATCH 09/11] x86/fault: Rename no_context() to kernelmode_fixup_or_oops()

2021-02-01 Thread Christoph Hellwig
On Sun, Jan 31, 2021 at 09:24:40AM -0800, Andy Lutomirski wrote: > + kernelmode_fixup_or_oops(regs, error_code, address, pkey, > si_code); > if (!user_mode(regs)) { > - no_context(regs, error_code, address, SIGBUS, BUS_ADRERR); > +

[PATCH 09/11] x86/fault: Rename no_context() to kernelmode_fixup_or_oops()

2021-01-31 Thread Andy Lutomirski
The name no_context() has never been very clear. It's only called for faults from kernel mode, so rename it and change the no-longer-useful user_mode(regs) check to a WARN_ON_ONCE. Cc: Dave Hansen Cc: Peter Zijlstra Signed-off-by: Andy Lutomirski --- arch/x86/mm/fault.c | 28