From: tip-bot for Andy Lutomirski <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, jpoimboe@redhat.com,
peterz@infradead.org, tglx@linutronix.de,
torvalds@linux-foundation.org, bp@suse.de, dvlasenk@redhat.com,
brgerst@gmail.com, hpa@zytor.com, bp@alien8.de, mingo@kernel.org,
luto@kernel.org
Subject: [tip:x86/urgent] x86/init: Fix cr4_init_shadow() on CR4-less machines
Date: Thu, 29 Sep 2016 11:21:42 -0700 [thread overview]
Message-ID: <tip-e1bfc11c5a6f40222a698a818dc269113245820e@git.kernel.org> (raw)
In-Reply-To: <43a20f81fb504013bf613913dc25574b45336a61.1475091074.git.luto@kernel.org>
Commit-ID: e1bfc11c5a6f40222a698a818dc269113245820e
Gitweb: http://git.kernel.org/tip/e1bfc11c5a6f40222a698a818dc269113245820e
Author: Andy Lutomirski <luto@kernel.org>
AuthorDate: Wed, 28 Sep 2016 12:34:14 -0700
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 29 Sep 2016 19:08:30 +0200
x86/init: Fix cr4_init_shadow() on CR4-less machines
cr4_init_shadow() will panic on 486-like machines without CR4. Fix
it using __read_cr4_safe().
Reported-by: david@saggiorato.net
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Reviewed-by: Borislav Petkov <bp@suse.de>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Fixes: 1e02ce4cccdc ("x86: Store a per-cpu shadow copy of CR4")
Link: http://lkml.kernel.org/r/43a20f81fb504013bf613913dc25574b45336a61.1475091074.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/include/asm/tlbflush.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86/include/asm/tlbflush.h
index 6fa8594..dee8a70 100644
--- a/arch/x86/include/asm/tlbflush.h
+++ b/arch/x86/include/asm/tlbflush.h
@@ -81,7 +81,7 @@ DECLARE_PER_CPU_SHARED_ALIGNED(struct tlb_state, cpu_tlbstate);
/* Initialize cr4 shadow for this CPU. */
static inline void cr4_init_shadow(void)
{
- this_cpu_write(cpu_tlbstate.cr4, __read_cr4());
+ this_cpu_write(cpu_tlbstate.cr4, __read_cr4_safe());
}
/* Set in this cpu's CR4. */
next prev parent reply other threads:[~2016-09-29 18:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-28 19:34 [PATCH 0/3] CR4 fixes (some are urgent) Andy Lutomirski
2016-09-28 19:34 ` [PATCH 1/3] x86/init: Fix cr4_init_shadow() on CR4-less machines Andy Lutomirski
2016-09-29 11:44 ` Borislav Petkov
2016-09-29 18:21 ` tip-bot for Andy Lutomirski [this message]
2016-09-28 19:34 ` [PATCH 2/3] x86/boot: Fix another __read_cr4() case on 486 Andy Lutomirski
2016-09-29 11:48 ` Borislav Petkov
2016-09-29 19:09 ` Andy Lutomirski
2016-09-28 19:34 ` [PATCH 3/3] x86/asm: Get rid of __read_cr4_safe() Andy Lutomirski
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=tip-e1bfc11c5a6f40222a698a818dc269113245820e@git.kernel.org \
--to=tipbot@zytor.com \
--cc=bp@alien8.de \
--cc=bp@suse.de \
--cc=brgerst@gmail.com \
--cc=dvlasenk@redhat.com \
--cc=hpa@zytor.com \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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
Powered by JetHome