From: tip-bot for Matthew Whitehead <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: qianyue.zj@alibaba-inc.com, mingo@kernel.org, tglx@linutronix.de,
luto@amacapital.net, hpa@zytor.com, linux-kernel@vger.kernel.org,
gregkh@linuxfoundation.org, bp@suse.de, pombredanne@nexb.com,
peterz@infradead.org, tedheadster@gmail.com
Subject: [tip:x86/cpu] x86/CPU: Use correct macros for Cyrix calls
Date: Sat, 22 Sep 2018 02:57:52 -0700 [thread overview]
Message-ID: <tip-03b099bdcdf7125d4a63dc9ddeefdd454e05123d@git.kernel.org> (raw)
In-Reply-To: <20180921212041.13096-2-tedheadster@gmail.com>
Commit-ID: 03b099bdcdf7125d4a63dc9ddeefdd454e05123d
Gitweb: https://git.kernel.org/tip/03b099bdcdf7125d4a63dc9ddeefdd454e05123d
Author: Matthew Whitehead <tedheadster@gmail.com>
AuthorDate: Fri, 21 Sep 2018 17:20:40 -0400
Committer: Borislav Petkov <bp@suse.de>
CommitDate: Sat, 22 Sep 2018 11:46:56 +0200
x86/CPU: Use correct macros for Cyrix calls
There are comments in processor-cyrix.h advising you to _not_ make calls
using the deprecated macros in this style:
setCx86_old(CX86_CCR4, getCx86_old(CX86_CCR4) | 0x80);
This is because it expands the macro into a non-functioning calling
sequence. The calling order must be:
outb(CX86_CCR2, 0x22);
inb(0x23);
From the comments:
* When using the old macros a line like
* setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x88);
* gets expanded to:
* do {
* outb((CX86_CCR2), 0x22);
* outb((({
* outb((CX86_CCR2), 0x22);
* inb(0x23);
* }) | 0x88), 0x23);
* } while (0);
The new macros fix this problem, so use them instead.
Signed-off-by: Matthew Whitehead <tedheadster@gmail.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Andy Lutomirski <luto@amacapital.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jia Zhang <qianyue.zj@alibaba-inc.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20180921212041.13096-2-tedheadster@gmail.com
---
arch/x86/kernel/cpu/cyrix.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/cyrix.c b/arch/x86/kernel/cpu/cyrix.c
index 8949b7ae6d92..d12226f60168 100644
--- a/arch/x86/kernel/cpu/cyrix.c
+++ b/arch/x86/kernel/cpu/cyrix.c
@@ -437,7 +437,7 @@ static void cyrix_identify(struct cpuinfo_x86 *c)
/* enable MAPEN */
setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10);
/* enable cpuid */
- setCx86_old(CX86_CCR4, getCx86_old(CX86_CCR4) | 0x80);
+ setCx86(CX86_CCR4, getCx86(CX86_CCR4) | 0x80);
/* disable MAPEN */
setCx86(CX86_CCR3, ccr3);
local_irq_restore(flags);
next 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-bot for Matthew Whitehead [this message]
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:x86/cpu] x86/CPU: Change query logic so CPUID " tip-bot for Matthew Whitehead
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-03b099bdcdf7125d4a63dc9ddeefdd454e05123d@git.kernel.org \
--to=tipbot@zytor.com \
--cc=bp@suse.de \
--cc=gregkh@linuxfoundation.org \
--cc=hpa@zytor.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=pombredanne@nexb.com \
--cc=qianyue.zj@alibaba-inc.com \
--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).