Date: Wed, 30 Aug 2017 07:31:25 +0200 From: Juerg Haefliger <juerg.haefliger@...onical.com> To: Mark Rutland <mark.rutland@....com>, Tycho Andersen <tycho@...ker.com> Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org, kernel-hardening@...ts.openwall.com, Marco Benatto <marco.antonio.780@...il.com> Subject: Re: [PATCH v5 04/10] arm64: Add __flush_tlb_one() On 08/23/2017 07:04 PM, Mark Rutland wrote: > On Wed, Aug 23, 2017 at 10:58:42AM -0600, Tycho Andersen wrote: >> Hi Mark, >> >> On Mon, Aug 14, 2017 at 05:50:47PM +0100, Mark Rutland wrote: >>> That said, is there any reason not to use flush_tlb_kernel_range() >>> directly? >> >> So it turns out that there is a difference between __flush_tlb_one() and >> flush_tlb_kernel_range() on x86: flush_tlb_kernel_range() flushes all the TLBs >> via on_each_cpu(), where as __flush_tlb_one() only flushes the local TLB (which >> I think is enough here). > > That sounds suspicious; I don't think that __flush_tlb_one() is > sufficient. > > If you only do local TLB maintenance, then the page is left accessible > to other CPUs via the (stale) kernel mappings. i.e. the page isn't > exclusively mapped by userspace. We flush all CPUs to get rid of stale entries when a new page is allocated to userspace that was previously allocated to the kernel. Is that the scenario you were thinking of? ...Juerg > Thanks, > Mark. > Download attachment "signature.asc" of type "application/pgp-signature" (846 bytes)
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.