Re: [PATCH v3 3/8] drm/i915: Partition the fence registers for vGPU in i915 driver

Tvrtko Ursulin
2014-12-17T09:59:58Z

On 12/17/2014 07:33 AM, Gerd Hoffmann wrote:
> On Di, 2014-12-16 at 15:01 +0000, Tvrtko Ursulin wrote:
>> Hi,
>>
>> On 12/16/2014 02:41 PM, Gerd Hoffmann wrote:
>>>> I didn't figure out how each domain knowns which fences to use? They
>>>> know how many, but which ones?
>>>
>>> I think the guest doesn't have to know because mmio access is trapped by
>>> the hypervisor anyway.
>>
>> Okay.. so the point is to ensure no domain can hog all fences, but if
>> the hypervisor is already tracking everything why is this limiting
>> required then in the guest? Hypervisor could just say all fences are
>> allocated since it knows how much it gave out per guest.
>
> There is no dynamic allocation. Each guest gets a fixed number of
> fences assigned which it can use, pretty much like memory where each
> guest gets a fixed piece too.
>
> It's not possible to allow guests direct access to the fence registers
> though. And if every fence register access traps into the hypervisor
> anyway the hypervisor can easily map the guest virtual fence to host
> physical fence, so there is no need to tell the guest which fences it
> owns, the number of fences is enough.

That exactly is the part I don't understand - if it is not required to
tell the guest which fences it owns, why it is required to say how many?

With this scheme it could be one guest wants more and can't get them
even if no one else is using any. If not limited they could be
dynamically allocated by the hypervisor, no?

Regards,

Tvrtko