diff options
author | Roman Kagan <rkagan@virtuozzo.com> | 2017-07-17 05:49:07 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-07-18 04:49:18 -0400 |
commit | 4c07f9046e48c3126978911239e20a5622ad0ad6 (patch) | |
tree | 6614f5e86d8587101cbe733a8c40238efa275fdd | |
parent | dfc1ed1caef09e6be147f9e8d72631e788ffefd9 (diff) |
x86/mm, KVM: Fix warning when !CONFIG_PREEMPT_COUNT
A 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.
Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@kernel.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 Krčmář <rkrcmar@redhat.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: kvm@vger.kernel.org
Cc: linux-mm@kvack.org
Fixes: d6e41f1151fe ("x86/mm, KVM: Teach KVM's VMX code that CR3 isn't a constant")
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | arch/x86/include/asm/mmu_context.h | 2 |
1 files changed, 1 insertions, 1 deletions
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) | |||
293 | unsigned long cr3 = __pa(this_cpu_read(cpu_tlbstate.loaded_mm)->pgd); | 293 | unsigned long cr3 = __pa(this_cpu_read(cpu_tlbstate.loaded_mm)->pgd); |
294 | 294 | ||
295 | /* For now, be very restrictive about when this can be called. */ | 295 | /* For now, be very restrictive about when this can be called. */ |
296 | VM_WARN_ON(in_nmi() || !in_atomic()); | 296 | VM_WARN_ON(in_nmi() || preemptible()); |
297 | 297 | ||
298 | VM_BUG_ON(cr3 != __read_cr3()); | 298 | VM_BUG_ON(cr3 != __read_cr3()); |
299 | return cr3; | 299 | return cr3; |