]> git.itanic.dy.fi Git - linux-stable/commit
x86/mm/cpa: Flush direct map alias during cpa
authorRick Edgecombe <rick.p.edgecombe@intel.com>
Thu, 23 Apr 2020 03:13:55 +0000 (20:13 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 May 2020 15:46:32 +0000 (17:46 +0200)
commitf82a3013226ebc87a8378fd652ec3d297adfbac9
tree31a91bf2840ebb648b8faac96571ceff280d4f15
parent632db044ab99215c8de3a0761c5e844504710305
x86/mm/cpa: Flush direct map alias during cpa

[ Upstream commit ab5130186d7476dcee0d4e787d19a521ca552ce9 ]

As an optimization, cpa_flush() was changed to optionally only flush
the range in @cpa if it was small enough.  However, this range does
not include any direct map aliases changed in cpa_process_alias(). So
small set_memory_() calls that touch that alias don't get the direct
map changes flushed. This situation can happen when the virtual
address taking variants are passed an address in vmalloc or modules
space.

In these cases, force a full TLB flush.

Note this issue does not extend to cases where the set_memory_() calls are
passed a direct map address, or page array, etc, as the primary target. In
those cases the direct map would be flushed.

Fixes: 935f5839827e ("x86/mm/cpa: Optimize cpa_flush_array() TLB invalidation")
Signed-off-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200424105343.GA20730@hirez.programming.kicks-ass.net
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/mm/pageattr.c