xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: paul@xen.org, 'David Woodhouse' <dwmw2@infradead.org>,
	'Paul Durrant' <paul.durrant@citrix.com>,
	xen-devel@lists.xenproject.org,
	'Eslam Elnikety' <elnikety@amazon.de>,
	'Andrew Cooper' <andrew.cooper3@citrix.com>,
	'Shan Haitao' <haitao.shan@intel.com>
Subject: Re: [Xen-devel] [PATCH v2] x86/hvm: re-work viridian APIC assist code
Date: Wed, 19 Aug 2020 09:12:02 +0200	[thread overview]
Message-ID: <f2aa0cd1-61c9-c788-56fb-b2546feed74b@suse.com> (raw)
In-Reply-To: <20200813094555.GF975@Air-de-Roger>

On 13.08.2020 11:45, Roger Pau Monné wrote:
> On Thu, Aug 13, 2020 at 09:10:31AM +0100, Paul Durrant wrote:
>>> -----Original Message-----
>>> From: Xen-devel <xen-devel-bounces@lists.xenproject.org> On Behalf Of David Woodhouse
>>> Sent: 11 August 2020 14:25
>>> To: Paul Durrant <paul.durrant@citrix.com>; xen-devel@lists.xenproject.org; Roger Pau Monne
>>> <roger.pau@citrix.com>
>>> Cc: Eslam Elnikety <elnikety@amazon.de>; Andrew Cooper <andrew.cooper3@citrix.com>; Shan Haitao
>>> <haitao.shan@intel.com>; Jan Beulich <jbeulich@suse.com>
>>> Subject: Re: [Xen-devel] [PATCH v2] x86/hvm: re-work viridian APIC assist code
>>>
>>> Resending this straw man patch at Roger's request, to restart discussion.
>>>
>>> Redux: In order to cope with the relatively rare case of unmaskable
>>> legacy MSIs, each vlapic EOI takes a domain-global spinlock just to
>>> iterate over all IRQs and determine that there's actually nothing to
>>> do.
>>>
>>> In my testing, I observe that this drops Windows performance on passed-
>>> through NVMe from 2.2M IOPS down to about 1.0M IOPS.
>>>
>>> I have a variant of this patch which just has a single per-domain "I
>>> attached legacy unmaskable MSIs" flag, which is never cleared. The
>>> patch below is per-vector (but Roger points out it should be per-vCPU
>>> per-vector). I don't know that we really care enough to do more than
>>> the single per-domain flag, which in real life would never happen
>>> anyway unless you have crappy hardware, at which point you get back to
>>> today's status quo.
>>>
>>> My main concern is that this code is fairly sparsely documented and I'm
>>> only 99% sure that this code path really *is* only for unmaskable MSIs,
>>> and doesn't have some other esoteric use. A second opinion on that
>>> would be particularly welcome.
>>>
>>
>> The loop appears to be there to handle the case where multiple
>> devices assigned to a domain have MSIs programmed with the same
>> dest/vector... which seems like an odd thing for a guest to do but I
>> guess it is at liberty to do it. Does it matter whether they are
>> maskable or not?
> 
> Such configuration would never work properly, as lapic vectors are
> edge triggered and thus can't be safely shared between devices?

Wait - there are two aspects here: Vectors are difficult to be shared
on the same CPU (but it's not impossible if the devices and their
drivers meet certain conditions). But the bitmap gets installed as a
per-domain rather than a per-vcpu one, and using the same vector on
different CPUs is definitely possible, as demonstrated by both Xen
itself as well as Linux.

Jan


  parent reply	other threads:[~2020-08-19  7:12 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-18 15:10 [PATCH v2] x86/hvm: re-work viridian APIC assist code Paul Durrant
2018-01-18 16:21 ` Jan Beulich
2018-01-18 16:27   ` Paul Durrant
2018-08-24 23:38 ` David Woodhouse
2018-09-03 10:12   ` Paul Durrant
2018-09-04 20:31     ` David Woodhouse
2018-09-05  9:36       ` Paul Durrant
2018-09-05  9:40         ` David Woodhouse
2018-09-05  9:43           ` Paul Durrant
2018-09-05 10:40             ` Paul Durrant
2018-09-05 10:45               ` David Woodhouse
2018-09-05 10:48                 ` Paul Durrant
2020-08-11 13:25   ` [Xen-devel] " David Woodhouse
2020-08-12 13:43     ` Roger Pau Monné
2020-08-13  8:10     ` Paul Durrant
2020-08-13  9:45       ` Roger Pau Monné
2020-08-14 14:13         ` David Woodhouse
2020-08-14 14:41           ` Roger Pau Monné
2020-08-19  7:12         ` Jan Beulich [this message]
2020-08-19  8:26           ` Roger Pau Monné

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=f2aa0cd1-61c9-c788-56fb-b2546feed74b@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dwmw2@infradead.org \
    --cc=elnikety@amazon.de \
    --cc=haitao.shan@intel.com \
    --cc=paul.durrant@citrix.com \
    --cc=paul@xen.org \
    --cc=roger.pau@citrix.com \
    --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).