From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vitaly Kuznetsov Subject: Re: [PATCH v3 7/7] x86/kvm: use Enlightened VMCS when running on Hyper-V Date: Thu, 15 Mar 2018 19:04:35 +0100 Message-ID: <87sh919pvw.fsf@vitty.brq.redhat.com> References: <20180309140249.2840-1-vkuznets@redhat.com> <20180309140249.2840-8-vkuznets@redhat.com> <2747cc75-b549-61bb-9c1b-0f554a49b536@redhat.com> <87zi399xih.fsf@vitty.brq.redhat.com> <20180315170202.GA5180@flask> <20180315172852.GA21667@flask> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: Paolo Bonzini , kvm@vger.kernel.org, x86@kernel.org, "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , "Michael Kelley \(EOSG\)" , Mohammed Gamal , Cathy Avery , Bandan Das , linux-kernel@vger.kernel.org To: Radim =?utf-8?B?S3LEjW3DocWZ?= Return-path: In-Reply-To: <20180315172852.GA21667@flask> ("Radim \=\?utf-8\?B\?S3LEjW3DocWZ\?\= \=\?utf-8\?B\?Iidz\?\= message of "Thu, 15 Mar 2018 18:28:52 +0100") Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org Radim Krčmář writes: > 2018-03-15 18:02+0100, Radim Krčmář: >> We actually already have mov in the assembly: >> >> "cmp %%" _ASM_SP ", %c[host_rsp](%0) \n\t" > > Oh hell, I didn't pay attention to this line before. > This is still going to work if we conditionally replace it with pointer to evmcs as you suggested before but ... >> "je 1f \n\t" >> "mov %%" _ASM_SP ", %c[host_rsp](%0) \n\t" // here >> __ex(ASM_VMX_VMWRITE_RSP_RDX) "\n\t" > > I bet this path is executed only once in VM's lifetime and what we're > doing is wasting more resources than we're ever going to save ... > yes, we're not gonna save anything... -- Vitaly