From: Scott Wood <scottwood@freescale.com>
To: Alexander Graf <agraf@suse.de>
Cc: Liu Yu <yu.liu@freescale.com>,
"<kvm-ppc@vger.kernel.org>" <kvm-ppc@vger.kernel.org>,
"<kvm@vger.kernel.org>" <kvm@vger.kernel.org>,
"<galak@kernel.crashing.org>" <galak@kernel.crashing.org>,
"<timur@freescale.com>" <timur@freescale.com>,
Stuart Yoder <stuart.yoder@freescale.com>
Subject: Re: [PATCH v2 2/3] KVM: PPC: epapr: Add idle hcall support for host
Date: Mon, 09 Jan 2012 22:33:48 +0000 [thread overview]
Message-ID: <4F0B6B4C.6060807@freescale.com> (raw)
In-Reply-To: <0B119CAB-EC8E-4EAC-9CFC-0548758C7080@suse.de>
On 01/09/2012 02:18 PM, Alexander Graf wrote:
>
>
> Am 09.01.2012 um 21:00 schrieb Scott Wood <scottwood@freescale.com>:
>
>> On 01/09/2012 08:15 AM, Alexander Graf wrote:
>>>
>>> On 05.01.2012, at 10:07, Liu Yu wrote:
>>>
>>>> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
>>>> index c33f6a7..1242ee1 100644
>>>> --- a/arch/powerpc/kvm/powerpc.c
>>>> +++ b/arch/powerpc/kvm/powerpc.c
>>>> @@ -81,6 +81,10 @@ int kvmppc_kvm_pv(struct kvm_vcpu *vcpu)
>>>>
>>>> /* Second return value is in r4 */
>>>> break;
>>>> + case HC_VENDOR_EPAPR | HC_EV_IDLE:
>>>> + r = HC_EV_SUCCESS;
>>>> + kvm_vcpu_block(vcpu);
>>>
>>> Hrm. This will return on signal. So if the guest sends an idle hcall,
>>> then user space gets a random signal, we'll continue executing the
>>> guest CPU, getting us out of idle even though the guest didn't expect
>>> it, since the guest really wants to get an interrupt after the idle
>>> hcall.
>>
>> The ePAPR description of this hcall is a little vague (Stuart, put on
>> list to fix in next ePAPR revision?), but this is expected. It will
>> also be the case if a guest directly uses the wait instruction. Guests
>> must be able to deal with spurious wakeups.
>
> The wait instruction does get executed in an infinite loop though, while this hcall is only executed once.
Yes, I pointed that out as something that needs to be fixed in the
ev_idle patch.
-Scott
WARNING: multiple messages have this Message-ID (diff)
From: Scott Wood <scottwood@freescale.com>
To: Alexander Graf <agraf@suse.de>
Cc: Liu Yu <yu.liu@freescale.com>,
"<kvm-ppc@vger.kernel.org>" <kvm-ppc@vger.kernel.org>,
"<kvm@vger.kernel.org>" <kvm@vger.kernel.org>,
"<galak@kernel.crashing.org>" <galak@kernel.crashing.org>,
"<timur@freescale.com>" <timur@freescale.com>,
Stuart Yoder <stuart.yoder@freescale.com>
Subject: Re: [PATCH v2 2/3] KVM: PPC: epapr: Add idle hcall support for host
Date: Mon, 9 Jan 2012 16:33:48 -0600 [thread overview]
Message-ID: <4F0B6B4C.6060807@freescale.com> (raw)
In-Reply-To: <0B119CAB-EC8E-4EAC-9CFC-0548758C7080@suse.de>
On 01/09/2012 02:18 PM, Alexander Graf wrote:
>
>
> Am 09.01.2012 um 21:00 schrieb Scott Wood <scottwood@freescale.com>:
>
>> On 01/09/2012 08:15 AM, Alexander Graf wrote:
>>>
>>> On 05.01.2012, at 10:07, Liu Yu wrote:
>>>
>>>> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
>>>> index c33f6a7..1242ee1 100644
>>>> --- a/arch/powerpc/kvm/powerpc.c
>>>> +++ b/arch/powerpc/kvm/powerpc.c
>>>> @@ -81,6 +81,10 @@ int kvmppc_kvm_pv(struct kvm_vcpu *vcpu)
>>>>
>>>> /* Second return value is in r4 */
>>>> break;
>>>> + case HC_VENDOR_EPAPR | HC_EV_IDLE:
>>>> + r = HC_EV_SUCCESS;
>>>> + kvm_vcpu_block(vcpu);
>>>
>>> Hrm. This will return on signal. So if the guest sends an idle hcall,
>>> then user space gets a random signal, we'll continue executing the
>>> guest CPU, getting us out of idle even though the guest didn't expect
>>> it, since the guest really wants to get an interrupt after the idle
>>> hcall.
>>
>> The ePAPR description of this hcall is a little vague (Stuart, put on
>> list to fix in next ePAPR revision?), but this is expected. It will
>> also be the case if a guest directly uses the wait instruction. Guests
>> must be able to deal with spurious wakeups.
>
> The wait instruction does get executed in an infinite loop though, while this hcall is only executed once.
Yes, I pointed that out as something that needs to be fixed in the
ev_idle patch.
-Scott
next prev parent reply other threads:[~2012-01-09 22:33 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-05 9:07 [PATCH v2 2/3] KVM: PPC: epapr: Add idle hcall support for host Liu Yu
2012-01-05 9:07 ` Liu Yu
2012-01-09 14:15 ` Alexander Graf
2012-01-09 14:15 ` Alexander Graf
2012-01-09 16:04 ` Yoder Stuart-B08248
2012-01-09 16:04 ` Yoder Stuart-B08248
2012-01-09 16:07 ` Alexander Graf
2012-01-09 16:07 ` Alexander Graf
2012-01-09 22:41 ` Yoder Stuart-B08248
2012-01-09 22:41 ` Yoder Stuart-B08248
2012-01-09 22:51 ` Alexander Graf
2012-01-09 22:51 ` Alexander Graf
2012-01-09 20:00 ` Scott Wood
2012-01-09 20:00 ` Scott Wood
2012-01-09 20:18 ` Alexander Graf
2012-01-09 20:18 ` Alexander Graf
2012-01-09 22:33 ` Scott Wood [this message]
2012-01-09 22:33 ` 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=4F0B6B4C.6060807@freescale.com \
--to=scottwood@freescale.com \
--cc=agraf@suse.de \
--cc=galak@kernel.crashing.org \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=stuart.yoder@freescale.com \
--cc=timur@freescale.com \
--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 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.