diff options
author | Sean Christopherson <[email protected]> | 2023-07-28 18:35:13 -0700 |
---|---|---|
committer | Paolo Bonzini <[email protected]> | 2023-08-31 13:48:55 -0400 |
commit | 241f0aadb8577dd17fa521bf19ba7ae85dc33d41 (patch) | |
tree | 8440b72cede53729093b9e44b6ba466be35fbeca | |
parent | 96b138cd23e978cd0975d1f4d5709dae2e061fd1 (diff) |
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: Zhi Wang <[email protected]>
Tested-by: Yongwei Ma <[email protected]>
Reviewed-by: Yan Zhao <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sean Christopherson <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
-rw-r--r-- | drivers/gpu/drm/i915/gvt/gtt.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/gvt/gtt.c b/drivers/gpu/drm/i915/gvt/gtt.c index de6a484090d7..eab844dffb8c 100644 --- a/drivers/gpu/drm/i915/gvt/gtt.c +++ b/drivers/gpu/drm/i915/gvt/gtt.c @@ -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 */ |