From: Roman Kagan <rkagan@virtuozzo.com>
To: X86 ML <x86@kernel.org>, Andy Lutomirski <luto@kernel.org>
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
"Arjan van de Ven" <arjan@linux.intel.com>,
"Borislav Petkov" <bpetkov@suse.de>,
"Dave Hansen" <dave.hansen@intel.com>,
"Linus Torvalds" <torvalds@linux-foundation.org>,
"Mel Gorman" <mgorman@suse.de>, "Michal Hocko" <mhocko@suse.com>,
"Nadav Amit" <nadav.amit@gmail.com>,
"Nadav Amit" <namit@vmware.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Peter Zijlstra" <peterz@infradead.org>,
"Radim Krčmář" <rkrcmar@redhat.com>,
"Rik van Riel" <riel@redhat.com>,
"Thomas Gleixner" <tglx@linutronix.de>,
kvm@vger.kernel.org, linux-mm@kvack.org,
"Ingo Molnar" <mingo@kernel.org>
Subject: [PATCH] x86/mm, KVM: fix warning when !CONFIG_PREEMPT_COUNT
Date: Mon, 17 Jul 2017 12:49:07 +0300 [thread overview]
Message-ID: <20170717094907.6089-1-rkagan@virtuozzo.com> (raw)
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>
reply other threads:[~2017-07-17 9:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170717094907.6089-1-rkagan@virtuozzo.com \
--to=rkagan@virtuozzo.com \
--cc=akpm@linux-foundation.org \
--cc=arjan@linux.intel.com \
--cc=bpetkov@suse.de \
--cc=dave.hansen@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=luto@kernel.org \
--cc=mgorman@suse.de \
--cc=mhocko@suse.com \
--cc=mingo@kernel.org \
--cc=nadav.amit@gmail.com \
--cc=namit@vmware.com \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=riel@redhat.com \
--cc=rkrcmar@redhat.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).