All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Alexander Graf <agraf@suse.de>
Cc: Stuart Yoder <stuart.yoder@freescale.com>,
	kvm-ppc@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH v11 8/8] PPC: Don't use hardcoded opcode for ePAPR hcall invocation
Date: Mon, 02 Jul 2012 17:16:13 +0000	[thread overview]
Message-ID: <4FF1D75D.4050507@freescale.com> (raw)
In-Reply-To: <440F1FF6-267A-452C-9665-274F684A1C93@suse.de>

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 <Yu.Liu@freescale.com>
>>>>
>>>> Signed-off-by: Liu Yu <yu.liu@freescale.com>
>>>> Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
>>>> ---
>>>> -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


WARNING: multiple messages have this Message-ID (diff)
From: Scott Wood <scottwood@freescale.com>
To: Alexander Graf <agraf@suse.de>
Cc: Stuart Yoder <stuart.yoder@freescale.com>,
	<kvm-ppc@vger.kernel.org>, <kvm@vger.kernel.org>
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	[thread overview]
Message-ID: <4FF1D75D.4050507@freescale.com> (raw)
In-Reply-To: <440F1FF6-267A-452C-9665-274F684A1C93@suse.de>

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 <Yu.Liu@freescale.com>
>>>>
>>>> Signed-off-by: Liu Yu <yu.liu@freescale.com>
>>>> Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
>>>> ---
>>>> -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

  reply	other threads:[~2012-07-02 17:16 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-22 20:06 [PATCH v11 8/8] PPC: Don't use hardcoded opcode for ePAPR hcall invocation Stuart Yoder
2012-06-22 20:06 ` Stuart Yoder
2012-07-02 12:30 ` Alexander Graf
2012-07-02 12:30   ` Alexander Graf
2012-07-02 17:10   ` Scott Wood
2012-07-02 17:10     ` Scott Wood
2012-07-02 17:13     ` Alexander Graf
2012-07-02 17:13       ` Alexander Graf
2012-07-02 17:16       ` Scott Wood [this message]
2012-07-02 17:16         ` Scott Wood
2012-07-02 17:17         ` Alexander Graf
2012-07-02 17:17           ` Alexander Graf
2012-07-02 17:25           ` Scott Wood
2012-07-02 17:25             ` Scott Wood
2012-07-02 17:34             ` Timur Tabi
2012-07-02 17:34               ` Timur Tabi
2012-07-02 17:43               ` Scott Wood
2012-07-02 17:43                 ` Scott Wood
2012-07-02 17:53                 ` Timur Tabi
2012-07-02 17:53                   ` Timur Tabi
2012-07-02 17:57                   ` Scott Wood
2012-07-02 17:57                     ` Scott Wood
2012-07-02 18:02                     ` Timur Tabi
2012-07-02 18:02                       ` Timur Tabi
2012-07-03 15:22             ` Yoder Stuart-B08248
2012-07-03 15:22               ` Yoder Stuart-B08248

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FF1D75D.4050507@freescale.com \
    --to=scottwood@freescale.com \
    --cc=agraf@suse.de \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=stuart.yoder@freescale.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.