From: Jan Beulich <jbeulich@suse.com>
To: Ross Lagerwall <ross.lagerwall@citrix.com>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
"Roger Pau Monné" <roger@xenproject.org>,
"Jason Andryuk" <jason.andryuk@amd.com>,
"Teddy Astie" <teddy.astie@vates.tech>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2] x86/svm: Intercept CR0 writes selectively
Date: Tue, 8 Sep 2026 10:44:10 +0200 [thread overview]
Message-ID: <8fbc99b1-d98b-4f52-b9ea-bd84e8bfa2ca@suse.com> (raw)
In-Reply-To: <20260904122330.306936-1-ross.lagerwall@citrix.com>
On 04.09.2026 14:23, Ross Lagerwall wrote:
> @@ -2517,6 +2518,7 @@ void asmlinkage svm_vmexit_handler(void)
> hvm_sanitize_regs_fields(
> regs, !(vmcb_get_efer(vmcb) & EFER_LMA) || !(vmcb->cs.l));
>
> + v->arch.hvm.guest_cr[0] = vmcb_get_cr0(vmcb);
> v->arch.hvm.guest_cr[2] = vmcb_get_cr2(vmcb);
> if ( paging_mode_hap(v->domain) )
> v->arch.hvm.guest_cr[3] = v->arch.hvm.hw_cr[3] = vmcb_get_cr3(vmcb);
gitlab-CI says no to this patch [1], and I think it's the change above which
gets in the way of running guests in shadow mode (as is the case for the two
qemu-smoke-x86_64-*-pvh tests). svm_update_guest_cr() has
value = v->arch.hvm.guest_cr[0];
if ( paging_mode_shadow(v->domain) )
value |= X86_CR0_PG | X86_CR0_WP;
vmcb_set_cr0(vmcb, value);
i.e. upon reading back the guest's CR0 value we would wrongly record it
having PG (and WP) enabled, at which point shadow code would try to use the
still-zero CR3 as page table base. I think values need merging here, with
only TS and MP taken from what vmcb_get_cr0() returns.
The zen2-* failure in [1] is, I think, unrelated.
Jan
[1] https://gitlab.com/xen-project/hardware/xen-staging/-/pipelines/2828369624
next prev parent reply other threads:[~2026-09-08 8:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-04 12:23 [PATCH v2] x86/svm: Intercept CR0 writes selectively Ross Lagerwall
2026-09-07 12:24 ` Jan Beulich
2026-09-08 8:44 ` Jan Beulich [this message]
2026-09-08 13:57 ` Andrew Cooper
2026-09-08 14:09 ` Ross Lagerwall
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=8fbc99b1-d98b-4f52-b9ea-bd84e8bfa2ca@suse.com \
--to=jbeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=jason.andryuk@amd.com \
--cc=roger@xenproject.org \
--cc=ross.lagerwall@citrix.com \
--cc=teddy.astie@vates.tech \
--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.