From: Jan Beulich <jbeulich@suse.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: Marek Marczykowski <marmarek@invisiblethingslab.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH 2/2] x86/hvm: fix write emulation of RO ranges
Date: Thu, 10 Apr 2025 08:27:49 +0200 [thread overview]
Message-ID: <d0d6cdf2-e436-4a72-8a02-5ec331cc950d@suse.com> (raw)
In-Reply-To: <Z_aTYmiOLEfKTend@macbook.lan>
On 09.04.2025 17:33, Roger Pau Monné wrote:
> On Wed, Apr 09, 2025 at 04:08:47PM +0200, Jan Beulich wrote:
>> On 09.04.2025 16:01, Roger Pau Monné wrote:
>>> As I understand the checks done in
>>> mmio_ro_emulated_write() are to ensure correctness, but carrying the
>>> access even when the %cr2 check fail wouldn't cause issues to Xen
>>> itself?
>>
>> Well, "wouldn't" is too strong for my taste, "shouldn't" would fit. The
>> checking is there to avoid guests playing games. Whether that prevents
>> merely in-guest just-bugs or actual XSAs we can't know until we find a
>> case where the game playing might make us do something wrong. I expect
>> it's unlikely for Xen itself to be affected. But an in-guest privilege
>> escalation would already be bad enough.
>
> I see. That was kind of my understanding of the checks. At least on
> HVM it feels a bit weird to handle r/o regions this way. It would IMO
> be more natural to use an hvm_io_handler, but that's maybe because I'm
> more familiar with those.
I guess this would be an option; I assume it's the way it is because PVHv1
inherited it from PV, and PVHv2 inherited it from PVHv1.
> And in that regard, hvm_io_handler don't seem to do any of the extra
> checking that mmio_ro_emulated_write() does with the %cr2, but maybe
> that's done by some higher layer? AFAICT that would ultimately get
> called by hvmemul_read(), and there are no checks there at all.
That more general framework isn't page-fault specific, and hence there's
no CR2 recorded to check against.
Jan
next prev parent reply other threads:[~2025-04-10 6:28 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-08 9:31 [PATCH 0/2] x86/hvm: fixes for RO MMIO emulation Roger Pau Monne
2025-04-08 9:31 ` [PATCH 1/2] x86/hvm: remove unreachable MMCFG write emulation Roger Pau Monne
2025-04-08 13:42 ` Jan Beulich
2025-04-08 9:31 ` [PATCH 2/2] x86/hvm: fix write emulation of RO ranges Roger Pau Monne
2025-04-08 13:57 ` Jan Beulich
2025-04-09 9:07 ` Roger Pau Monné
2025-04-09 10:00 ` Jan Beulich
2025-04-09 10:39 ` Roger Pau Monné
2025-04-09 12:59 ` Jan Beulich
2025-04-09 13:33 ` Roger Pau Monné
2025-04-09 13:50 ` Jan Beulich
2025-04-09 14:01 ` Roger Pau Monné
2025-04-09 14:08 ` Jan Beulich
2025-04-09 15:33 ` Roger Pau Monné
2025-04-10 6:27 ` Jan Beulich [this message]
2025-04-10 7:02 ` Roger Pau Monné
2025-04-09 14:27 ` Marek Marczykowski
2025-04-08 14:00 ` Andrew Cooper
2025-04-09 9:47 ` 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=d0d6cdf2-e436-4a72-8a02-5ec331cc950d@suse.com \
--to=jbeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=marmarek@invisiblethingslab.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.