Re: [PATCH 0/8] KVM: VMX: Implement nested TSC scaling

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

 



On 06/05/21 19:16, Jim Mattson wrote:
On Thu, May 6, 2021 at 3:34 AM <ilstam@xxxxxxxxxxx> wrote:

From: Ilias Stamatis <ilstam@xxxxxxxxxx>

KVM currently supports hardware-assisted TSC scaling but only for L1 and it
doesn't expose the feature to nested guests. This patch series adds support for
nested TSC scaling and allows both L1 and L2 to be scaled with different
scaling factors.

When scaling and offsetting is applied, the TSC for the guest is calculated as:

(TSC * multiplier >> 48) + offset

With nested scaling the values in VMCS01 and VMCS12 need to be merged
together and stored in VMCS02.

The VMCS02 values are calculated as follows:

offset_02 = ((offset_01 * mult_12) >> 48) + offset_12
mult_02 = (mult_01 * mult_12) >> 48

The last patch of the series adds a KVM selftest.

Will you be doing the same for SVM? The last time I tried to add a
nested virtualization feature for Intel only, Paolo rapped my knuckles
with a ruler.

For bugfixes definitely, for features it is definitely nice.

And these days we even have similar-enough code between nVMX and nSVM code, that in many cases there's really no good excuse not to do it.

Paolo




[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