From: tip-bot for Matthew Whitehead <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: konrad.wilk@oracle.com, hpa@zytor.com, tedheadster@gmail.com,
bp@suse.de, linux-kernel@vger.kernel.org, mingo@kernel.org,
luto@amacapital.net, dwmw@amazon.co.uk, peterz@infradead.org,
tglx@linutronix.de
Subject: [tip:x86/cpu] x86/CPU: Change query logic so CPUID is enabled before testing
Date: Sat, 22 Sep 2018 02:58:27 -0700 [thread overview]
Message-ID: <tip-2893cc8ff892fa74972d8dc0e1d0dc65116daaa3@git.kernel.org> (raw)
In-Reply-To: <20180921212041.13096-3-tedheadster@gmail.com>
Commit-ID: 2893cc8ff892fa74972d8dc0e1d0dc65116daaa3
Gitweb: https://git.kernel.org/tip/2893cc8ff892fa74972d8dc0e1d0dc65116daaa3
Author: Matthew Whitehead <tedheadster@gmail.com>
AuthorDate: Fri, 21 Sep 2018 17:20:41 -0400
Committer: Borislav Petkov <bp@suse.de>
CommitDate: Sat, 22 Sep 2018 11:47:39 +0200
x86/CPU: Change query logic so CPUID is enabled before testing
Presently we check first if CPUID is enabled. If it is not already
enabled, then we next call identify_cpu_without_cpuid() and clear
X86_FEATURE_CPUID.
Unfortunately, identify_cpu_without_cpuid() is the function where CPUID
becomes _enabled_ on Cyrix 6x86/6x86L CPUs.
Reverse the calling sequence so that CPUID is first enabled, and then
check a second time to see if the feature has now been activated.
[ bp: Massage commit message and remove trailing whitespace. ]
Suggested-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Matthew Whitehead <tedheadster@gmail.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Andy Lutomirski <luto@amacapital.net>
Cc: David Woodhouse <dwmw@amazon.co.uk>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20180921212041.13096-3-tedheadster@gmail.com
---
arch/x86/kernel/cpu/common.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 44c4ef3d989b..658c85d16a9b 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -1076,6 +1076,9 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
memset(&c->x86_capability, 0, sizeof c->x86_capability);
c->extended_cpuid_level = 0;
+ if (!have_cpuid_p())
+ identify_cpu_without_cpuid(c);
+
/* cyrix could have cpuid enabled via c_identify()*/
if (have_cpuid_p()) {
cpu_detect(c);
@@ -1093,7 +1096,6 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
if (this_cpu->c_bsp_init)
this_cpu->c_bsp_init(c);
} else {
- identify_cpu_without_cpuid(c);
setup_clear_cpu_cap(X86_FEATURE_CPUID);
}
prev parent reply other threads:[~2018-09-22 9:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-21 21:20 [PATCH v2 0/2] x86/cpu: Enable cpuid on Cyrix 6x86/6x86L processors Matthew Whitehead
2018-09-21 21:20 ` [PATCH v2 1/2] x86/cpu: Use correct macros for Cyrix calls Matthew Whitehead
2018-09-22 9:57 ` [tip:x86/cpu] x86/CPU: " tip-bot for Matthew Whitehead
2018-09-21 21:20 ` [PATCH v2 2/2] x86/cpu: Change query logic so cpuid is enabled before testing Matthew Whitehead
2018-09-21 21:54 ` Andy Lutomirski
2018-09-22 9:58 ` tip-bot for Matthew Whitehead [this message]
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-2893cc8ff892fa74972d8dc0e1d0dc65116daaa3@git.kernel.org \
--to=tipbot@zytor.com \
--cc=bp@suse.de \
--cc=dwmw@amazon.co.uk \
--cc=hpa@zytor.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tedheadster@gmail.com \
--cc=tglx@linutronix.de \
/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).