Re: [PATCH v4] KVM: VMX: Enable XSAVE/XRSTORE for guest

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

 



On 05/24/2010 04:36 PM, Avi Kivity wrote:

may be simplified if we move xcr0 reload back to guest entry (... :) but make it lazy:

  save_host_state: nothing
  set cr4.osxsave: nothing
  clear cr4.osxsave: nothing
guest entry: if (gcr4.osxsave && !guest_xcr0_loaded) { guest_xcr0_loaded = true, load gxcr0 } load_host_state: if (guest_xcr0_loaded) { guest_xcr0_loaded = false; load host xcr0 } fpu switching: if (guest_xcr0_loaded) { guest_xcr0_loaded = false; load host xcr0 }, do fpu stuff

So we delay xcr0 reload as late as possible for both entry and exit.


btw, this is similar to how we switch the fpu itself: if-needed-and-not-already-loaded on guest entry, if-loaded on vcpu_put.

--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.

--
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