[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1470407913.13905.66.camel@redhat.com>
Date: Fri, 05 Aug 2016 10:38:33 -0400
From: Rik van Riel <riel@...hat.com>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Cc: x86@...nel.org, Borislav Petkov <bp@...e.de>,
Andy Lutomirski <luto@...nel.org>,
Mel Gorman <mgorman@...e.de>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>
Subject: Re: [PATCH] x86/mm: disable preemption during CR3 read+write
On Fri, 2016-08-05 at 15:37 +0200, Sebastian Andrzej Siewior wrote:
>
> +++ b/arch/x86/include/asm/tlbflush.h
> @@ -135,7 +135,14 @@ static inline void
> cr4_set_bits_and_update_boot(unsigned long mask)
>
> static inline void __native_flush_tlb(void)
> {
> + /*
> + * if current->mm == NULL then we borrow a mm which may
> change during a
> + * task switch and therefore we must not be preempted while
> we write CR3
> + * back.
> + */
> + preempt_disable();
> native_write_cr3(native_read_cr3());
> + preempt_enable();
> }
That is one subtle race!
Acked-by: Rik van Riel <riel@...hat.com>
--
All Rights Reversed.
Download attachment "signature.asc" of type "application/pgp-signature" (474 bytes)
Powered by blists - more mailing lists