* [PATCH] x86/mm, KVM: fix warning when !CONFIG_PREEMPT_COUNT
@ 2017-07-17 9:49 Roman Kagan
0 siblings, 0 replies; only message in thread
From: Roman Kagan @ 2017-07-17 9:49 UTC (permalink / raw)
To: X86 ML, Andy Lutomirski
Cc: Andrew Morton, Arjan van de Ven, Borislav Petkov, Dave Hansen,
Linus Torvalds, Mel Gorman, Michal Hocko, Nadav Amit, Nadav Amit,
Paolo Bonzini, Peter Zijlstra, Radim Krčmář,
Rik van Riel, Thomas Gleixner, kvm, linux-mm, Ingo Molnar
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 <luto@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Borislav Petkov <bpetkov@suse.de>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Nadav Amit <nadav.amit@gmail.com>
Cc: Nadav Amit <namit@vmware.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Radim KrA?mA!A? <rkrcmar@redhat.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: X86 ML <x86@kernel.org>
Cc: kvm@vger.kernel.org
Cc: linux-mm@kvack.org
Cc: Ingo Molnar <mingo@kernel.org>
Fixes: d6e41f1151fe ("x86/mm, KVM: Teach KVM's VMX code that CR3 isn't a constant")
Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
---
arch/x86/include/asm/mmu_context.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/mmu_context.h b/arch/x86/include/asm/mmu_context.h
index ecfcb6643c9b..265c907d7d4c 100644
--- a/arch/x86/include/asm/mmu_context.h
+++ b/arch/x86/include/asm/mmu_context.h
@@ -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;
--
2.13.3
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-07-17 9:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-17 9:49 [PATCH] x86/mm, KVM: fix warning when !CONFIG_PREEMPT_COUNT Roman Kagan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).