From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Guo Date: Tue, 30 Jan 2018 03:24:36 +0000 Subject: Re: [PATCH 23/26] KVM: PPC: Book3S PR: add emulation for tabort. for privilege guest Message-Id: <20180130032436.GJ3261@simonLocalRHEL7.x64> 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> <20180123094416.GO3924@fergus.ozlabs.ibm.com> In-Reply-To: <20180123094416.GO3924@fergus.ozlabs.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Paul Mackerras Cc: linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org Hi Paul, On Tue, Jan 23, 2018 at 08:44:16PM +1100, Paul Mackerras wrote: > 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. It is a leave over of my previous rework. Sorry and I will remove them. Thanks, - Simon From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-x242.google.com (mail-pf0-x242.google.com [IPv6:2607:f8b0:400e:c00::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3zVsF53hd3zDr6n for ; Tue, 30 Jan 2018 14:24:41 +1100 (AEDT) Received: by mail-pf0-x242.google.com with SMTP id k19so7429887pfj.5 for ; Mon, 29 Jan 2018 19:24:40 -0800 (PST) Date: Tue, 30 Jan 2018 11:24:36 +0800 From: Simon Guo To: Paul Mackerras Cc: linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org Subject: Re: [PATCH 23/26] KVM: PPC: Book3S PR: add emulation for tabort. for privilege guest Message-ID: <20180130032436.GJ3261@simonLocalRHEL7.x64> References: <1515665499-31710-1-git-send-email-wei.guo.simon@gmail.com> <1515665499-31710-24-git-send-email-wei.guo.simon@gmail.com> <20180123094416.GO3924@fergus.ozlabs.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20180123094416.GO3924@fergus.ozlabs.ibm.com> List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Hi Paul, On Tue, Jan 23, 2018 at 08:44:16PM +1100, Paul Mackerras wrote: > 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. It is a leave over of my previous rework. Sorry and I will remove them. Thanks, - Simon