Re: [PATCH 12/28] KVM: x86: make translate_nested_gpa vendor-specific

From: Sean Christopherson

Date: Thu Apr 30 2026 - 14:54:32 EST


On Thu, Apr 30, 2026, Paolo Bonzini wrote:
> EPT and NPT have different rules for passing PFERR_USER_MASK to the
> nested page table walk. In particular, for final addresses EPT
> uses the U bit of the guest (nGVA->nGPA) walk.
>
> While at it, remove PFERR_USER_MASK from the VMX version of the
> function, since it is actually ignored by the tables that
> update_permission_bitmask() generates for EPT.
>
> Tested-by: David Riley <d.riley@xxxxxxxxxxx>
> Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
> ---

...

> struct kvm_x86_nested_ops svm_nested_ops = {
> .leave_nested = svm_leave_nested,
> + .translate_nested_gpa = svm_translate_nested_gpa,
> .is_exception_vmexit = nested_svm_is_exception_vmexit,
> .check_events = svm_check_nested_events,
> .triple_fault = nested_svm_triple_fault,

Paolo, do you have any objection to adding static_call() support for nested_ops?
I vaguely recall you not wanting to do so. But we're reaching the point where
quite a few callbacks are in relative hot paths.