[PATCH] drm/i915/gvt: set default value to 0 for unhandled mmio regs

Zhao, Yan Y yan.y.zhao at intel.com
Thu Feb 23 01:32:46 UTC 2017


hi Hongbo

the default value for vregs are initialized from "firmware". However, 
the values in "firmware" are further read from hardware ONLY for 
registers in handled mmio list.

for registers not in handled mmio list, their values are never got 
initialized and thus left random.

so in this patch, "firmware" is initialized to 0 via "vzalloc(size)" first.


Thanks

Yan


On 2/21/2017 5:06 PM, Wang, Hongbo wrote:
> Your patch comment seems not exactly matching your code implementation.
> Can you reiterate the flow and logic behind your zero initialization code?
>
>
>
> Best regards.
> Hongbo
> Tel: +86-21-6116 7445
> MP: +86-1364 1793 689
> Mail: hongbo.wang at intel.com
>
>
>> -----Original Message-----
>> From: intel-gvt-dev [mailto:intel-gvt-dev-bounces at lists.freedesktop.org] On
>> Behalf Of Zhao Yan
>> Sent: Tuesday, February 21, 2017 2:01 PM
>> To: intel-gvt-dev at lists.freedesktop.org
>> Cc: Zhao, Yan Y <yan.y.zhao at intel.com>
>> Subject: [PATCH] drm/i915/gvt: set default value to 0 for unhandled mmio
>> regs
>>
>> for a handled mmio reg,  its default value is read from hardware, while for
>> an unhandled mmio regs,  its default value would be random if not explicitly
>> set to 0
>>
>> Signed-off-by: Zhao Yan <yan.y.zhao at intel.com>
>> ---
>>   drivers/gpu/drm/i915/gvt/firmware.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/i915/gvt/firmware.c
>> b/drivers/gpu/drm/i915/gvt/firmware.c
>> index 1cb29b2..933a7c2 100644
>> --- a/drivers/gpu/drm/i915/gvt/firmware.c
>> +++ b/drivers/gpu/drm/i915/gvt/firmware.c
>> @@ -80,7 +80,7 @@ static int expose_firmware_sysfs(struct intel_gvt *gvt)
>>   	int ret;
>>
>>   	size = sizeof(*h) + info->mmio_size + info->cfg_space_size - 1;
>> -	firmware = vmalloc(size);
>> +	firmware = vzalloc(size);
>>   	if (!firmware)
>>   		return -ENOMEM;
>>
>> --
>> 1.9.1
>>
>> _______________________________________________
>> 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