[PATCH] drm/i915/gvt: Add the support of HUC_STATUS2 reg emulation for Guest VGPU
Zhao, Yakui
yakui.zhao at intel.com
Wed Mar 28 00:49:48 UTC 2018
On 2018年03月27日 15:27, Zhenyu Wang wrote:
> On 2018.03.27 14:03:39 +0800, Zhao, Yakui wrote:
>>>>>> diff --git a/drivers/gpu/drm/i915/gvt/mmio.c b/drivers/gpu/drm/i915/gvt/mmio.c
>>>>>> index 11b71b3..7cf972d 100644
>>>>>> --- a/drivers/gpu/drm/i915/gvt/mmio.c
>>>>>> +++ b/drivers/gpu/drm/i915/gvt/mmio.c
>>>>>> @@ -235,6 +235,7 @@ void intel_vgpu_reset_mmio(struct intel_vgpu *vgpu, bool dmlr)
>>>>>> struct intel_gvt *gvt = vgpu->gvt;
>>>>>> const struct intel_gvt_device_info *info = &gvt->device_info;
>>>>>> void *mmio = gvt->firmware.mmio;
>>>>>> + struct drm_i915_private *dev_priv = gvt->dev_priv;
>>>>>> if (dmlr) {
>>>>>> memcpy(vgpu->mmio.vreg, mmio, info->mmio_size);
>>>>>> @@ -256,6 +257,11 @@ void intel_vgpu_reset_mmio(struct intel_vgpu *vgpu, bool dmlr)
>>>>>> memcpy(vgpu->mmio.sreg, mmio, GVT_GEN8_MMIO_RESET_OFFSET);
>>>>>> }
>>>>>> + if (HAS_HUC_UCODE(dev_priv)) {
>>>
>>> maybe use USES_HUC()? so only read hw value when huc is loaded, otherwise can just skip.
>>
>> The status of Huc loading only depends on the value of HUC_STATUS2 reg. (The
>> dev_priv->huc_fw.load_status can't reflect the status of Huc as it needs the
>> Guc authentication).
>>
>> So it is checked on the platforms that supports the Guc/Huc.
>> How do you think?
>>
>
> I think USES_HUC() just check if huc fw is available for load, which
> should be the state that we want to check huc fw status. And looks
> HAS_HUC_UCODE() has no user within i915 code at all? I'm not clear
> on that history maybe we should not use it anymore.
>
The USES_HUC macro will use the module parameter of i915.enable_guc to
check whether the HUC is needed. And now it is used to control whether
the Huc FW is loaded.
It is also ok to use the USES_HUC in the function of intel_vgpu_reset_mmio.
I will use the macro of USES_HUC to update the patch.
BTW:
For the real handler of HUC_STATUS2 reg: As it is one read-only
register and not changed after initialization, I think that it can be
initialized only once at the vgpu reset time.
How do you think?
Thanks
>
>
> _______________________________________________
> 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