From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>,
xen-devel@lists.xenproject.org,
"Jason Andryuk" <jandryuk@gmail.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Wei Liu" <wl@xen.org>
Subject: Re: [PATCH v2 2/3] x86/hvm: Allow writes to registers on the same page as MSI-X table
Date: Tue, 28 Mar 2023 15:22:48 +0200 [thread overview]
Message-ID: <ZCLqKGURR1QJgROK@Air-de-Roger> (raw)
In-Reply-To: <9eb7b538-4074-4b15-4ea2-67d9cc0bf85d@suse.com>
On Tue, Mar 28, 2023 at 03:03:17PM +0200, Jan Beulich wrote:
> On 28.03.2023 14:52, Marek Marczykowski-Górecki wrote:
> > On Tue, Mar 28, 2023 at 02:34:23PM +0200, Jan Beulich wrote:
> >> On 28.03.2023 14:05, Marek Marczykowski-Górecki wrote:
> >>> On Tue, Mar 28, 2023 at 01:28:44PM +0200, Roger Pau Monné wrote:
> >>>> On Sat, Mar 25, 2023 at 03:49:23AM +0100, Marek Marczykowski-Górecki wrote:
> >>>>> +static bool cf_check msixtbl_page_accept(
> >>>>> + const struct hvm_io_handler *handler, const ioreq_t *r)
> >>>>> +{
> >>>>> + ASSERT(r->type == IOREQ_TYPE_COPY);
> >>>>> +
> >>>>> + return msixtbl_page_handler_get_hwaddr(
> >>>>> + current->domain, r->addr, r->dir == IOREQ_WRITE);
> >>>>
> >>>> I think you want to accept it also if it's a write to the PBA, and
> >>>> just drop it. You should always pass write=false and then drop it in
> >>>> msixtbl_page_write() if it falls in the PBA region (but still return
> >>>> X86EMUL_OKAY).
> >>>
> >>> I don't want to interfere with msixtbl_mmio_page_ops, this handler is
> >>> only about accesses not hitting actual MSI-X structures.
> >>
> >> In his functionally similar vPCI change I did ask Roger to handle the
> >> "extra" space right from the same handlers. Maybe that's going to be
> >> best here, too.
> >
> > I have considered this option, but msixtbl_range() is already quite
> > complex, adding yet another case there won't make it easier to follow.
>
> Do you care about the case of msixtbl_addr_to_desc() returning NULL at
> all for the purpose you have? Like in Roger's patch I'd assume
> msixtbl_find_entry() needs extending what ranges it accepts; if need
> be another parameter may be added to cover cases where the extended
> coverage isn't wanted.
>
> > I mean, technically I can probably merge those two handlers together,
> > but I don't think it will result in nicer code. Especially since the
> > general direction is to abandon split of MSI-X table access handling
> > between Xen and QEMU and go with just QEMU doing it, hopefully at some
> > point not needing msixtbl_mmio_ops anymore (but still needing the one
> > for adjacent accesses).
>
> Hmm, at this point I'm not convinced of this plan. Instead I was hoping
> that once vPCI properly supports PVH DomU-s, we may also be able to make
> use of it for HVM, delegating less to qemu rather than more.
Right, but vPCI doesn't use msixtbl_mmio_ops at all.
I have to admit I don't like the split model we currently use for MSIX
handling with QEMU. I find it difficult to understand, and prone to
errors. IMO it would be much better if all the handling was either
done in QEMU (except for the quirk we need here to handle adjacent
accesses) or Xen by using vPCI.
Hence I proposed to Marek that given writes to MSIX entries need to be
propagated to QEMU in order for it to also track the mask bit, we
could also move the handling of the mask bit to QEMU entirely,
dropping the usage of msixtbl_mmio_ops.
At some point I expect we should be able to choose between doing the
handling in QEMU or vPCI in Xen.
Thanks, Roger.
next prev parent reply other threads:[~2023-03-28 13:23 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-25 2:49 [PATCH v2 1/3] x86/msi: passthrough all MSI-X vector ctrl writes to device model Marek Marczykowski-Górecki
2023-03-25 2:49 ` [PATCH v2 2/3] x86/hvm: Allow writes to registers on the same page as MSI-X table Marek Marczykowski-Górecki
2023-03-27 10:47 ` Andrew Cooper
2023-03-28 11:28 ` Roger Pau Monné
2023-03-28 12:05 ` Marek Marczykowski-Górecki
2023-03-28 12:34 ` Jan Beulich
2023-03-28 12:52 ` Marek Marczykowski-Górecki
2023-03-28 13:03 ` Jan Beulich
2023-03-28 13:22 ` Roger Pau Monné [this message]
2023-04-03 4:21 ` Marek Marczykowski-Górecki
2023-04-03 11:09 ` Jan Beulich
2023-03-28 12:52 ` Roger Pau Monné
2023-03-25 2:49 ` [PATCH v2 3/3] x86/msi: clear initial MSI-X state on boot Marek Marczykowski-Górecki
2023-03-28 11:37 ` Roger Pau Monné
2023-03-28 12:07 ` Marek Marczykowski-Górecki
2023-03-28 12:38 ` Jan Beulich
2023-03-28 12:54 ` Jan Beulich
2023-03-28 13:04 ` Marek Marczykowski-Górecki
2023-03-28 13:17 ` Jason Andryuk
2023-03-28 17:38 ` Jason Andryuk
2023-03-28 13:23 ` Jan Beulich
2023-03-28 13:27 ` Roger Pau Monné
2023-03-28 13:32 ` Jason Andryuk
2023-03-28 13:35 ` Jan Beulich
2023-03-28 13:43 ` Jason Andryuk
2023-03-28 13:54 ` Jan Beulich
2023-03-28 15:08 ` Jason Andryuk
2023-03-28 15:39 ` Jan Beulich
2023-03-27 10:12 ` [PATCH v2 1/3] x86/msi: passthrough all MSI-X vector ctrl writes to device model Roger Pau Monné
2023-03-27 10:26 ` Marek Marczykowski-Górecki
2023-03-27 10:51 ` Roger Pau Monné
2023-03-27 11:34 ` Marek Marczykowski-Górecki
2023-03-27 13:29 ` Roger Pau Monné
2023-03-27 14:20 ` Marek Marczykowski-Górecki
2023-03-27 14:37 ` Roger Pau Monné
2023-03-27 15:32 ` Jan Beulich
2023-03-27 15:42 ` 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=ZCLqKGURR1QJgROK@Air-de-Roger \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=jandryuk@gmail.com \
--cc=jbeulich@suse.com \
--cc=marmarek@invisiblethingslab.com \
--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 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.