From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Mackerras Subject: Re: [PATCH 23/26] KVM: PPC: Book3S PR: add emulation for tabort. for privilege guest Date: Tue, 23 Jan 2018 20:44:16 +1100 Message-ID: <20180123094416.GO3924@fergus.ozlabs.ibm.com> References: <1515665499-31710-1-git-send-email-wei.guo.simon@gmail.com> <1515665499-31710-24-git-send-email-wei.guo.simon@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org To: wei.guo.simon@gmail.com Return-path: Received: from ozlabs.org ([103.22.144.67]:37131 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751154AbeAWJo3 (ORCPT ); Tue, 23 Jan 2018 04:44:29 -0500 Content-Disposition: inline In-Reply-To: <1515665499-31710-24-git-send-email-wei.guo.simon@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Jan 11, 2018 at 06:11:36PM +0800, wei.guo.simon@gmail.com wrote: > From: Simon Guo > > Currently privilege guest will be run with TM disabled. > > Although the privilege guest cannot initiate a new transaction, > it can use tabort to terminate its problem state's transaction. > So it is still necessary to emulate tabort. for privilege guest. > > This patch adds emulation for tabort. of privilege guest. > > Tested with: > https://github.com/justdoitqd/publicFiles/blob/master/test_tabort.c > > Signed-off-by: Simon Guo > --- > arch/powerpc/include/asm/kvm_book3s.h | 1 + > arch/powerpc/kvm/book3s_emulate.c | 31 +++++++++++++++++++++++++++++++ > arch/powerpc/kvm/book3s_pr.c | 2 +- > 3 files changed, 33 insertions(+), 1 deletion(-) > > diff --git a/arch/powerpc/include/asm/kvm_book3s.h b/arch/powerpc/include/asm/kvm_book3s.h > index 524cd82..8bd454c 100644 > --- a/arch/powerpc/include/asm/kvm_book3s.h > +++ b/arch/powerpc/include/asm/kvm_book3s.h > @@ -258,6 +258,7 @@ extern void kvmppc_copy_from_svcpu(struct kvm_vcpu *vcpu, > void kvmppc_save_tm_pr(struct kvm_vcpu *vcpu); > void kvmppc_restore_tm_pr(struct kvm_vcpu *vcpu); > void kvmppc_restore_tm_sprs(struct kvm_vcpu *vcpu); > +void kvmppc_save_tm_sprs(struct kvm_vcpu *vcpu); Why do you add this declaration, and change it from "static inline" to "inline" below, when this patch doesn't use it? Also, making it "inline" is pointless if it has a caller outside the source file where it's defined (if gcc wants to inline uses of it inside the same source file, it will do so anyway even without the "inline" keyword.) Paul. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Mackerras Date: Tue, 23 Jan 2018 09:44:16 +0000 Subject: Re: [PATCH 23/26] KVM: PPC: Book3S PR: add emulation for tabort. for privilege guest Message-Id: <20180123094416.GO3924@fergus.ozlabs.ibm.com> List-Id: References: <1515665499-31710-1-git-send-email-wei.guo.simon@gmail.com> <1515665499-31710-24-git-send-email-wei.guo.simon@gmail.com> In-Reply-To: <1515665499-31710-24-git-send-email-wei.guo.simon@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: wei.guo.simon@gmail.com Cc: linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org On Thu, Jan 11, 2018 at 06:11:36PM +0800, wei.guo.simon@gmail.com wrote: > From: Simon Guo > > Currently privilege guest will be run with TM disabled. > > Although the privilege guest cannot initiate a new transaction, > it can use tabort to terminate its problem state's transaction. > So it is still necessary to emulate tabort. for privilege guest. > > This patch adds emulation for tabort. of privilege guest. > > Tested with: > https://github.com/justdoitqd/publicFiles/blob/master/test_tabort.c > > Signed-off-by: Simon Guo > --- > arch/powerpc/include/asm/kvm_book3s.h | 1 + > arch/powerpc/kvm/book3s_emulate.c | 31 +++++++++++++++++++++++++++++++ > arch/powerpc/kvm/book3s_pr.c | 2 +- > 3 files changed, 33 insertions(+), 1 deletion(-) > > diff --git a/arch/powerpc/include/asm/kvm_book3s.h b/arch/powerpc/include/asm/kvm_book3s.h > index 524cd82..8bd454c 100644 > --- a/arch/powerpc/include/asm/kvm_book3s.h > +++ b/arch/powerpc/include/asm/kvm_book3s.h > @@ -258,6 +258,7 @@ extern void kvmppc_copy_from_svcpu(struct kvm_vcpu *vcpu, > void kvmppc_save_tm_pr(struct kvm_vcpu *vcpu); > void kvmppc_restore_tm_pr(struct kvm_vcpu *vcpu); > void kvmppc_restore_tm_sprs(struct kvm_vcpu *vcpu); > +void kvmppc_save_tm_sprs(struct kvm_vcpu *vcpu); Why do you add this declaration, and change it from "static inline" to "inline" below, when this patch doesn't use it? Also, making it "inline" is pointless if it has a caller outside the source file where it's defined (if gcc wants to inline uses of it inside the same source file, it will do so anyway even without the "inline" keyword.) Paul.