[PATCH] drm/i915/gvt: Fix an logic issue in ppgtt_allocate_oos_page
Zhi Wang
zhi.a.wang at intel.com
Sat Apr 1 05:12:03 UTC 2017
Hi Zhenyuw:
This patch is a part of the task "back-porting patches from old
staging branch". If we back-port it later, I may forget it. :P
On 04/01/17 13:20, Zhenyu Wang wrote:
> On 2017.04.01 13:05:14 +0800, Zhi Wang wrote:
>> Please take this one. :P Thanks. I forget to change the author in the
>> previous patch after re-basing it to staging branch.
>>
>
> Shouldn't this go with oos enabling?
>
>> On 04/01/17 13:04, Zhi Wang wrote:
>>> From: Min He <min.he at intel.com>
>>>
>>> In ppgtt_allocate_oos_page, when there's no free oos_page, we'll sync an
>>> old oos page and detach it. But that oos page may not belong to current
>>> gvt, so we need to find corresponding gvt and sync to it.
>>>
>>> Fixes: 2707e44 ("drm/i915/gvt: vGPU graphics memory virtualization")
>>> Signed-off-by: Min He <min.he at intel.com>
>>> Signed-off-by: Zhi Wang <zhi.a.wang at intel.com>
>>> ---
>>> drivers/gpu/drm/i915/gvt/gtt.c | 7 +++++--
>>> 1 file changed, 5 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/i915/gvt/gtt.c b/drivers/gpu/drm/i915/gvt/gtt.c
>>> index 6da4e44..cb13bc7 100644
>>> --- a/drivers/gpu/drm/i915/gvt/gtt.c
>>> +++ b/drivers/gpu/drm/i915/gvt/gtt.c
>>> @@ -1160,6 +1160,7 @@ static int ppgtt_allocate_oos_page(struct intel_vgpu *vgpu,
>>> struct intel_gvt *gvt = vgpu->gvt;
>>> struct intel_gvt_gtt *gtt = &gvt->gtt;
>>> struct intel_vgpu_oos_page *oos_page = gpt->oos_page;
>>> + struct intel_vgpu_ppgtt_spt *spt = NULL;
>>> int ret;
>>>
>>> WARN(oos_page, "shadow PPGTT page has already has a oos page\n");
>>> @@ -1167,10 +1168,12 @@ static int ppgtt_allocate_oos_page(struct intel_vgpu *vgpu,
>>> if (list_empty(>t->oos_page_free_list_head)) {
>>> oos_page = container_of(gtt->oos_page_use_list_head.next,
>>> struct intel_vgpu_oos_page, list);
>>> - ret = ppgtt_set_guest_page_sync(vgpu, oos_page->guest_page);
>>> + spt = guest_page_to_ppgtt_spt(oos_page->guest_page);
>>> + ret = ppgtt_set_guest_page_sync(spt->vgpu,
>>> + oos_page->guest_page);
>>> if (ret)
>>> return ret;
>>> - ret = detach_oos_page(vgpu, oos_page);
>>> + ret = detach_oos_page(spt->vgpu, oos_page);
>>> if (ret)
>>> return ret;
>>> } else
>>>
>> _______________________________________________
>> intel-gvt-dev mailing list
>> intel-gvt-dev at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/intel-gvt-dev
>
More information about the intel-gvt-dev
mailing list