Re: [PATCH 1/8] KVM: VMX: Add a TSC multiplier field in VMCS12

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

 



On Thu, 2021-05-06 at 10:32 +0000, ilstam@xxxxxxxxxxx wrote:
> From: Ilias Stamatis <ilstam@xxxxxxxxxx>
> 
> This is required for supporting nested TSC scaling.
> 
> Signed-off-by: Ilias Stamatis <ilstam@xxxxxxxxxx>
> ---
>  arch/x86/kvm/vmx/vmcs12.c | 1 +
>  arch/x86/kvm/vmx/vmcs12.h | 4 +++-
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/vmx/vmcs12.c b/arch/x86/kvm/vmx/vmcs12.c
> index 034adb6404dc..d9f5d7c56ae3 100644
> --- a/arch/x86/kvm/vmx/vmcs12.c
> +++ b/arch/x86/kvm/vmx/vmcs12.c
> @@ -37,6 +37,7 @@ const unsigned short vmcs_field_to_offset_table[] = {
>  	FIELD64(VM_ENTRY_MSR_LOAD_ADDR, vm_entry_msr_load_addr),
>  	FIELD64(PML_ADDRESS, pml_address),
>  	FIELD64(TSC_OFFSET, tsc_offset),
> +	FIELD64(TSC_MULTIPLIER, tsc_multiplier),
>  	FIELD64(VIRTUAL_APIC_PAGE_ADDR, virtual_apic_page_addr),
>  	FIELD64(APIC_ACCESS_ADDR, apic_access_addr),
>  	FIELD64(POSTED_INTR_DESC_ADDR, posted_intr_desc_addr),
> diff --git a/arch/x86/kvm/vmx/vmcs12.h b/arch/x86/kvm/vmx/vmcs12.h
> index 13494956d0e9..bb81a23afe89 100644
> --- a/arch/x86/kvm/vmx/vmcs12.h
> +++ b/arch/x86/kvm/vmx/vmcs12.h
> @@ -70,7 +70,8 @@ struct __packed vmcs12 {
>  	u64 eptp_list_address;
>  	u64 pml_address;
>  	u64 encls_exiting_bitmap;
> -	u64 padding64[2]; /* room for future expansion */
> +	u64 tsc_multiplier;
> +	u64 padding64[1]; /* room for future expansion */

Getting low on the padding. Oh well...
>  	/*
>  	 * To allow migration of L1 (complete with its L2 guests) between
>  	 * machines of different natural widths (32 or 64 bit), we cannot have
> @@ -258,6 +259,7 @@ static inline void vmx_check_vmcs12_offsets(void)
>  	CHECK_OFFSET(eptp_list_address, 304);
>  	CHECK_OFFSET(pml_address, 312);
>  	CHECK_OFFSET(encls_exiting_bitmap, 320);
> +	CHECK_OFFSET(tsc_multiplier, 328);
>  	CHECK_OFFSET(cr0_guest_host_mask, 344);
>  	CHECK_OFFSET(cr4_guest_host_mask, 352);
>  	CHECK_OFFSET(cr0_read_shadow, 360);

Reviewed-by: Maxim Levitsky <mlevitsk@xxxxxxxxxx>

Best regards,
	Maxim Levitsky





[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