[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aUsix_3KDEEFt0gC@google.com>
Date: Tue, 23 Dec 2025 15:16:23 -0800
From: Sean Christopherson <seanjc@...gle.com>
To: Yosry Ahmed <yosry.ahmed@...ux.dev>
Cc: Paolo Bonzini <pbonzini@...hat.com>, kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 08/16] KVM: selftests: Use a nested MMU to share nested
EPTs between vCPUs
On Thu, Nov 27, 2025, Yosry Ahmed wrote:
> diff --git a/tools/testing/selftests/kvm/lib/x86/vmx.c b/tools/testing/selftests/kvm/lib/x86/vmx.c
> index a3e2eae981da..5d799ec5f7c6 100644
> --- a/tools/testing/selftests/kvm/lib/x86/vmx.c
> +++ b/tools/testing/selftests/kvm/lib/x86/vmx.c
> @@ -56,6 +56,16 @@ int vcpu_enable_evmcs(struct kvm_vcpu *vcpu)
> return evmcs_ver;
> }
>
> +void vm_enable_ept(struct kvm_vm *vm)
> +{
> + TEST_ASSERT(kvm_cpu_has_ept(), "KVM doesn't support nested EPT");
> + if (vm->arch.nested.mmu)
Make this an assert, attempting to enable EPT multiple times for a single VM is
a test bug. That way we don't have to worry about silly situations in the future,
e.g. like trying to change from 4-level to 5-level after the MMU has already been
created.
Ditto for the NPT code.
> + return;
> +
> + /* EPTP_PWL_4 is always used */
> + vm->arch.nested.mmu = mmu_create(vm, 4, NULL);
Powered by blists - more mailing lists