From: Bruce Cran <bruce@cran.org.uk>
To: "fio@vger.kernel.org" <fio@vger.kernel.org>
Subject: Bug in x86_64 do_cpuid()
Date: Wed, 30 Oct 2013 14:00:36 +0000 [thread overview]
Message-ID: <52711104.3020604@cran.org.uk> (raw)
It seems there's a bug in the x86_64 version of do_cpuid() that causes
fio to segfault when built with clang at lower optimization levels:
static inline void do_cpuid(unsigned int *eax, unsigned int *ebx,
unsigned int *ecx, unsigned int *edx)
{
asm volatile("cpuid"
: "=a" (*eax), "=b" (*ebx), "=r" (*ecx), "=d" (*edx)
: "0" (*eax), "2" (*ecx)
: "memory");
}
via Tijl Coosemans:
Should be: "=c" (*ecx)
But you can also use the '+' modifier and remove the input operands:
: "+a" (*eax), "=b" (*ebx), "+c" (*ecx), "=d" (*edx)
:
: "memory"
--
Bruce Cran
next reply other threads:[~2013-10-30 14:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-30 14:00 Bruce Cran [this message]
2013-10-31 16:55 ` Bug in x86_64 do_cpuid() Jens Axboe
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=52711104.3020604@cran.org.uk \
--to=bruce@cran.org.uk \
--cc=fio@vger.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