Re: TLB flushes on fixmap changes

2018-08-28 Thread Nadav Amit
at 1:49 AM, Masami Hiramatsu wrote: > On Mon, 27 Aug 2018 16:01:32 -0700 > Andy Lutomirski wrote: > >> On Mon, Aug 27, 2018 at 3:54 PM, Nadav Amit wrote: >>> at 3:32 PM, Andy Lutomirski wrote: >>> On Mon, Aug 27, 2018 at 2:55 PM, Nadav Amit wrote: > at 1:16 PM, Nadav Amit wrote:

Re: TLB flushes on fixmap changes

2018-08-28 Thread Nadav Amit
at 1:49 AM, Masami Hiramatsu wrote: > On Mon, 27 Aug 2018 16:01:32 -0700 > Andy Lutomirski wrote: > >> On Mon, Aug 27, 2018 at 3:54 PM, Nadav Amit wrote: >>> at 3:32 PM, Andy Lutomirski wrote: >>> On Mon, Aug 27, 2018 at 2:55 PM, Nadav Amit wrote: > at 1:16 PM, Nadav Amit wrote:

Re: TLB flushes on fixmap changes

2018-08-28 Thread Masami Hiramatsu
On Mon, 27 Aug 2018 16:01:32 -0700 Andy Lutomirski wrote: > On Mon, Aug 27, 2018 at 3:54 PM, Nadav Amit wrote: > > at 3:32 PM, Andy Lutomirski wrote: > > > >> On Mon, Aug 27, 2018 at 2:55 PM, Nadav Amit wrote: > >>> at 1:16 PM, Nadav Amit wrote: > >>> > at 12:58 PM, Andy Lutomirski

Re: TLB flushes on fixmap changes

2018-08-28 Thread Masami Hiramatsu
On Mon, 27 Aug 2018 16:01:32 -0700 Andy Lutomirski wrote: > On Mon, Aug 27, 2018 at 3:54 PM, Nadav Amit wrote: > > at 3:32 PM, Andy Lutomirski wrote: > > > >> On Mon, Aug 27, 2018 at 2:55 PM, Nadav Amit wrote: > >>> at 1:16 PM, Nadav Amit wrote: > >>> > at 12:58 PM, Andy Lutomirski

Re: TLB flushes on fixmap changes

2018-08-27 Thread Andy Lutomirski
On Mon, Aug 27, 2018 at 3:54 PM, Nadav Amit wrote: > at 3:32 PM, Andy Lutomirski wrote: > >> On Mon, Aug 27, 2018 at 2:55 PM, Nadav Amit wrote: >>> at 1:16 PM, Nadav Amit wrote: >>> at 12:58 PM, Andy Lutomirski wrote: > On Mon, Aug 27, 2018 at 12:43 PM, Nadav Amit wrote: >>

Re: TLB flushes on fixmap changes

2018-08-27 Thread Andy Lutomirski
On Mon, Aug 27, 2018 at 3:54 PM, Nadav Amit wrote: > at 3:32 PM, Andy Lutomirski wrote: > >> On Mon, Aug 27, 2018 at 2:55 PM, Nadav Amit wrote: >>> at 1:16 PM, Nadav Amit wrote: >>> at 12:58 PM, Andy Lutomirski wrote: > On Mon, Aug 27, 2018 at 12:43 PM, Nadav Amit wrote: >>

Re: TLB flushes on fixmap changes

2018-08-27 Thread Nadav Amit
at 3:32 PM, Andy Lutomirski wrote: > On Mon, Aug 27, 2018 at 2:55 PM, Nadav Amit wrote: >> at 1:16 PM, Nadav Amit wrote: >> >>> at 12:58 PM, Andy Lutomirski wrote: >>> On Mon, Aug 27, 2018 at 12:43 PM, Nadav Amit wrote: > at 12:10 PM, Nadav Amit wrote: > >> at 11:58 AM,

Re: TLB flushes on fixmap changes

2018-08-27 Thread Nadav Amit
at 3:32 PM, Andy Lutomirski wrote: > On Mon, Aug 27, 2018 at 2:55 PM, Nadav Amit wrote: >> at 1:16 PM, Nadav Amit wrote: >> >>> at 12:58 PM, Andy Lutomirski wrote: >>> On Mon, Aug 27, 2018 at 12:43 PM, Nadav Amit wrote: > at 12:10 PM, Nadav Amit wrote: > >> at 11:58 AM,

Re: TLB flushes on fixmap changes

2018-08-27 Thread Andy Lutomirski
On Mon, Aug 27, 2018 at 2:55 PM, Nadav Amit wrote: > at 1:16 PM, Nadav Amit wrote: > >> at 12:58 PM, Andy Lutomirski wrote: >> >>> On Mon, Aug 27, 2018 at 12:43 PM, Nadav Amit wrote: at 12:10 PM, Nadav Amit wrote: > at 11:58 AM, Andy Lutomirski wrote: > >> On Mon, Aug

Re: TLB flushes on fixmap changes

2018-08-27 Thread Andy Lutomirski
On Mon, Aug 27, 2018 at 2:55 PM, Nadav Amit wrote: > at 1:16 PM, Nadav Amit wrote: > >> at 12:58 PM, Andy Lutomirski wrote: >> >>> On Mon, Aug 27, 2018 at 12:43 PM, Nadav Amit wrote: at 12:10 PM, Nadav Amit wrote: > at 11:58 AM, Andy Lutomirski wrote: > >> On Mon, Aug

Re: TLB flushes on fixmap changes

2018-08-27 Thread Nadav Amit
at 1:16 PM, Nadav Amit wrote: > at 12:58 PM, Andy Lutomirski wrote: > >> On Mon, Aug 27, 2018 at 12:43 PM, Nadav Amit wrote: >>> at 12:10 PM, Nadav Amit wrote: >>> at 11:58 AM, Andy Lutomirski wrote: > On Mon, Aug 27, 2018 at 11:54 AM, Nadav Amit wrote: >>> On Mon, Aug

Re: TLB flushes on fixmap changes

2018-08-27 Thread Nadav Amit
at 1:16 PM, Nadav Amit wrote: > at 12:58 PM, Andy Lutomirski wrote: > >> On Mon, Aug 27, 2018 at 12:43 PM, Nadav Amit wrote: >>> at 12:10 PM, Nadav Amit wrote: >>> at 11:58 AM, Andy Lutomirski wrote: > On Mon, Aug 27, 2018 at 11:54 AM, Nadav Amit wrote: >>> On Mon, Aug

Re: TLB flushes on fixmap changes

2018-08-27 Thread Nadav Amit
at 12:58 PM, Andy Lutomirski wrote: > On Mon, Aug 27, 2018 at 12:43 PM, Nadav Amit wrote: >> at 12:10 PM, Nadav Amit wrote: >> >>> at 11:58 AM, Andy Lutomirski wrote: >>> On Mon, Aug 27, 2018 at 11:54 AM, Nadav Amit wrote: >> On Mon, Aug 27, 2018 at 10:34 AM, Nadav Amit >>

Re: TLB flushes on fixmap changes

2018-08-27 Thread Nadav Amit
at 12:58 PM, Andy Lutomirski wrote: > On Mon, Aug 27, 2018 at 12:43 PM, Nadav Amit wrote: >> at 12:10 PM, Nadav Amit wrote: >> >>> at 11:58 AM, Andy Lutomirski wrote: >>> On Mon, Aug 27, 2018 at 11:54 AM, Nadav Amit wrote: >> On Mon, Aug 27, 2018 at 10:34 AM, Nadav Amit >>

Re: TLB flushes on fixmap changes

2018-08-27 Thread Andy Lutomirski
On Mon, Aug 27, 2018 at 12:43 PM, Nadav Amit wrote: > at 12:10 PM, Nadav Amit wrote: > >> at 11:58 AM, Andy Lutomirski wrote: >> >>> On Mon, Aug 27, 2018 at 11:54 AM, Nadav Amit wrote: > On Mon, Aug 27, 2018 at 10:34 AM, Nadav Amit wrote: > What do you all think? I agree in

Re: TLB flushes on fixmap changes

2018-08-27 Thread Andy Lutomirski
On Mon, Aug 27, 2018 at 12:43 PM, Nadav Amit wrote: > at 12:10 PM, Nadav Amit wrote: > >> at 11:58 AM, Andy Lutomirski wrote: >> >>> On Mon, Aug 27, 2018 at 11:54 AM, Nadav Amit wrote: > On Mon, Aug 27, 2018 at 10:34 AM, Nadav Amit wrote: > What do you all think? I agree in

Re: TLB flushes on fixmap changes

2018-08-27 Thread Nadav Amit
at 12:10 PM, Nadav Amit wrote: > at 11:58 AM, Andy Lutomirski wrote: > >> On Mon, Aug 27, 2018 at 11:54 AM, Nadav Amit wrote: On Mon, Aug 27, 2018 at 10:34 AM, Nadav Amit wrote: What do you all think? >>> >>> I agree in general. But I think that current->mm would need to be

Re: TLB flushes on fixmap changes

2018-08-27 Thread Nadav Amit
at 12:10 PM, Nadav Amit wrote: > at 11:58 AM, Andy Lutomirski wrote: > >> On Mon, Aug 27, 2018 at 11:54 AM, Nadav Amit wrote: On Mon, Aug 27, 2018 at 10:34 AM, Nadav Amit wrote: What do you all think? >>> >>> I agree in general. But I think that current->mm would need to be

Re: TLB flushes on fixmap changes

2018-08-27 Thread Nadav Amit
at 11:58 AM, Andy Lutomirski wrote: > On Mon, Aug 27, 2018 at 11:54 AM, Nadav Amit wrote: >>> On Mon, Aug 27, 2018 at 10:34 AM, Nadav Amit wrote: >>> What do you all think? >> >> I agree in general. But I think that current->mm would need to be loaded, as >> otherwise I am afraid it would

Re: TLB flushes on fixmap changes

2018-08-27 Thread Nadav Amit
at 11:58 AM, Andy Lutomirski wrote: > On Mon, Aug 27, 2018 at 11:54 AM, Nadav Amit wrote: >>> On Mon, Aug 27, 2018 at 10:34 AM, Nadav Amit wrote: >>> What do you all think? >> >> I agree in general. But I think that current->mm would need to be loaded, as >> otherwise I am afraid it would

Re: TLB flushes on fixmap changes

2018-08-27 Thread Andy Lutomirski
On Mon, Aug 27, 2018 at 11:54 AM, Nadav Amit wrote: >> On Mon, Aug 27, 2018 at 10:34 AM, Nadav Amit wrote: >> What do you all think? > > I agree in general. But I think that current->mm would need to be loaded, as > otherwise I am afraid it would break switch_mm_irqs_off(). > What breaks?

Re: TLB flushes on fixmap changes

2018-08-27 Thread Andy Lutomirski
On Mon, Aug 27, 2018 at 11:54 AM, Nadav Amit wrote: >> On Mon, Aug 27, 2018 at 10:34 AM, Nadav Amit wrote: >> What do you all think? > > I agree in general. But I think that current->mm would need to be loaded, as > otherwise I am afraid it would break switch_mm_irqs_off(). > What breaks?

Re: TLB flushes on fixmap changes

2018-08-27 Thread Nadav Amit
at 11:45 AM, Andy Lutomirski wrote: > On Mon, Aug 27, 2018 at 10:34 AM, Nadav Amit wrote: >> at 1:05 AM, Masami Hiramatsu wrote: >> >>> On Sun, 26 Aug 2018 20:26:09 -0700 >>> Nadav Amit wrote: >>> at 8:03 PM, Masami Hiramatsu wrote: > On Sun, 26 Aug 2018 11:09:58 +0200 >

Re: TLB flushes on fixmap changes

2018-08-27 Thread Nadav Amit
at 11:45 AM, Andy Lutomirski wrote: > On Mon, Aug 27, 2018 at 10:34 AM, Nadav Amit wrote: >> at 1:05 AM, Masami Hiramatsu wrote: >> >>> On Sun, 26 Aug 2018 20:26:09 -0700 >>> Nadav Amit wrote: >>> at 8:03 PM, Masami Hiramatsu wrote: > On Sun, 26 Aug 2018 11:09:58 +0200 >

Re: TLB flushes on fixmap changes

2018-08-27 Thread Andy Lutomirski
On Mon, Aug 27, 2018 at 10:34 AM, Nadav Amit wrote: > at 1:05 AM, Masami Hiramatsu wrote: > >> On Sun, 26 Aug 2018 20:26:09 -0700 >> Nadav Amit wrote: >> >>> at 8:03 PM, Masami Hiramatsu wrote: >>> On Sun, 26 Aug 2018 11:09:58 +0200 Peter Zijlstra wrote: > On Sat, Aug 25,

Re: TLB flushes on fixmap changes

2018-08-27 Thread Andy Lutomirski
On Mon, Aug 27, 2018 at 10:34 AM, Nadav Amit wrote: > at 1:05 AM, Masami Hiramatsu wrote: > >> On Sun, 26 Aug 2018 20:26:09 -0700 >> Nadav Amit wrote: >> >>> at 8:03 PM, Masami Hiramatsu wrote: >>> On Sun, 26 Aug 2018 11:09:58 +0200 Peter Zijlstra wrote: > On Sat, Aug 25,

Re: TLB flushes on fixmap changes

2018-08-27 Thread Nadav Amit
at 1:05 AM, Masami Hiramatsu wrote: > On Sun, 26 Aug 2018 20:26:09 -0700 > Nadav Amit wrote: > >> at 8:03 PM, Masami Hiramatsu wrote: >> >>> On Sun, 26 Aug 2018 11:09:58 +0200 >>> Peter Zijlstra wrote: >>> On Sat, Aug 25, 2018 at 09:21:22PM -0700, Andy Lutomirski wrote: > I just

Re: TLB flushes on fixmap changes

2018-08-27 Thread Nadav Amit
at 1:05 AM, Masami Hiramatsu wrote: > On Sun, 26 Aug 2018 20:26:09 -0700 > Nadav Amit wrote: > >> at 8:03 PM, Masami Hiramatsu wrote: >> >>> On Sun, 26 Aug 2018 11:09:58 +0200 >>> Peter Zijlstra wrote: >>> On Sat, Aug 25, 2018 at 09:21:22PM -0700, Andy Lutomirski wrote: > I just

Re: TLB flushes on fixmap changes

2018-08-27 Thread Jann Horn
On Mon, Aug 27, 2018 at 10:13 AM Peter Zijlstra wrote: > > On Mon, Aug 27, 2018 at 12:03:05PM +0900, Masami Hiramatsu wrote: > > On Sun, 26 Aug 2018 11:09:58 +0200 > > Peter Zijlstra wrote: > > > > FWIW, before text_poke_bp(), text_poke() would only be used from > > > stop_machine, so all the

Re: TLB flushes on fixmap changes

2018-08-27 Thread Jann Horn
On Mon, Aug 27, 2018 at 10:13 AM Peter Zijlstra wrote: > > On Mon, Aug 27, 2018 at 12:03:05PM +0900, Masami Hiramatsu wrote: > > On Sun, 26 Aug 2018 11:09:58 +0200 > > Peter Zijlstra wrote: > > > > FWIW, before text_poke_bp(), text_poke() would only be used from > > > stop_machine, so all the

Re: TLB flushes on fixmap changes

2018-08-27 Thread Masami Hiramatsu
On Mon, 27 Aug 2018 10:13:29 +0200 Peter Zijlstra wrote: > On Mon, Aug 27, 2018 at 12:03:05PM +0900, Masami Hiramatsu wrote: > > On Sun, 26 Aug 2018 11:09:58 +0200 > > Peter Zijlstra wrote: > > > > FWIW, before text_poke_bp(), text_poke() would only be used from > > > stop_machine, so all the

Re: TLB flushes on fixmap changes

2018-08-27 Thread Masami Hiramatsu
On Mon, 27 Aug 2018 10:13:29 +0200 Peter Zijlstra wrote: > On Mon, Aug 27, 2018 at 12:03:05PM +0900, Masami Hiramatsu wrote: > > On Sun, 26 Aug 2018 11:09:58 +0200 > > Peter Zijlstra wrote: > > > > FWIW, before text_poke_bp(), text_poke() would only be used from > > > stop_machine, so all the

Re: TLB flushes on fixmap changes

2018-08-27 Thread Peter Zijlstra
On Mon, Aug 27, 2018 at 12:03:05PM +0900, Masami Hiramatsu wrote: > On Sun, 26 Aug 2018 11:09:58 +0200 > Peter Zijlstra wrote: > > FWIW, before text_poke_bp(), text_poke() would only be used from > > stop_machine, so all the other CPUs would be stuck busy-waiting with > > IRQs disabled. These

Re: TLB flushes on fixmap changes

2018-08-27 Thread Peter Zijlstra
On Mon, Aug 27, 2018 at 12:03:05PM +0900, Masami Hiramatsu wrote: > On Sun, 26 Aug 2018 11:09:58 +0200 > Peter Zijlstra wrote: > > FWIW, before text_poke_bp(), text_poke() would only be used from > > stop_machine, so all the other CPUs would be stuck busy-waiting with > > IRQs disabled. These

Re: TLB flushes on fixmap changes

2018-08-27 Thread Masami Hiramatsu
On Sun, 26 Aug 2018 20:26:09 -0700 Nadav Amit wrote: > at 8:03 PM, Masami Hiramatsu wrote: > > > On Sun, 26 Aug 2018 11:09:58 +0200 > > Peter Zijlstra wrote: > > > >> On Sat, Aug 25, 2018 at 09:21:22PM -0700, Andy Lutomirski wrote: > >>> I just re-read text_poke(). It's, um, horrible. Not

Re: TLB flushes on fixmap changes

2018-08-27 Thread Masami Hiramatsu
On Sun, 26 Aug 2018 20:26:09 -0700 Nadav Amit wrote: > at 8:03 PM, Masami Hiramatsu wrote: > > > On Sun, 26 Aug 2018 11:09:58 +0200 > > Peter Zijlstra wrote: > > > >> On Sat, Aug 25, 2018 at 09:21:22PM -0700, Andy Lutomirski wrote: > >>> I just re-read text_poke(). It's, um, horrible. Not

Re: TLB flushes on fixmap changes

2018-08-26 Thread Nadav Amit
at 8:03 PM, Masami Hiramatsu wrote: > On Sun, 26 Aug 2018 11:09:58 +0200 > Peter Zijlstra wrote: > >> On Sat, Aug 25, 2018 at 09:21:22PM -0700, Andy Lutomirski wrote: >>> I just re-read text_poke(). It's, um, horrible. Not only is the >>> implementation overcomplicated and probably buggy,

Re: TLB flushes on fixmap changes

2018-08-26 Thread Nadav Amit
at 8:03 PM, Masami Hiramatsu wrote: > On Sun, 26 Aug 2018 11:09:58 +0200 > Peter Zijlstra wrote: > >> On Sat, Aug 25, 2018 at 09:21:22PM -0700, Andy Lutomirski wrote: >>> I just re-read text_poke(). It's, um, horrible. Not only is the >>> implementation overcomplicated and probably buggy,

Re: TLB flushes on fixmap changes

2018-08-26 Thread Masami Hiramatsu
On Sun, 26 Aug 2018 11:09:58 +0200 Peter Zijlstra wrote: > On Sat, Aug 25, 2018 at 09:21:22PM -0700, Andy Lutomirski wrote: > > I just re-read text_poke(). It's, um, horrible. Not only is the > > implementation overcomplicated and probably buggy, but it's SLOW. > > It's totally the wrong

Re: TLB flushes on fixmap changes

2018-08-26 Thread Masami Hiramatsu
On Sun, 26 Aug 2018 11:09:58 +0200 Peter Zijlstra wrote: > On Sat, Aug 25, 2018 at 09:21:22PM -0700, Andy Lutomirski wrote: > > I just re-read text_poke(). It's, um, horrible. Not only is the > > implementation overcomplicated and probably buggy, but it's SLOW. > > It's totally the wrong

Re: TLB flushes on fixmap changes

2018-08-26 Thread Jann Horn
On Sun, Aug 26, 2018 at 6:21 AM Andy Lutomirski wrote: > > On Sat, Aug 25, 2018 at 7:23 PM, Masami Hiramatsu wrote: > > On Fri, 24 Aug 2018 21:23:26 -0700 > > Andy Lutomirski wrote: > >> Couldn't text_poke() use kmap_atomic()? Or, even better, just change CR3? > > > > No, since kmap_atomic()

Re: TLB flushes on fixmap changes

2018-08-26 Thread Jann Horn
On Sun, Aug 26, 2018 at 6:21 AM Andy Lutomirski wrote: > > On Sat, Aug 25, 2018 at 7:23 PM, Masami Hiramatsu wrote: > > On Fri, 24 Aug 2018 21:23:26 -0700 > > Andy Lutomirski wrote: > >> Couldn't text_poke() use kmap_atomic()? Or, even better, just change CR3? > > > > No, since kmap_atomic()

Re: TLB flushes on fixmap changes

2018-08-26 Thread Jann Horn
On Mon, Aug 27, 2018 at 12:11 AM Kees Cook wrote: > > On Sun, Aug 26, 2018 at 1:15 PM, Thomas Gleixner wrote: > > On Sun, 26 Aug 2018, Andy Lutomirski wrote: > >> > On Aug 26, 2018, at 9:47 AM, Kees Cook wrote: > >> >> On Sun, Aug 26, 2018 at 7:20 AM, Andy Lutomirski > >> >> wrote: > >> >>> I

Re: TLB flushes on fixmap changes

2018-08-26 Thread Jann Horn
On Mon, Aug 27, 2018 at 12:11 AM Kees Cook wrote: > > On Sun, Aug 26, 2018 at 1:15 PM, Thomas Gleixner wrote: > > On Sun, 26 Aug 2018, Andy Lutomirski wrote: > >> > On Aug 26, 2018, at 9:47 AM, Kees Cook wrote: > >> >> On Sun, Aug 26, 2018 at 7:20 AM, Andy Lutomirski > >> >> wrote: > >> >>> I

Re: TLB flushes on fixmap changes

2018-08-26 Thread Matthew Wilcox
On Sun, Aug 26, 2018 at 03:03:59PM -0700, Kees Cook wrote: > I thought the point was that the implementation I suggested was > NMI-proof? (And in reading Documentation/preempt-locking.txt it sounds > like disabling interrupts is redundant to preempt_disable()? But I > don't understand how; it

Re: TLB flushes on fixmap changes

2018-08-26 Thread Matthew Wilcox
On Sun, Aug 26, 2018 at 03:03:59PM -0700, Kees Cook wrote: > I thought the point was that the implementation I suggested was > NMI-proof? (And in reading Documentation/preempt-locking.txt it sounds > like disabling interrupts is redundant to preempt_disable()? But I > don't understand how; it

Re: TLB flushes on fixmap changes

2018-08-26 Thread Kees Cook
On Sun, Aug 26, 2018 at 1:15 PM, Thomas Gleixner wrote: > On Sun, 26 Aug 2018, Andy Lutomirski wrote: >> > On Aug 26, 2018, at 9:47 AM, Kees Cook wrote: >> >> On Sun, Aug 26, 2018 at 7:20 AM, Andy Lutomirski >> >> wrote: >> >>> I tried to convince Ingo to use this method for doing "write

Re: TLB flushes on fixmap changes

2018-08-26 Thread Kees Cook
On Sun, Aug 26, 2018 at 1:15 PM, Thomas Gleixner wrote: > On Sun, 26 Aug 2018, Andy Lutomirski wrote: >> > On Aug 26, 2018, at 9:47 AM, Kees Cook wrote: >> >> On Sun, Aug 26, 2018 at 7:20 AM, Andy Lutomirski >> >> wrote: >> >>> I tried to convince Ingo to use this method for doing "write

Re: TLB flushes on fixmap changes

2018-08-26 Thread Thomas Gleixner
On Sun, 26 Aug 2018, Andy Lutomirski wrote: > > On Aug 26, 2018, at 9:47 AM, Kees Cook wrote: > >> On Sun, Aug 26, 2018 at 7:20 AM, Andy Lutomirski > >> wrote: > >>> I tried to convince Ingo to use this method for doing "write rarely" > >>> and he soundly rejected it. :) I've always liked this

Re: TLB flushes on fixmap changes

2018-08-26 Thread Thomas Gleixner
On Sun, 26 Aug 2018, Andy Lutomirski wrote: > > On Aug 26, 2018, at 9:47 AM, Kees Cook wrote: > >> On Sun, Aug 26, 2018 at 7:20 AM, Andy Lutomirski > >> wrote: > >>> I tried to convince Ingo to use this method for doing "write rarely" > >>> and he soundly rejected it. :) I've always liked this

Re: TLB flushes on fixmap changes

2018-08-26 Thread Andy Lutomirski
> On Aug 26, 2018, at 9:47 AM, Kees Cook wrote: > >> On Sun, Aug 26, 2018 at 7:20 AM, Andy Lutomirski wrote: >> >> On Aug 25, 2018, at 9:43 PM, Kees Cook wrote: > On Sat, Aug 25, 2018 at 9:21 PM, Andy Lutomirski wrote: > On Sat, Aug 25, 2018 at 7:23 PM, Masami

Re: TLB flushes on fixmap changes

2018-08-26 Thread Andy Lutomirski
> On Aug 26, 2018, at 9:47 AM, Kees Cook wrote: > >> On Sun, Aug 26, 2018 at 7:20 AM, Andy Lutomirski wrote: >> >> On Aug 25, 2018, at 9:43 PM, Kees Cook wrote: > On Sat, Aug 25, 2018 at 9:21 PM, Andy Lutomirski wrote: > On Sat, Aug 25, 2018 at 7:23 PM, Masami

Re: TLB flushes on fixmap changes

2018-08-26 Thread Kees Cook
On Sun, Aug 26, 2018 at 7:20 AM, Andy Lutomirski wrote: > > >> On Aug 25, 2018, at 9:43 PM, Kees Cook wrote: >> >>> On Sat, Aug 25, 2018 at 9:21 PM, Andy Lutomirski wrote: On Sat, Aug 25, 2018 at 7:23 PM, Masami Hiramatsu wrote: On Fri, 24 Aug 2018 21:23:26 -0700 Andy

Re: TLB flushes on fixmap changes

2018-08-26 Thread Kees Cook
On Sun, Aug 26, 2018 at 7:20 AM, Andy Lutomirski wrote: > > >> On Aug 25, 2018, at 9:43 PM, Kees Cook wrote: >> >>> On Sat, Aug 25, 2018 at 9:21 PM, Andy Lutomirski wrote: On Sat, Aug 25, 2018 at 7:23 PM, Masami Hiramatsu wrote: On Fri, 24 Aug 2018 21:23:26 -0700 Andy

Re: TLB flushes on fixmap changes

2018-08-26 Thread Andy Lutomirski
> On Aug 25, 2018, at 9:43 PM, Kees Cook wrote: > >> On Sat, Aug 25, 2018 at 9:21 PM, Andy Lutomirski wrote: >>> On Sat, Aug 25, 2018 at 7:23 PM, Masami Hiramatsu >>> wrote: >>> On Fri, 24 Aug 2018 21:23:26 -0700 >>> Andy Lutomirski wrote: Couldn't text_poke() use kmap_atomic()? Or,

Re: TLB flushes on fixmap changes

2018-08-26 Thread Andy Lutomirski
> On Aug 25, 2018, at 9:43 PM, Kees Cook wrote: > >> On Sat, Aug 25, 2018 at 9:21 PM, Andy Lutomirski wrote: >>> On Sat, Aug 25, 2018 at 7:23 PM, Masami Hiramatsu >>> wrote: >>> On Fri, 24 Aug 2018 21:23:26 -0700 >>> Andy Lutomirski wrote: Couldn't text_poke() use kmap_atomic()? Or,

Re: TLB flushes on fixmap changes

2018-08-26 Thread Peter Zijlstra
On Sat, Aug 25, 2018 at 09:21:22PM -0700, Andy Lutomirski wrote: > I just re-read text_poke(). It's, um, horrible. Not only is the > implementation overcomplicated and probably buggy, but it's SLOW. > It's totally the wrong API -- poking one instruction at a time > basically can't be

Re: TLB flushes on fixmap changes

2018-08-26 Thread Peter Zijlstra
On Sat, Aug 25, 2018 at 09:21:22PM -0700, Andy Lutomirski wrote: > I just re-read text_poke(). It's, um, horrible. Not only is the > implementation overcomplicated and probably buggy, but it's SLOW. > It's totally the wrong API -- poking one instruction at a time > basically can't be

Re: TLB flushes on fixmap changes

2018-08-25 Thread Nadav Amit
at 9:43 PM, Kees Cook wrote: > On Sat, Aug 25, 2018 at 9:21 PM, Andy Lutomirski wrote: >> On Sat, Aug 25, 2018 at 7:23 PM, Masami Hiramatsu >> wrote: >>> On Fri, 24 Aug 2018 21:23:26 -0700 >>> Andy Lutomirski wrote: Couldn't text_poke() use kmap_atomic()? Or, even better, just change

Re: TLB flushes on fixmap changes

2018-08-25 Thread Nadav Amit
at 9:43 PM, Kees Cook wrote: > On Sat, Aug 25, 2018 at 9:21 PM, Andy Lutomirski wrote: >> On Sat, Aug 25, 2018 at 7:23 PM, Masami Hiramatsu >> wrote: >>> On Fri, 24 Aug 2018 21:23:26 -0700 >>> Andy Lutomirski wrote: Couldn't text_poke() use kmap_atomic()? Or, even better, just change

Re: TLB flushes on fixmap changes

2018-08-25 Thread Kees Cook
On Sat, Aug 25, 2018 at 9:21 PM, Andy Lutomirski wrote: > On Sat, Aug 25, 2018 at 7:23 PM, Masami Hiramatsu wrote: >> On Fri, 24 Aug 2018 21:23:26 -0700 >> Andy Lutomirski wrote: >>> Couldn't text_poke() use kmap_atomic()? Or, even better, just change CR3? >> >> No, since kmap_atomic() is only

Re: TLB flushes on fixmap changes

2018-08-25 Thread Kees Cook
On Sat, Aug 25, 2018 at 9:21 PM, Andy Lutomirski wrote: > On Sat, Aug 25, 2018 at 7:23 PM, Masami Hiramatsu wrote: >> On Fri, 24 Aug 2018 21:23:26 -0700 >> Andy Lutomirski wrote: >>> Couldn't text_poke() use kmap_atomic()? Or, even better, just change CR3? >> >> No, since kmap_atomic() is only

Re: TLB flushes on fixmap changes

2018-08-25 Thread Andy Lutomirski
On Sat, Aug 25, 2018 at 7:23 PM, Masami Hiramatsu wrote: > On Fri, 24 Aug 2018 21:23:26 -0700 > Andy Lutomirski wrote: >> Couldn't text_poke() use kmap_atomic()? Or, even better, just change CR3? > > No, since kmap_atomic() is only for x86_32 and highmem support kernel. > In x86-64, it seems

Re: TLB flushes on fixmap changes

2018-08-25 Thread Andy Lutomirski
On Sat, Aug 25, 2018 at 7:23 PM, Masami Hiramatsu wrote: > On Fri, 24 Aug 2018 21:23:26 -0700 > Andy Lutomirski wrote: >> Couldn't text_poke() use kmap_atomic()? Or, even better, just change CR3? > > No, since kmap_atomic() is only for x86_32 and highmem support kernel. > In x86-64, it seems

Re: TLB flushes on fixmap changes

2018-08-25 Thread Masami Hiramatsu
On Fri, 24 Aug 2018 21:23:26 -0700 Andy Lutomirski wrote: > On Fri, Aug 24, 2018 at 7:29 PM, wrote: > > > > > > On August 24, 2018 5:58:43 PM PDT, Linus Torvalds > > wrote: > >>Adding a few people to the cc. > >> > >>On Fri, Aug 24, 2018 at 1:24 PM Nadav Amit > >>wrote: > >>> > > >>> > Can

Re: TLB flushes on fixmap changes

2018-08-25 Thread Masami Hiramatsu
On Fri, 24 Aug 2018 21:23:26 -0700 Andy Lutomirski wrote: > On Fri, Aug 24, 2018 at 7:29 PM, wrote: > > > > > > On August 24, 2018 5:58:43 PM PDT, Linus Torvalds > > wrote: > >>Adding a few people to the cc. > >> > >>On Fri, Aug 24, 2018 at 1:24 PM Nadav Amit > >>wrote: > >>> > > >>> > Can

Re: TLB flushes on fixmap changes

2018-08-24 Thread Andy Lutomirski
On Fri, Aug 24, 2018 at 7:29 PM, wrote: > > > On August 24, 2018 5:58:43 PM PDT, Linus Torvalds > wrote: >>Adding a few people to the cc. >> >>On Fri, Aug 24, 2018 at 1:24 PM Nadav Amit >>wrote: >>> > >>> > Can you actually find something that changes the fixmaps after boot >>> > (again,

Re: TLB flushes on fixmap changes

2018-08-24 Thread Andy Lutomirski
On Fri, Aug 24, 2018 at 7:29 PM, wrote: > > > On August 24, 2018 5:58:43 PM PDT, Linus Torvalds > wrote: >>Adding a few people to the cc. >> >>On Fri, Aug 24, 2018 at 1:24 PM Nadav Amit >>wrote: >>> > >>> > Can you actually find something that changes the fixmaps after boot >>> > (again,

Re: TLB flushes on fixmap changes

2018-08-24 Thread nadav . amit
On August 24, 2018 5:58:43 PM PDT, Linus Torvalds wrote: >Adding a few people to the cc. > >On Fri, Aug 24, 2018 at 1:24 PM Nadav Amit >wrote: >> > >> > Can you actually find something that changes the fixmaps after boot >> > (again, ignoring kmap)? >> >> At least the alternatives mechanism

Re: TLB flushes on fixmap changes

2018-08-24 Thread nadav . amit
On August 24, 2018 5:58:43 PM PDT, Linus Torvalds wrote: >Adding a few people to the cc. > >On Fri, Aug 24, 2018 at 1:24 PM Nadav Amit >wrote: >> > >> > Can you actually find something that changes the fixmaps after boot >> > (again, ignoring kmap)? >> >> At least the alternatives mechanism

Re: TLB flushes on fixmap changes

2018-08-24 Thread Linus Torvalds
Adding a few people to the cc. On Fri, Aug 24, 2018 at 1:24 PM Nadav Amit wrote: > > > > Can you actually find something that changes the fixmaps after boot > > (again, ignoring kmap)? > > At least the alternatives mechanism appears to do so. > > IIUC the following path is possible when adding a

Re: TLB flushes on fixmap changes

2018-08-24 Thread Linus Torvalds
Adding a few people to the cc. On Fri, Aug 24, 2018 at 1:24 PM Nadav Amit wrote: > > > > Can you actually find something that changes the fixmaps after boot > > (again, ignoring kmap)? > > At least the alternatives mechanism appears to do so. > > IIUC the following path is possible when adding a

Re: TLB flushes on fixmap changes

2018-08-24 Thread Nadav Amit
at 12:31 PM, Linus Torvalds wrote: > On Fri, Aug 24, 2018 at 11:36 AM Nadav Amit wrote: >>> Urgh.. weren't the fixmaps per cpu? Bah, I remember looking at this >>> during PTI, but I seem to have forgotten everything again. >> >> [ Changed the title. Sorry for hijacking the thread. ] >> >>

Re: TLB flushes on fixmap changes

2018-08-24 Thread Nadav Amit
at 12:31 PM, Linus Torvalds wrote: > On Fri, Aug 24, 2018 at 11:36 AM Nadav Amit wrote: >>> Urgh.. weren't the fixmaps per cpu? Bah, I remember looking at this >>> during PTI, but I seem to have forgotten everything again. >> >> [ Changed the title. Sorry for hijacking the thread. ] >> >>

Re: TLB flushes on fixmap changes

2018-08-24 Thread Linus Torvalds
On Fri, Aug 24, 2018 at 11:36 AM Nadav Amit wrote: > > > > > Urgh.. weren't the fixmaps per cpu? Bah, I remember looking at this > > during PTI, but I seem to have forgotten everything again. > > [ Changed the title. Sorry for hijacking the thread. ] > > Since: > >

Re: TLB flushes on fixmap changes

2018-08-24 Thread Linus Torvalds
On Fri, Aug 24, 2018 at 11:36 AM Nadav Amit wrote: > > > > > Urgh.. weren't the fixmaps per cpu? Bah, I remember looking at this > > during PTI, but I seem to have forgotten everything again. > > [ Changed the title. Sorry for hijacking the thread. ] > > Since: > >

TLB flushes on fixmap changes

2018-08-24 Thread Nadav Amit
at 11:04 AM, Peter Zijlstra wrote: > On Fri, Aug 24, 2018 at 10:26:50AM -0700, Nadav Amit wrote: >> at 1:47 AM, Peter Zijlstra wrote: >> >>> On Thu, Aug 23, 2018 at 02:39:59PM +0100, Will Deacon wrote: The only problem with this approach is that we've lost track of the granule size

TLB flushes on fixmap changes

2018-08-24 Thread Nadav Amit
at 11:04 AM, Peter Zijlstra wrote: > On Fri, Aug 24, 2018 at 10:26:50AM -0700, Nadav Amit wrote: >> at 1:47 AM, Peter Zijlstra wrote: >> >>> On Thu, Aug 23, 2018 at 02:39:59PM +0100, Will Deacon wrote: The only problem with this approach is that we've lost track of the granule size