Re: [PATCH v3] kvm/fpu: Enable fully eager restore kvm FPU

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/18/2012 04:08 AM, Hao, Xudong wrote:
>> 
>> The objective of the change is to disable lazy fpu loading (that is,
>> host fpu loaded in guest and vice-versa), 

Not vice versa.  We allow the guest fpu loaded in the host, but save it
on heavyweight exit or task switch.

when some bit except the
>> initial tree bits set in guest XCR0 (initial tree being XSTATE_FP|XSTATE_SSE|
>> XSTATE_YMM). Yes?
>> 
> 
> Yes, it's just the object.
> 
>> If i get that right, then the suggestion seems to be:
>> 
>> static bool lazy_fpu_allowed()
>> {
>> 	return (vcpu->arch.xcr0 & ~((u64)KVM_XSTATE_LAZY));
>> }
>> 
> 
> That may be:
> 
> static bool lazy_fpu_allowed()
> {
> 	return !(vcpu->arch.xcr0 & ~((u64)KVM_XSTATE_LAZY));
> }

Shouldn't it depend on cr4.osxsave as well?

> 
>> On guest entry:
>>         if (!lazy_fpu_allowed(vcpu))
>>                 kvm_x86_ops->fpu_activate(vcpu);
> 

But we already have that:

	if (vcpu->fpu_active)
		kvm_load_guest_fpu(vcpu);

so why not manage fpu_active to be always set when needed?  I don't want
more checks in the entry path.

-- 
error compiling committee.c: too many arguments to function
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux