qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	qemu-s390x@nongnu.org, qemu-devel@nongnu.org
Cc: Peter Crosthwaite <crosthwaite.peter@gmail.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Cornelia Huck <cohuck@redhat.com>,
	Richard Henderson <rth@twiddle.net>,
	Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] [PATCH v1] cpu-exec: fix missed CPU kick during interrupt injection
Date: Mon, 11 Dec 2017 17:49:45 +0100	[thread overview]
Message-ID: <a05893de-ce48-a797-1a12-8acb18419887@redhat.com> (raw)
In-Reply-To: <f8e11154-00a7-745d-451b-38a3c6f42b6f@redhat.com>


> atomic_mb_set can be a little faster on x86, so:
> 
> diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
> index dfba5ebd29..4452cd9856 100644
> --- a/accel/tcg/cpu-exec.c
> +++ b/accel/tcg/cpu-exec.c
> @@ -528,12 +528,10 @@ static inline bool cpu_handle_interrupt(CPUState *cpu,
>  
>      /* Clear the interrupt flag now since we're processing
>       * cpu->interrupt_request and cpu->exit_request.
> +     * Ensure zeroing happens before reading cpu->exit_request or
> +     * cpu->interrupt_request (see also smp_wmb in cpu_exit())
>       */
> -    atomic_set(&cpu->icount_decr.u16.high, 0);
> -    /* Ensure zeroing happens before reading cpu->exit_request or
> -     * cpu->interrupt_request. (also see cpu_exit())
> -     */
> -    smp_mb();
> +    atomic_mb_set(&cpu->icount_decr.u16.high, 0);
>  
>      if (unlikely(atomic_read(&cpu->interrupt_request))) {
>          int interrupt_request;
> 

Looks good to me! Thanks!


-- 

Thanks,

David / dhildenb

      reply	other threads:[~2017-12-11 16:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-29 19:13 [Qemu-devel] [PATCH v1] cpu-exec: fix missed CPU kick during interrupt injection David Hildenbrand
2017-12-11 16:29 ` Paolo Bonzini
2017-12-11 16:49   ` David Hildenbrand [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=a05893de-ce48-a797-1a12-8acb18419887@redhat.com \
    --to=david@redhat.com \
    --cc=agraf@suse.de \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=crosthwaite.peter@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=rth@twiddle.net \
    /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).