From: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org, Jan Beulich <jbeulich@suse.com>,
Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH v4 1/2] x86/mm: add API for marking only part of a MMIO page read only
Date: Tue, 11 Jun 2024 17:01:49 +0200 [thread overview]
Message-ID: <Zmhm3r8U4Nz7vxhQ@mail-itl> (raw)
In-Reply-To: <ZmhaB57Tc6BsknVO@macbook>
[-- Attachment #1: Type: text/plain, Size: 1911 bytes --]
On Tue, Jun 11, 2024 at 04:07:03PM +0200, Roger Pau Monné wrote:
> On Tue, Jun 11, 2024 at 03:15:42PM +0200, Marek Marczykowski-Górecki wrote:
> > It's location is discovered at startup
> > (device presents a linked-list of capabilities in one of its BARs).
> > The spec talks only about alignment of individual registers, not the
> > whole group...
>
> Never mind then, I had the expectation we could get away with a single
> page, but doesn't look to be the case.
>
> I assume the spec doesn't mention anything about the BAR where the
> capabilities reside having a size <= 4KiB.
No, and in fact I see it's a BAR of 64KiB on one of devices...
> > > Maybe worth adding a comment that the logic here intends to deal only
> > > with the RW bits of a page that's otherwise RO, and that by not
> > > handling the RO regions the intention is that those are dealt just
> > > like fully RO pages.
> >
> > I can extend the comment, but I assumed it's kinda implied already (if
> > nothing else, by the function name).
>
> Well, at this point we know the write is not going to make it to host
> memory. The only reason to not handle the access here is that we want
> to unify the consequences it has for a guest writing to a RO address.
Yup.
> > > I guess there's some message printed when attempting to write to a RO
> > > page that you would also like to print here?
> >
> > If a HVM domain writes to an R/O area, it is crashed, so you will get a
> > message. This applies to both full page R/O and partial R/O. PV doesn't
> > go through subpage_mmio_write_accept().
>
> Oh, crashing the domain is more strict than I was expecting.
That's how it was before, I'm not really changing it here. It's less
strict for PV though (it either gets a #PF forwarded back to the guest,
or is ignored).
--
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:[~2024-06-11 15:02 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-22 15:39 [PATCH v4 0/2] Add API for making parts of a MMIO page R/O and use it in XHCI console Marek Marczykowski-Górecki
2024-05-22 15:39 ` [PATCH v4 1/2] x86/mm: add API for marking only part of a MMIO page read only Marek Marczykowski-Górecki
2024-06-07 7:01 ` Jan Beulich
2024-06-11 11:00 ` Marek Marczykowski-Górecki
2024-06-11 10:40 ` Roger Pau Monné
2024-06-11 11:26 ` Jan Beulich
2024-06-11 11:38 ` Marek Marczykowski-Górecki
2024-06-11 12:55 ` Roger Pau Monné
2024-06-11 13:15 ` Marek Marczykowski-Górecki
2024-06-11 14:07 ` Roger Pau Monné
2024-06-11 15:01 ` Marek Marczykowski-Górecki [this message]
2024-05-22 15:39 ` [PATCH v4 2/2] drivers/char: Use sub-page ro API to make just xhci dbc cap RO Marek Marczykowski-Górecki
2024-05-23 8:22 ` Jan Beulich
2024-05-23 14:22 ` [PATCH v4 0/2] Add API for making parts of a MMIO page R/O and use it in XHCI console Marek Marczykowski-Górecki
2024-05-23 14:28 ` Jan Beulich
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=Zmhm3r8U4Nz7vxhQ@mail-itl \
--to=marmarek@invisiblethingslab.com \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--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 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.