From: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xenproject.org,
"Jason Andryuk" <jandryuk@gmail.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Wei Liu" <wl@xen.org>, "Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH v2 2/3] x86/hvm: Allow writes to registers on the same page as MSI-X table
Date: Mon, 3 Apr 2023 06:21:56 +0200 [thread overview]
Message-ID: <ZCpUZI6HmzYKDhAz@mail-itl> (raw)
In-Reply-To: <9eb7b538-4074-4b15-4ea2-67d9cc0bf85d@suse.com>
[-- Attachment #1: Type: text/plain, Size: 2963 bytes --]
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?
IIUC I care specifically about this case.
> 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.
In that case, this code won't be needed anymore, which will also make
this handler unnecessary.
Anyway, I tried to merge this handling into existing handlers and the
resulting patch is slightly bigger, so it doesn't seem to avoid any
duplication. The only benefit I can think of is avoiding iterating
msixtbl_list twice (for respective accept callbacks) on each access. Is
it worth a bit more complicated handlers?
--
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2023-04-03 4:22 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é
2023-04-03 4:21 ` Marek Marczykowski-Górecki [this message]
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=ZCpUZI6HmzYKDhAz@mail-itl \
--to=marmarek@invisiblethingslab.com \
--cc=andrew.cooper3@citrix.com \
--cc=jandryuk@gmail.com \
--cc=jbeulich@suse.com \
--cc=roger.pau@citrix.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.