]> git.baikalelectronics.ru Git - kernel.git/commit
x86/mm/cpa: Add sanity check for existing mappings
authorThomas Gleixner <tglx@linutronix.de>
Mon, 17 Sep 2018 14:29:14 +0000 (16:29 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 27 Sep 2018 18:39:39 +0000 (20:39 +0200)
commit4f5389728d8c2beea34ed763d6305f68b91cab65
treec37d356a5996651e51cc648db4b84293e45eb4d4
parent520be4c7308bb6241058b85c831894fc707d4bd3
x86/mm/cpa: Add sanity check for existing mappings

With the range check it is possible to do a quick verification that the
current mapping is correct vs. the static protection areas.

In case a incorrect mapping is detected a warning is emitted and the large
page is split up. If the large page is a 2M page, then the split code is
forced to check the static protections for the PTE entries to fix up the
incorrectness. For 1G pages this can't be done easily because that would
require to either find the offending 2M areas before the split or
afterwards. For now just warn about that case and revisit it when reported.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Dave Hansen <dave.hansen@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Bin Yang <bin.yang@intel.com>
Cc: Mark Gross <mark.gross@intel.com>
Link: https://lkml.kernel.org/r/20180917143546.331408643@linutronix.de
arch/x86/mm/pageattr.c