From: Paolo Bonzini Subject: Re: [RFC 0/6] Enlightened VMCS support for KVM on Hyper-V Date: Tue, 16 Jan 2018 16:03:27 +0100 Message-ID: <8d36fd01-3974-aef4-3572-0745f284acba@redhat.com> References: <20180115173105.31845-1-vkuznets@redhat.com> <87inc2huux.fsf@vitty.brq.redhat.com> <87tvvlhplx.fsf@vitty.brq.redhat.com> <87po69hnir.fsf@vitty.brq.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: David Hildenbrand , Wanpeng Li , kvm , the arch/x86 maintainers , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , "Michael Kelley (EOSG)" , Mohammed Gamal , Cathy Avery , Bandan Das , linux-kernel@vger.kernel.org To: Vitaly Kuznetsov Return-path: In-Reply-To: <87po69hnir.fsf@vitty.brq.redhat.com> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 16/01/2018 15:43, Vitaly Kuznetsov wrote: > Paolo Bonzini writes: > >> On 16/01/2018 14:58, Vitaly Kuznetsov wrote: >>>> Haven't looked into the details, but we have to watch out for other >>>> VCPUs trying to modify that vmcs12. >>>> >>>> Basically because other VCPUs could try to modify values in vmcs12 while >>>> we are currently building vmcs02. Nasty races could result in us copying >>>> stuff (probably unchecked) into vmcs02 and therefore running something >>>> that was not intended. >>>> >>> I don't think we share VMCS among vCPUs, do we? >> >> VMCS is just memory, so who knows what a malicious L1 guest will do. >> But for vmread/vmwrite we can go through hypervisor memory, for >> enlightened VMCS we cannot. >> > > True; not sure if Hyper-V actually copies the data to some internal > storage, probably it does. TLFS explicitly forbids making the same > enlightened VMCS active on several vCPUs simultaneously but again, this > is just memory... You don't even need to make them active, you can just scribble on it simultaneously with a VMRESUME. Paolo