From: Paolo Bonzini <pbonzini@redhat.com>
To: Chris J Arges <chris.j.arges@canonical.com>, kvm@vger.kernel.org
Cc: namit@cs.technion.ac.il
Subject: Re: [kvm-unit-tests PATCH v2] x86: emulator: Fix h_mem usage in tests_smsw
Date: Wed, 03 Dec 2014 16:46:12 +0100 [thread overview]
Message-ID: <547F3044.3090609@redhat.com> (raw)
In-Reply-To: <1417621455-22031-1-git-send-email-chris.j.arges@canonical.com>
On 03/12/2014 16:44, Chris J Arges wrote:
> In emulator.c/tests_smsw, smsw (3) fails because h_mem isn't being set correctly
> before smsw is called. By using the + constraint modifier for memory we can
> ensure the compiler no longer optimizes out the assignment before smsw.
>
> Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
> ---
> x86/emulator.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/x86/emulator.c b/x86/emulator.c
> index 5aa4dbf..1e05574 100644
> --- a/x86/emulator.c
> +++ b/x86/emulator.c
> @@ -359,7 +359,7 @@ void test_smsw(uint64_t *h_mem)
>
> /* Trigger exit on smsw */
> *h_mem = 0x12345678abcdeful;
> - asm volatile("smsw %0" : "=m"(*h_mem));
> + asm volatile("smsw %0" : "+m"(*h_mem));
> report("smsw (3)", msw == (unsigned short)*h_mem &&
> (*h_mem & ~0xfffful) == 0x12345678ab0000ul);
> }
>
Applied, thanks.
Paolo
prev parent reply other threads:[~2014-12-03 15:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-02 22:22 [kvm-unit-tests PATCH] x86: emulator: Fix h_mem usage in tests_smsw Chris J Arges
2014-12-03 9:15 ` Paolo Bonzini
2014-12-03 15:44 ` [kvm-unit-tests PATCH v2] " Chris J Arges
2014-12-03 15:46 ` Paolo Bonzini [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=547F3044.3090609@redhat.com \
--to=pbonzini@redhat.com \
--cc=chris.j.arges@canonical.com \
--cc=kvm@vger.kernel.org \
--cc=namit@cs.technion.ac.il \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.