x86/mm, KVM: fix warning when !CONFIG_PREEMPT_COUNT
Subsystems (3)
PATCH 1/1 x86/mm, KVM: fix warning when !CONFIG_PREEMPT_COUNT
Recent commit d6e41f1151fe ("x86/mm, KVM: Teach KVM's VMX code that CR3 isn't a constant") introduced a VM_WARN_ON(!in_atomic()) which generates false positives on every vm entry on !CONFIG_PREEMPT_COUNT kernels.
Replace it with a test for preemptible(), which appears to match the original intent and works across different CONFIG_PREEMPT* variations.
Cc Andy Lutomirski <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Arjan van de Ven <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Dave Hansen <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Mel Gorman <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Nadav Amit <[email protected]>
Cc Nadav Amit <[email protected]>
Cc Paolo Bonzini <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Radim Krčmář <[email protected]>
Cc Rik van Riel <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc X86 ML <[email protected]>
Cc Ingo Molnar <[email protected]>
Fixes d6e41f1151fe ("x86/mm, KVM: Teach KVM's VMX code that CR3 isn't a constant")
Signed-off-by Roman Kagan <[email protected]>
--- arch/x86/include/asm/mmu_context.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/include/asm/mmu_context.h +1 -1
@@ -293,7 +293,7 @@ static inline unsigned long __get_current_cr3_fast(void)unsigned long cr3 =__pa (this_cpu_read (cpu_tlbstate.loaded_mm)->pgd);/* For now, be very restrictive about when this can be called. */ -VM_WARN_ON (in_nmi () || !in_atomic ()); +VM_WARN_ON (in_nmi () ||preemptible ());VM_BUG_ON (cr3 !=__read_cr3 ());return cr3;
Signature · 7 lines
2.13.3 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>