From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 15/27] nVMX: Prepare vmcs02 from vmcs01 and vmcs12 Date: Tue, 08 Feb 2011 14:27:59 +0200 Message-ID: <4D5136CF.8020509@redhat.com> References: <1287309814-nyh@il.ibm.com> <201010171011.o9HABFP1029474@rice.haifa.ibm.com> <4CBB037A.2050906@redhat.com> <20110208121315.GA28897@fermat.math.technion.ac.il> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, gleb@redhat.com To: "Nadav Har'El" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:50627 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751603Ab1BHM2F (ORCPT ); Tue, 8 Feb 2011 07:28:05 -0500 In-Reply-To: <20110208121315.GA28897@fermat.math.technion.ac.il> Sender: kvm-owner@vger.kernel.org List-ID: On 02/08/2011 02:13 PM, Nadav Har'El wrote: > But while doing this, I came across a question that I wonder if you can > clarify for me: > > Among the other things it sets up, vmx_vcpu_setup() sets > > rdmsrl(MSR_IA32_SYSENTER_ESP, a); > vmcs_writel(HOST_IA32_SYSENTER_ESP, a); /* 22.2.3 */ > > Why is this needed here? It's not needed here. > In vmx_vcpu_load(), when a cpu is known (or changed), > we again have: > > rdmsrl(MSR_IA32_SYSENTER_ESP, sysenter_esp); > vmcs_writel(HOST_IA32_SYSENTER_ESP, sysenter_esp); /* 22.2.3 */ > > So isn't the first setting, in vmx_vcpu_setup(), redundant? It is. It's just historical baggage - these lines were introduced about 20 commits into kvm development (af9d6e204919016ca in qemu-kvm.git) and never removed, even after it was fixed to be per-cpu. -- error compiling committee.c: too many arguments to function