From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Aneesh Kumar K.V" Subject: Re: [PATCH 04/23] KVM: PPC: Book3S PR: Keep volatile reg values in vcpu rather than shadow_vcpu Date: Sun, 11 Aug 2013 16:36:38 +0530 Message-ID: <87bo54sczl.fsf@linux.vnet.ibm.com> References: <20130806041259.GF19254@iris.ozlabs.ibm.com> <20130806041627.GJ19254@iris.ozlabs.ibm.com> Mime-Version: 1.0 Content-Type: text/plain Cc: kvm-ppc@vger.kernel.org, kvm@vger.kernel.org To: Paul Mackerras , Alexander Graf , Benjamin Herrenschmidt Return-path: In-Reply-To: <20130806041627.GJ19254@iris.ozlabs.ibm.com> Sender: kvm-ppc-owner@vger.kernel.org List-Id: kvm.vger.kernel.org Paul Mackerras writes: > Currently PR-style KVM keeps the volatile guest register values > (R0 - R13, CR, LR, CTR, XER, PC) in a shadow_vcpu struct rather than > the main kvm_vcpu struct. For 64-bit, the shadow_vcpu exists in two > places, a kmalloc'd struct and in the PACA, and it gets copied back > and forth in kvmppc_core_vcpu_load/put(), because the real-mode code > can't rely on being able to access the kmalloc'd struct. > > This changes the code to copy the volatile values into the shadow_vcpu > as one of the last things done before entering the guest. Similarly > the values are copied back out of the shadow_vcpu to the kvm_vcpu > immediately after exiting the guest. We arrange for interrupts to be > still disabled at this point so that we can't get preempted on 64-bit > and end up copying values from the wrong PACA. Can we remove kvmppc_vcpu_book3s.shadow_vcpu in this patch ? Do we still use the kmalloc'd shadow_vcpu ? -aneesh