Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751084AbdLSRoH (ORCPT ); Tue, 19 Dec 2017 12:44:07 -0500 Received: from mail-it0-f43.google.com ([209.85.214.43]:38677 "EHLO mail-it0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750737AbdLSRoD (ORCPT ); Tue, 19 Dec 2017 12:44:03 -0500 X-Google-Smtp-Source: ACJfBovZdX+HHK4o5E5vgjqG7e7Wtl9ew/CMBLGPJr6rWP+fs+WO5JtX30OC0ateA5976FqMS6QOqvX8SY7ZwpuCKAU= MIME-Version: 1.0 In-Reply-To: <87zi6elxaw.fsf@vitty.brq.redhat.com> References: <20171218171742.5765-1-vkuznets@redhat.com> <20171218171742.5765-3-vkuznets@redhat.com> <87zi6elxaw.fsf@vitty.brq.redhat.com> From: Jim Mattson Date: Tue, 19 Dec 2017 09:44:01 -0800 Message-ID: Subject: Re: [PATCH RFC 2/7] KVM: nVMX: modify vmcs12 fields to match Hyper-V enlightened VMCS To: Vitaly Kuznetsov Cc: kvm list , "the arch/x86 maintainers" , Paolo Bonzini , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , "Michael Kelley (EOSG)" , Mohammed Gamal , Cathy Avery , Bandan Das , Roman Kagan , LKML , devel@linuxdriverproject.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1408 Lines: 32 You can change the default VMCS12_REVISION and associated layout, as long as support is maintained for the old layout and userspace has the ability (e.g. by setting the IA32_VMX_BASIC MSR) to specify that a VM needs to use the old layout. On Tue, Dec 19, 2017 at 4:25 AM, Vitaly Kuznetsov wrote: > Jim Mattson writes: > >> At this point in time, I don't think you can just blithely change the >> virtual VMCS layout and revision number. Existing VMs using the old >> layout and revision number must continue to work on versions of kvm >> past this point. You could tie the layout and revision number changes >> to KVM_CAP_HYPERV_ENLIGHTENED_VMCS if you like, but kvm must be able >> to continue to service VMs using the previous layout and revision >> number in perpetuity. >> > > I see what you mean. In case we need to keep migration of nested > workloads working between KVMs of different versions we can't (ever) > touch vmcs12. > > The way to go in this case, I think, is to create a completely separate > enlightened_vmcs12 struct and use it when appropriate. We can't possibly > support migrating workloads which use enlightened VMCS to an old KVM > which doesn't support it. > > P.S. "If there are changes in this struct, VMCS12_REVISION must be > changed." comment needs to be replaced with "Don't even think about > changing this" :-) > > -- > Vitaly