All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Julien Grall <julien.grall@arm.com>,
	Kevin Tian <kevin.tian@intel.com>,
	Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH for-4.10] passthrough/vtd: Don't DMA to the stack in queue_invalidate_wait()
Date: Thu, 19 Oct 2017 07:25:14 -0600	[thread overview]
Message-ID: <59E8C3DA0200007800188265@prv-mh.provo.novell.com> (raw)
In-Reply-To: <9dddb2ba-bc51-b1a7-ab7c-0f91a3d89966@citrix.com>

>>> On 19.10.17 at 14:54, <andrew.cooper3@citrix.com> wrote:
> On 19/10/17 13:11, Jan Beulich wrote:
>>>>> On 19.10.17 at 13:26, <andrew.cooper3@citrix.com> wrote:
>>> --- a/xen/drivers/passthrough/vtd/qinval.c
>>> +++ b/xen/drivers/passthrough/vtd/qinval.c
>>> @@ -147,7 +147,8 @@ static int __must_check queue_invalidate_wait(struct iommu *iommu,
>>>                                                u8 iflag, u8 sw, u8 fn,
>>>                                                bool_t flush_dev_iotlb)
>>>  {
>>> -    volatile u32 poll_slot = QINVAL_STAT_INIT;
>> You've lost the initializer.
> 
> Deliberately so.

I don't understand: By never writing QINVAL_STAT_INIT, how can
multiple waits work? Afaict you'll find the variable set to
QINVAL_STAT_DONE the 2nd time you come here, and hence you
won't wait at all.

>>> +    static DEFINE_PER_CPU(u32, poll_slot);
>> volatile u32
> 
> You've clipped out the bit declaring the pointer as volatile, which
> suffices to retain the previous properties.

Still the variable itself would better also be declared volatile.

>> Or alternatively isn't it high time for the
>> interrupt approach to be made work (perhaps not by you, but rather
>> by Intel folks)?
> 
> I'm not going to pretend that the current implementation is great, but I
> really don't have time to address the other remaining swamps here.

Right, hence my hint at this really being something the maintainer(s)
should look after.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-10-19 13:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-19 11:26 [PATCH for-4.10] passthrough/vtd: Don't DMA to the stack in queue_invalidate_wait() Andrew Cooper
2017-10-19 12:11 ` Jan Beulich
2017-10-19 12:54   ` Andrew Cooper
2017-10-19 13:25     ` Jan Beulich [this message]
2017-10-19 13:31       ` Andrew Cooper
2017-10-19 16:22 ` [PATCH for-4.10 v2] " Andrew Cooper
2017-10-20  7:12   ` Jan Beulich
2017-10-20 17:55     ` Andrew Cooper
2017-10-23  7:05       ` Tian, Kevin
     [not found]       ` <AADFC41AFE54684AB9EE6CBC0274A5D190E3101C@SHSMSX101.ccr.corp.intel.com>
2017-10-23  7:06         ` Tian, Kevin
2017-10-23  7:18       ` Jan Beulich
2017-10-23  8:06         ` Andrew Cooper

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=59E8C3DA0200007800188265@prv-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=julien.grall@arm.com \
    --cc=kevin.tian@intel.com \
    --cc=xen-devel@lists.xen.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 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.