Commit 3c0f9936 authored by Ilias Stamatis's avatar Ilias Stamatis Committed by Paolo Bonzini

KVM: nVMX: Add a TSC multiplier field in VMCS12

This is required for supporting nested TSC scaling.
Signed-off-by: default avatarIlias Stamatis <ilstam@amazon.com>
Reviewed-by: default avatarJim Mattson <jmattson@google.com>
Reviewed-by: default avatarMaxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20210526184418.28881-6-ilstam@amazon.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent fe3eb504
...@@ -37,6 +37,7 @@ const unsigned short vmcs_field_to_offset_table[] = { ...@@ -37,6 +37,7 @@ const unsigned short vmcs_field_to_offset_table[] = {
FIELD64(VM_ENTRY_MSR_LOAD_ADDR, vm_entry_msr_load_addr), FIELD64(VM_ENTRY_MSR_LOAD_ADDR, vm_entry_msr_load_addr),
FIELD64(PML_ADDRESS, pml_address), FIELD64(PML_ADDRESS, pml_address),
FIELD64(TSC_OFFSET, tsc_offset), FIELD64(TSC_OFFSET, tsc_offset),
FIELD64(TSC_MULTIPLIER, tsc_multiplier),
FIELD64(VIRTUAL_APIC_PAGE_ADDR, virtual_apic_page_addr), FIELD64(VIRTUAL_APIC_PAGE_ADDR, virtual_apic_page_addr),
FIELD64(APIC_ACCESS_ADDR, apic_access_addr), FIELD64(APIC_ACCESS_ADDR, apic_access_addr),
FIELD64(POSTED_INTR_DESC_ADDR, posted_intr_desc_addr), FIELD64(POSTED_INTR_DESC_ADDR, posted_intr_desc_addr),
......
...@@ -70,7 +70,8 @@ struct __packed vmcs12 { ...@@ -70,7 +70,8 @@ struct __packed vmcs12 {
u64 eptp_list_address; u64 eptp_list_address;
u64 pml_address; u64 pml_address;
u64 encls_exiting_bitmap; u64 encls_exiting_bitmap;
u64 padding64[2]; /* room for future expansion */ u64 tsc_multiplier;
u64 padding64[1]; /* room for future expansion */
/* /*
* To allow migration of L1 (complete with its L2 guests) between * To allow migration of L1 (complete with its L2 guests) between
* machines of different natural widths (32 or 64 bit), we cannot have * machines of different natural widths (32 or 64 bit), we cannot have
...@@ -258,6 +259,7 @@ static inline void vmx_check_vmcs12_offsets(void) ...@@ -258,6 +259,7 @@ static inline void vmx_check_vmcs12_offsets(void)
CHECK_OFFSET(eptp_list_address, 304); CHECK_OFFSET(eptp_list_address, 304);
CHECK_OFFSET(pml_address, 312); CHECK_OFFSET(pml_address, 312);
CHECK_OFFSET(encls_exiting_bitmap, 320); CHECK_OFFSET(encls_exiting_bitmap, 320);
CHECK_OFFSET(tsc_multiplier, 328);
CHECK_OFFSET(cr0_guest_host_mask, 344); CHECK_OFFSET(cr0_guest_host_mask, 344);
CHECK_OFFSET(cr4_guest_host_mask, 352); CHECK_OFFSET(cr4_guest_host_mask, 352);
CHECK_OFFSET(cr0_read_shadow, 360); CHECK_OFFSET(cr0_read_shadow, 360);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment