From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Mon, 02 Jul 2012 17:16:13 +0000 Subject: Re: [PATCH v11 8/8] PPC: Don't use hardcoded opcode for ePAPR hcall invocation Message-Id: <4FF1D75D.4050507@freescale.com> List-Id: References: <1340395568-29620-1-git-send-email-stuart.yoder@freescale.com> <4FF1D618.5030207@freescale.com> <440F1FF6-267A-452C-9665-274F684A1C93@suse.de> In-Reply-To: <440F1FF6-267A-452C-9665-274F684A1C93@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Alexander Graf Cc: Stuart Yoder , kvm-ppc@vger.kernel.org, kvm@vger.kernel.org On 07/02/2012 12:13 PM, Alexander Graf wrote: > > On 02.07.2012, at 19:10, Scott Wood wrote: > >> On 07/02/2012 07:30 AM, Alexander Graf wrote: >>> >>> On 22.06.2012, at 22:06, Stuart Yoder wrote: >>> >>>> From: Liu Yu-B13201 >>>> >>>> Signed-off-by: Liu Yu >>>> Signed-off-by: Stuart Yoder >>>> --- >>>> -v11: no changes >>>> >>>> arch/powerpc/include/asm/epapr_hcalls.h | 22 +++++++++--------- >>>> arch/powerpc/include/asm/fsl_hcalls.h | 36 +++++++++++++++--------------- >>>> 2 files changed, 29 insertions(+), 29 deletions(-) >>>> >>>> diff --git a/arch/powerpc/include/asm/epapr_hcalls.h b/arch/powerpc/include/asm/epapr_hcalls.h >>>> index 833ce2c..b8d9445 100644 >>>> --- a/arch/powerpc/include/asm/epapr_hcalls.h >>>> +++ b/arch/powerpc/include/asm/epapr_hcalls.h >>>> @@ -195,7 +195,7 @@ static inline unsigned int ev_int_set_config(unsigned int interrupt, >>>> r5 = priority; >>>> r6 = destination; >>>> >>>> - __asm__ __volatile__ ("sc 1" >>>> + asm volatile("bl epapr_hypercall_start" >>>> : "+r" (r11), "+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6) >>>> : : EV_HCALL_CLOBBERS4 >>> >>> Hrm. ePAPR hypercalls are allowed to clobber lr, right? But our hypercall entry code depends on lr staying alive: >> >> ePAPR 1.1 says LR is nonvolatile. > > Why is it in the clobber list then? Because the inline assembly code is clobbering it -- not the hv-provided hcall instructions. -Scott From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Subject: Re: [PATCH v11 8/8] PPC: Don't use hardcoded opcode for ePAPR hcall invocation Date: Mon, 2 Jul 2012 12:16:13 -0500 Message-ID: <4FF1D75D.4050507@freescale.com> References: <1340395568-29620-1-git-send-email-stuart.yoder@freescale.com> <4FF1D618.5030207@freescale.com> <440F1FF6-267A-452C-9665-274F684A1C93@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Stuart Yoder , , To: Alexander Graf Return-path: In-Reply-To: <440F1FF6-267A-452C-9665-274F684A1C93@suse.de> Sender: kvm-ppc-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 07/02/2012 12:13 PM, Alexander Graf wrote: > > On 02.07.2012, at 19:10, Scott Wood wrote: > >> On 07/02/2012 07:30 AM, Alexander Graf wrote: >>> >>> On 22.06.2012, at 22:06, Stuart Yoder wrote: >>> >>>> From: Liu Yu-B13201 >>>> >>>> Signed-off-by: Liu Yu >>>> Signed-off-by: Stuart Yoder >>>> --- >>>> -v11: no changes >>>> >>>> arch/powerpc/include/asm/epapr_hcalls.h | 22 +++++++++--------- >>>> arch/powerpc/include/asm/fsl_hcalls.h | 36 +++++++++++++++--------------- >>>> 2 files changed, 29 insertions(+), 29 deletions(-) >>>> >>>> diff --git a/arch/powerpc/include/asm/epapr_hcalls.h b/arch/powerpc/include/asm/epapr_hcalls.h >>>> index 833ce2c..b8d9445 100644 >>>> --- a/arch/powerpc/include/asm/epapr_hcalls.h >>>> +++ b/arch/powerpc/include/asm/epapr_hcalls.h >>>> @@ -195,7 +195,7 @@ static inline unsigned int ev_int_set_config(unsigned int interrupt, >>>> r5 = priority; >>>> r6 = destination; >>>> >>>> - __asm__ __volatile__ ("sc 1" >>>> + asm volatile("bl epapr_hypercall_start" >>>> : "+r" (r11), "+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6) >>>> : : EV_HCALL_CLOBBERS4 >>> >>> Hrm. ePAPR hypercalls are allowed to clobber lr, right? But our hypercall entry code depends on lr staying alive: >> >> ePAPR 1.1 says LR is nonvolatile. > > Why is it in the clobber list then? Because the inline assembly code is clobbering it -- not the hv-provided hcall instructions. -Scott