Re: [PATCH v5 1/2] KVM: nVMX: Restore the VMCS12 offsets for v4.0 fields

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

 



2018-05-01 15:40-0700, Jim Mattson:
> Changing the VMCS12 layout will break save/restore compatibility with
> older kvm releases once the KVM_{GET,SET}_NESTED_STATE ioctls are
> accepted upstream. Google has already been using these ioctls for some
> time, and we implore the community not to disturb the existing layout.

I have queued the patch with minor changes (see the bottom).

Freezing the structure after implementing migration would let KVM have
more reserved fields, but the benefit is small in comparison to the
problems of versioning and Google is currently the only one pushing
related code upstream.

> Move the four most recently added fields to preserve the offsets of
> the previously defined fields and reserve locations for the vmread and
> vmwrite bitmaps, which will be used in the virtualization of VMCS
> shadowing (to improve the performance of double-nesting).
> 
> Signed-off-by: Jim Mattson <jmattson@xxxxxxxxxx>
> ---
> diff --git a/arch/x86/include/asm/vmx.h b/arch/x86/include/asm/vmx.h
> @@ -747,7 +756,6 @@ static const unsigned short vmcs_field_to_offset_table[] = {
>  	FIELD(GUEST_LDTR_SELECTOR, guest_ldtr_selector),
>  	FIELD(GUEST_TR_SELECTOR, guest_tr_selector),
>  	FIELD(GUEST_INTR_STATUS, guest_intr_status),
> -	FIELD(GUEST_PML_INDEX, guest_pml_index),
>  	FIELD(HOST_ES_SELECTOR, host_es_selector),
>  	FIELD(HOST_CS_SELECTOR, host_cs_selector),
>  	FIELD(HOST_SS_SELECTOR, host_ss_selector),
> @@ -755,6 +763,7 @@ static const unsigned short vmcs_field_to_offset_table[] = {
>  	FIELD(HOST_FS_SELECTOR, host_fs_selector),
>  	FIELD(HOST_GS_SELECTOR, host_gs_selector),
>  	FIELD(HOST_TR_SELECTOR, host_tr_selector),
> +	FIELD(GUEST_PML_INDEX, guest_pml_index),
>  	FIELD64(IO_BITMAP_A, io_bitmap_a),
>  	FIELD64(IO_BITMAP_B, io_bitmap_b),
>  	FIELD64(MSR_BITMAP, msr_bitmap),
> @@ -765,17 +774,14 @@ static const unsigned short vmcs_field_to_offset_table[] = {
>  	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),
> -	FIELD64(VM_FUNCTION_CONTROL, vm_function_control),
>  	FIELD64(EPT_POINTER, ept_pointer),
>  	FIELD64(EOI_EXIT_BITMAP0, eoi_exit_bitmap0),
>  	FIELD64(EOI_EXIT_BITMAP1, eoi_exit_bitmap1),
>  	FIELD64(EOI_EXIT_BITMAP2, eoi_exit_bitmap2),
>  	FIELD64(EOI_EXIT_BITMAP3, eoi_exit_bitmap3),
> -	FIELD64(EPTP_LIST_ADDRESS, eptp_list_address),
>  	FIELD64(XSS_EXIT_BITMAP, xss_exit_bitmap),
>  	FIELD64(GUEST_PHYSICAL_ADDRESS, guest_physical_address),
>  	FIELD64(VMCS_LINK_POINTER, vmcs_link_pointer),
> -	FIELD64(PML_ADDRESS, pml_address),
>  	FIELD64(GUEST_IA32_DEBUGCTL, guest_ia32_debugctl),
>  	FIELD64(GUEST_IA32_PAT, guest_ia32_pat),
>  	FIELD64(GUEST_IA32_EFER, guest_ia32_efer),
> @@ -788,6 +794,11 @@ static const unsigned short vmcs_field_to_offset_table[] = {
>  	FIELD64(HOST_IA32_PAT, host_ia32_pat),
>  	FIELD64(HOST_IA32_EFER, host_ia32_efer),
>  	FIELD64(HOST_IA32_PERF_GLOBAL_CTRL, host_ia32_perf_global_ctrl),
> +	FIELD64(VMREAD_BITMAP, vmread_bitmap),
> +	FIELD64(VMWRITE_BITMAP, vmwrite_bitmap),
> +	FIELD64(VM_FUNCTION_CONTROL, vm_function_control),
> +	FIELD64(EPTP_LIST_ADDRESS, eptp_list_address),
> +	FIELD64(PML_ADDRESS, pml_address),

I have removed these hunks to keep mirroring the order from SDM and
added bitmaps where they belong.  Following the vmcs12 order would
result in two messy structures when we run out of reserved fields.



[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