|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v2] x86/nestedsvm: remove dead code for shadow-paging L1 hosts
On 27.10.2026 08:37, chunjie.zhu@xxxxxxxxxx wrote:
> --- a/xen/arch/x86/hvm/svm/nestedsvm.c
> +++ b/xen/arch/x86/hvm/svm/nestedsvm.c
> @@ -237,27 +237,10 @@ static int nsvm_vcpu_hostrestore(struct vcpu *v, struct
> cpu_user_regs *regs)
> hvm_update_guest_cr(v, 2);
>
> /* CR3 */
> - /* Nested paging mode */
> - if ( nestedhvm_paging_mode_hap(v) )
> - {
> - /* host nested paging + guest nested paging. */
> - /* hvm_set_cr3() below sets v->arch.hvm.guest_cr[3] for us. */
> - }
> - else if ( !paging_mode_shadow(v->domain) )
> - {
> - /* host nested paging + guest shadow paging. */
> - /* hvm_set_cr3() below sets v->arch.hvm.guest_cr[3] for us. */
> - }
> - else
> - {
> - /* host shadow paging + guest shadow paging. */
> + /* Nested virt requires HAP, so the host is never in shadow mode. */
> + BUG_ON(paging_mode_shadow(v->domain));
See below as to the use of "host" in the comment.
> @@ -517,10 +500,13 @@ static int nsvm_vmcb_prepare4vmrun(struct vcpu *v,
> struct cpu_user_regs *regs)
> v->arch.hvm.guest_cr[2] = ns_vmcb->_cr2;
> hvm_update_guest_cr(v, 2);
>
> + /* Nested virt requires HAP, so the host is never in shadow mode. */
> + BUG_ON(paging_mode_shadow(v->domain));
> +
> /* Nested paging mode */
> if ( nestedhvm_paging_mode_hap(v) )
> {
> - /* host nested paging + guest nested paging. */
> + /* Guest uses nested paging. */
> vmcb_set_np(n2vmcb, true);
"Guest" alone ends up ambiguous. The "host" / "guest" terminology used before
wasn't quite clear either, but at least there was some distinction. Easiest
may be to drop "Guest uses" here (and below). Else, to be unambiguous, it may
need to be something like "L1 runs L2 under nested paging".
If you agree with dropping "Guest uses" and replacing "host" by "L1", I can
make these adjustments while committing, implying
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
in that shape. Otherwise please submit a v3 with adjustments you consider
suitable.
Jan
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |