xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien@xen.org>
To: "Jan Beulich" <jbeulich@suse.com>, "Jürgen Groß" <jgross@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Ian Jackson <iwj@xenproject.org>,
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v8 3/3] xen/events: do some cleanups in evtchn_fifo_set_pending()
Date: Fri, 27 Nov 2020 15:17:43 +0000	[thread overview]
Message-ID: <7e4f42a5-4ab6-8aac-c8d9-95403c90dc4b@xen.org> (raw)
In-Reply-To: <29c8daf7-8af4-df16-716e-113bcc3e96a1@suse.com>



On 27/11/2020 14:48, Jan Beulich wrote:
> On 27.11.2020 15:39, Jürgen Groß wrote:
>> On 27.11.20 15:23, Julien Grall wrote:
>>> On 25/11/2020 10:51, Juergen Gross wrote:
>>>> --- a/xen/common/event_fifo.c
>>>> +++ b/xen/common/event_fifo.c
>>>> @@ -175,6 +175,18 @@ static void evtchn_fifo_set_pending(struct vcpu
>>>> *v, struct evtchn *evtchn)
>>>>            return;
>>>>        }
>>>> +    /*
>>>> +     * Control block not mapped.  The guest must not unmask an
>>>> +     * event until the control block is initialized, so we can
>>>> +     * just drop the event.
>>>> +     */
>>>> +    if ( unlikely(!v->evtchn_fifo->control_block) )
>>>
>>> Sort of unrelated, AFAICT, v->evtchn_fifo->control_block can be set
>>> concurrently to this access.
>>>
>>> Thankfully, once the control block is mapped, it can't be unmapped.
>>> However, there is still a possibility that you may see half of the update.
>>>
>>> Shouldn't the field access with ACCESS_ONCE()?
>>
>> Shouldn't this be another patch? Especially as the writing side needs
>> the same treatment.
> 
> Indeed. As said on several different occasions - our code base is
> full of places where we chance torn accesses, if there really was
> a compiler to let us down on this.

I am quite amazed you that you managed to test all the version of 
GCC/Clang that were built and confirm this is unlikely to happen :).

> This recurring pattern
> shouldn't lead to unrelated patches getting bloated, unless _all_
> affected sites get touched anyway.

You probably missed the point where I say "sort of unrelated". This 
wasn't not a suggestion to fix it here (I should have been clearer 
though) but instead point out issue as I see them.

Cheers,

-- 
Julien Grall


  reply	other threads:[~2020-11-27 15:18 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-25 10:51 [PATCH v8 0/3] xen/events: further locking adjustments Juergen Gross
2020-11-25 10:51 ` [PATCH v8 1/3] xen/events: modify struct evtchn layout Juergen Gross
2020-11-27 11:42   ` Jan Beulich
2020-11-27 11:57     ` Julien Grall
2020-11-27 12:41       ` Jan Beulich
2020-11-25 10:51 ` [PATCH v8 2/3] xen/events: rework fifo queue locking Juergen Gross
2020-11-27 13:11   ` Jan Beulich
2020-11-27 13:31     ` Jürgen Groß
2020-11-27 13:58   ` Julien Grall
2020-11-27 14:03     ` Jan Beulich
2020-11-27 14:05     ` Jürgen Groß
2020-11-27 14:11       ` Julien Grall
2020-11-27 14:14         ` Jürgen Groß
2020-11-27 14:26           ` Julien Grall
2020-11-25 10:51 ` [PATCH v8 3/3] xen/events: do some cleanups in evtchn_fifo_set_pending() Juergen Gross
2020-11-27 13:27   ` Jan Beulich
2020-11-27 13:52     ` Jürgen Groß
2020-11-27 14:23   ` Julien Grall
2020-11-27 14:39     ` Jürgen Groß
2020-11-27 14:48       ` Jan Beulich
2020-11-27 15:17         ` Julien Grall [this message]
2020-11-27 15:36           ` Jan Beulich
2020-11-27 14:50       ` Julien Grall

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=7e4f42a5-4ab6-8aac-c8d9-95403c90dc4b@xen.org \
    --to=julien@xen.org \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=iwj@xenproject.org \
    --cc=jbeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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;
as well as URLs for NNTP newsgroup(s).