@@ -1815,7 +1815,8 @@ struct kvm_x86_ops {
void *(*alloc_apic_backing_page)(struct kvm_vcpu *vcpu);
int (*gmem_prepare)(struct kvm *kvm, kvm_pfn_t pfn, gfn_t gfn, int max_order);
void (*gmem_invalidate)(kvm_pfn_t start, kvm_pfn_t end);
- int (*gmem_validate_fault)(struct kvm *kvm, kvm_pfn_t pfn, gfn_t gfn, u8 *max_level);
+ int (*gmem_validate_fault)(struct kvm *kvm, kvm_pfn_t pfn, gfn_t gfn, bool is_private,
+ u8 *max_level);
};
struct kvm_x86_nested_ops {
@@ -4340,7 +4340,8 @@ static int kvm_faultin_pfn_private(struct kvm_vcpu *vcpu,
fault->map_writable = !(fault->slot->flags & KVM_MEM_READONLY);
r = static_call(kvm_x86_gmem_validate_fault)(vcpu->kvm, fault->pfn,
- fault->gfn, &fault->max_level);
+ fault->gfn, fault->is_private,
+ &fault->max_level);
if (r) {
kvm_release_pfn_clean(fault->pfn);
return r;
TDX has use for a similar interface, but in that case it needs an indication of whether or not the fault was private. Go ahead and plumb that information through. Link: https://lore.kernel.org/lkml/35bc4582-8a03-413b-be0e-4cc419715772@linux.intel.com/ Signed-off-by: Michael Roth <michael.roth@amd.com> --- arch/x86/include/asm/kvm_host.h | 3 ++- arch/x86/kvm/mmu/mmu.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)