Commit 241f0aad authored by Sean Christopherson's avatar Sean Christopherson Committed by Paolo Bonzini
Browse files

drm/i915/gvt: Error out on an attempt to shadowing an unknown GTT entry type



Bail from ppgtt_populate_shadow_entry() if an unexpected GTT entry type
is encountered instead of subtly falling through to the common "direct
shadow" path.  Eliminating the default/error path's reliance on the common
handling will allow hoisting intel_gvt_dma_map_guest_page() into the case
statements so that the 2MiB case can try intel_gvt_dma_map_guest_page()
and fallback to splitting the entry on failure.

Reviewed-by: default avatarZhi Wang <zhi.a.wang@intel.com>
Tested-by: default avatarYongwei Ma <yongwei.ma@intel.com>
Reviewed-by: default avatarYan Zhao <yan.y.zhao@intel.com>
Link: https://lore.kernel.org/r/20230729013535.1070024-8-seanjc@google.com


Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 96b138cd
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1303,6 +1303,7 @@ static int ppgtt_populate_shadow_entry(struct intel_vgpu *vgpu,
		return -EINVAL;
	default:
		GEM_BUG_ON(1);
		return -EINVAL;
	}

	/* direct shadow */