linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Alexander Graf <agraf@suse.de>
Cc: "<linuxppc-dev@ozlabs.org>" <linuxppc-dev@ozlabs.org>,
	Liu Yu <yu.liu@freescale.com>,
	"<kvm@vger.kernel.org>" <kvm@vger.kernel.org>,
	"<kvm-ppc@vger.kernel.org>" <kvm-ppc@vger.kernel.org>,
	"<B07421@freescale.com>" <B07421@freescale.com>
Subject: Re: [PATCH v4 3/3] KVM: PPC: epapr: install ev_idle hcall for e500 guest
Date: Thu, 16 Feb 2012 11:28:26 -0600	[thread overview]
Message-ID: <4F3D3CBA.2060201@freescale.com> (raw)
In-Reply-To: <9A00D501-8965-478F-8356-6199F5572600@suse.de>

On 02/16/2012 11:18 AM, Alexander Graf wrote:
> 
> On 16.02.2012, at 17:58, Scott Wood wrote:
> 
>> On 02/16/2012 04:24 AM, Alexander Graf wrote:
>>> On 16.02.2012, at 10:26, Liu Yu <yu.liu@freescale.com> wrote:
>>>> +_GLOBAL(epapr_ev_idle)
>>>> +epapr_ev_idle:
>>>> +    rlwinm    r3,r1,0,0,31-THREAD_SHIFT    /* current thread_info */
>>>> +    lwz    r4,TI_LOCAL_FLAGS(r3)    /* set napping bit */
>>>> +    ori    r4,r4,_TLF_NAPPING    /* so when we take an exception */
>>>> +    stw    r4,TI_LOCAL_FLAGS(r3)    /* it will return to our caller */
>>>> +
>>>> +    wrteei    1
>>>> +
>>>> +idle_loop:
>>>> +    LOAD_REG_IMMEDIATE(r11, HC_VENDOR_EPAPR | HC_EV_IDLE)
>>>> +
>>>> +.global epapr_ev_idle_start
>>>> +epapr_ev_idle_start:
>>>> +    li    r3, -1
>>>> +    nop
>>>> +    nop
>>>> +    nop
>>>
>>> Can't you just bl into epapr_hypercall_start? You don't even have to save the old lr. because we never return anyways :)
>>
>> The interrupt will branch to LR, so no, we can't trash it or put it
>> anywhere else.
> 
> Hrm. But we can clobber ctr, right? So how about we make the generic version do a bctr and then just do a small C wrapper that takes lr, moves it to ctr and branches to the generic one?

If it's just for this, I would say don't mess with the normal hcall path
for the sake of idle.  If using CTR would let us get away without
creating a stack frame in call sites, maybe that would be worthwhile,
depending on what sort of hcalls we end up having.

> Then we don't have to replicate the hypercall code all over again for every invocation.

We shouldn't need to do it for every invocation.  Idle is special due to
the TLF_NAPPING hack.

-Scott

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

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-16  9:26 [PATCH v4 1/3] KVM: PPC: epapr: Factor out the epapr init Liu Yu
2012-02-16  9:26 ` [PATCH v4 2/3] KVM: PPC: epapr: Add idle hcall support for host Liu Yu
2012-02-16  9:26   ` [PATCH v4 3/3] KVM: PPC: epapr: install ev_idle hcall for e500 guest Liu Yu
2012-02-16 10:24     ` Alexander Graf
2012-02-16 16:58       ` Scott Wood
2012-02-16 17:18         ` Alexander Graf
2012-02-16 17:28           ` Scott Wood [this message]
2012-02-16 17:30             ` Alexander Graf
2012-02-16 17:36               ` Scott Wood
2012-02-16 17:39                 ` Alexander Graf
2012-02-16 17:14     ` Scott Wood
2012-02-16 10:20   ` [PATCH v4 2/3] KVM: PPC: epapr: Add idle hcall support for host Alexander Graf
2012-02-17  2:13     ` Liu Yu-B13201
2012-02-17  2:20       ` Alexander Graf
2012-02-16 10:17 ` [PATCH v4 1/3] KVM: PPC: epapr: Factor out the epapr init Alexander Graf
2012-02-16 17:13 ` Scott Wood
2012-02-17 10:03   ` Liu Yu-B13201
2012-02-17 18:58     ` Scott Wood

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=4F3D3CBA.2060201@freescale.com \
    --to=scottwood@freescale.com \
    --cc=B07421@freescale.com \
    --cc=agraf@suse.de \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=yu.liu@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).