Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1713150

Re: [PATCH 3/3] x86/efi: Use efi_switch_mm() rather than manually twiddling with cr3

From Mark Rutland <mark.rutland@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH 3/3] x86/efi: Use efi_switch_mm() rather than manually twiddling with cr3
Date 2017-08-16 19:20 +0200
Message-ID <ufa95-1so-41@gated-at.bofh.it> (permalink)
References (4 earlier) <uf3hg-5r5-13@gated-at.bofh.it> <uf3qW-5Jr-9@gated-at.bofh.it> <uf4n0-6hS-31@gated-at.bofh.it> <uf65s-7ah-23@gated-at.bofh.it> <uf9cZ-Pi-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Aug 16, 2017 at 09:14:41AM -0700, Andy Lutomirski wrote:
> On Wed, Aug 16, 2017 at 5:57 AM, Matt Fleming <matt@codeblueprint.co.uk> wrote:
> > On Wed, 16 Aug, at 12:03:22PM, Mark Rutland wrote:
> >>
> >> I'd expect we'd abort at a higher level, not taking any sample. i.e.
> >> we'd have the core overflow handler check in_funny_mm(), and if so, skip
> >> the sample, as with the skid case.
> >
> > FYI, this is my preferred solution for x86 too.
> 
> One option for the "funny mm" flag would be literally the condition
> current->mm != current->active_mm.  I *think* this gets all the cases
> right as long as efi_switch_mm is careful with its ordering and that
> the arch switch_mm() code can handle the resulting ordering.  (x86's
> can now, I think, or at least will be able to in 4.14 -- not sure
> about other arches).

For arm64 we'd have to rework things a bit to get the ordering right
(especially when we flip to/from the idmap), but otherwise this sounds sane to
me.

> That being said, there's a totally different solution: run EFI
> callbacks in a kernel thread.  This has other benefits: we could run
> those callbacks in user mode some day, and doing *that* in a user
> thread seems like a mistake.

I think that wouldn't work for CPU-bound perf events (which are not
ctx-switched with the task).

It might be desireable to do that anyway, though.

Thanks,
Mark.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 3/3] x86/efi: Use efi_switch_mm() rather than manually twiddling with cr3 Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com> - 2017-08-15 21:30 +0200
  Re: [PATCH 3/3] x86/efi: Use efi_switch_mm() rather than manually  twiddling with cr3 Andy Lutomirski <luto@kernel.org> - 2017-08-15 23:50 +0200
    Re: [PATCH 3/3] x86/efi: Use efi_switch_mm() rather than manually  twiddling with cr3 Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com> - 2017-08-16 02:30 +0200
      Re: [PATCH 3/3] x86/efi: Use efi_switch_mm() rather than manually  twiddling with cr3 Andy Lutomirski <luto@kernel.org> - 2017-08-16 02:50 +0200
    Re: [PATCH 3/3] x86/efi: Use efi_switch_mm() rather than manually  twiddling with cr3 Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2017-08-16 11:40 +0200
      Re: [PATCH 3/3] x86/efi: Use efi_switch_mm() rather than manually  twiddling with cr3 Mark Rutland <mark.rutland@arm.com> - 2017-08-16 12:00 +0200
        Re: [PATCH 3/3] x86/efi: Use efi_switch_mm() rather than manually  twiddling with cr3 Will Deacon <will.deacon@arm.com> - 2017-08-16 12:10 +0200
          Re: [PATCH 3/3] x86/efi: Use efi_switch_mm() rather than manually  twiddling with cr3 Mark Rutland <mark.rutland@arm.com> - 2017-08-16 13:10 +0200
            Re: [PATCH 3/3] x86/efi: Use efi_switch_mm() rather than manually  twiddling with cr3 Matt Fleming <matt@codeblueprint.co.uk> - 2017-08-16 15:00 +0200
              Re: [PATCH 3/3] x86/efi: Use efi_switch_mm() rather than manually  twiddling with cr3 Andy Lutomirski <luto@kernel.org> - 2017-08-16 18:20 +0200
                Re: [PATCH 3/3] x86/efi: Use efi_switch_mm() rather than manually  twiddling with cr3 Mark Rutland <mark.rutland@arm.com> - 2017-08-16 19:20 +0200
                Re: [PATCH 3/3] x86/efi: Use efi_switch_mm() rather than manually  twiddling with cr3 Will Deacon <will.deacon@arm.com> - 2017-08-17 12:40 +0200
                Re: [PATCH 3/3] x86/efi: Use efi_switch_mm() rather than manually  twiddling with cr3 Andy Lutomirski <luto@kernel.org> - 2017-08-17 18:00 +0200
                Re: [PATCH 3/3] x86/efi: Use efi_switch_mm() rather than manually  twiddling with cr3 Peter Zijlstra <peterz@infradead.org> - 2017-08-21 12:40 +0200
                Re: [PATCH 3/3] x86/efi: Use efi_switch_mm() rather than manually twiddling with cr3 Andy Lutomirski <luto@amacapital.net> - 2017-08-21 16:00 +0200
                Re: [PATCH 3/3] x86/efi: Use efi_switch_mm() rather than manually  twiddling with cr3 Peter Zijlstra <peterz@infradead.org> - 2017-08-21 16:20 +0200
                Re: [PATCH 3/3] x86/efi: Use efi_switch_mm() rather than manually twiddling with cr3 Andy Lutomirski <luto@amacapital.net> - 2017-08-21 17:30 +0200
                Re: [PATCH 3/3] x86/efi: Use efi_switch_mm() rather than manually  twiddling with cr3 Peter Zijlstra <peterz@infradead.org> - 2017-08-21 18:00 +0200
                Re: [PATCH 3/3] x86/efi: Use efi_switch_mm() rather than manually  twiddling with cr3 Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2017-08-21 18:10 +0200
                Re: [PATCH 3/3] x86/efi: Use efi_switch_mm() rather than manually  twiddling with cr3 Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com> - 2017-08-24 01:00 +0200
                Re: [PATCH 3/3] x86/efi: Use efi_switch_mm() rather than manually  twiddling with cr3 Peter Zijlstra <peterz@infradead.org> - 2017-08-21 19:30 +0200
    Re: [PATCH 3/3] x86/efi: Use efi_switch_mm() rather than manually  twiddling with cr3 Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com> - 2017-08-25 04:50 +0200

csiph-web