From: Josh Triplett <josh@joshtriplett.org>
To: linux-kernel@vger.kernel.org, x86@kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH] x86: Simplify calls to cpuid by using + for in/out constraints
Date: Sat, 8 Aug 2009 13:21:13 -0700 [thread overview]
Message-ID: <20090808202113.GA21962@feather> (raw)
Signed-off-by: Josh Triplett <josh@joshtriplett.org>
---
Build-tested only.
arch/x86/include/asm/processor.h | 7 +++----
arch/x86/xen/enlighten.c | 7 +++----
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index c776826..dfa947e 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -180,11 +180,10 @@ static inline void native_cpuid(unsigned int *eax, unsigned int *ebx,
{
/* ecx is often an input as well as an output. */
asm("cpuid"
- : "=a" (*eax),
+ : "+a" (*eax),
"=b" (*ebx),
- "=c" (*ecx),
- "=d" (*edx)
- : "0" (*eax), "2" (*ecx));
+ "+c" (*ecx),
+ "=d" (*edx));
}
static inline void load_cr3(pgd_t *pgdir)
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 6ee2ef8..6eab164 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -190,11 +190,10 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx,
}
asm(XEN_EMULATE_PREFIX "cpuid"
- : "=a" (*ax),
+ : "+a" (*ax),
"=b" (*bx),
- "=c" (*cx),
- "=d" (*dx)
- : "0" (*ax), "2" (*cx));
+ "+c" (*cx),
+ "=d" (*dx));
*cx &= maskecx;
*dx &= maskedx;
--
1.5.6.5
next reply other threads:[~2009-08-08 20:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-08 20:21 Josh Triplett [this message]
2009-08-09 17:19 ` [PATCH] x86: Simplify calls to cpuid by using + for in/out constraints H. Peter Anvin
2009-08-09 18:34 ` Josh Triplett
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=20090808202113.GA21962@feather \
--to=josh@joshtriplett.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.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