qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] PSCI with mach-virt
@ 2013-10-21 13:47 Giridhar Maruthy
  2013-10-21 13:56 ` Peter Maydell
  0 siblings, 1 reply; 5+ messages in thread
From: Giridhar Maruthy @ 2013-10-21 13:47 UTC (permalink / raw)
  To: QEMU Developers, Peter Maydell

Hi,

I am using mach-virt in qemu on a kvm enabled host.

With 2 cpus, the guest fails to boot the second processor. Following
is the message.
CPU1: failed to boot: -22(-EINVAL)

The PSCI device nodes are anyway passed from virt.c file.
Is there anything extra that needs to be done to get 2 cpus working?

Thanks,
Giridhar

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] PSCI with mach-virt
  2013-10-21 13:47 [Qemu-devel] PSCI with mach-virt Giridhar Maruthy
@ 2013-10-21 13:56 ` Peter Maydell
  2013-10-22  4:30   ` Giridhar Maruthy
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Maydell @ 2013-10-21 13:56 UTC (permalink / raw)
  To: Giridhar Maruthy; +Cc: QEMU Developers

On 21 October 2013 14:47, Giridhar Maruthy <giridhar.maruthy@linaro.org> wrote:
> Hi,
>
> I am using mach-virt in qemu on a kvm enabled host.
>
> With 2 cpus, the guest fails to boot the second processor. Following
> is the message.
> CPU1: failed to boot: -22(-EINVAL)
>
> The PSCI device nodes are anyway passed from virt.c file.
> Is there anything extra that needs to be done to get 2 cpus working?

In theory it should work (it works for kvmtool and there is code
to support it in the qemu patches). However I haven't tested it
and it's quite possible it got accidentally broken in the course
of the various rebasings and rewritings the mach-virt patches
have gone through. Feel free to debug it :-)

thanks
-- PMM

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] PSCI with mach-virt
  2013-10-21 13:56 ` Peter Maydell
@ 2013-10-22  4:30   ` Giridhar Maruthy
  2013-10-23  6:28     ` Giridhar Maruthy
  0 siblings, 1 reply; 5+ messages in thread
From: Giridhar Maruthy @ 2013-10-22  4:30 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers

Thanks Peter, I will look into it.

Giridhar

On 21 October 2013 19:26, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 21 October 2013 14:47, Giridhar Maruthy <giridhar.maruthy@linaro.org> wrote:
>> Hi,
>>
>> I am using mach-virt in qemu on a kvm enabled host.
>>
>> With 2 cpus, the guest fails to boot the second processor. Following
>> is the message.
>> CPU1: failed to boot: -22(-EINVAL)
>>
>> The PSCI device nodes are anyway passed from virt.c file.
>> Is there anything extra that needs to be done to get 2 cpus working?
>
> In theory it should work (it works for kvmtool and there is code
> to support it in the qemu patches). However I haven't tested it
> and it's quite possible it got accidentally broken in the course
> of the various rebasings and rewritings the mach-virt patches
> have gone through. Feel free to debug it :-)
>
> thanks
> -- PMM

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] PSCI with mach-virt
  2013-10-22  4:30   ` Giridhar Maruthy
@ 2013-10-23  6:28     ` Giridhar Maruthy
  2013-10-23  7:05       ` Peter Maydell
  0 siblings, 1 reply; 5+ messages in thread
From: Giridhar Maruthy @ 2013-10-23  6:28 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers

Hi Peter,

I did compare with kvmtool and found that the below fix boots SMP in
mach-virt with qemu.

diff --git a/target-arm/kvm.c b/target-arm/kvm.c
index b92e00d..28b8e2b 100644
--- a/target-arm/kvm.c
+++ b/target-arm/kvm.c
@@ -82,6 +82,7 @@ int kvm_arch_init_vcpu(CPUState *cs)

     init.target = KVM_ARM_TARGET_CORTEX_A15;
     memset(init.features, 0, sizeof(init.features));
+    init.features[0] = (!!(kvm_arch_vcpu_id(cs)) << KVM_ARM_VCPU_POWER_OFF);
     ret = kvm_vcpu_ioctl(cs, KVM_ARM_VCPU_INIT, &init);
     if (ret) {
         return ret;


Thanks,
Giridhar


On 22 October 2013 10:00, Giridhar Maruthy <giridhar.maruthy@linaro.org> wrote:
> Thanks Peter, I will look into it.
>
> Giridhar
>
> On 21 October 2013 19:26, Peter Maydell <peter.maydell@linaro.org> wrote:
>> On 21 October 2013 14:47, Giridhar Maruthy <giridhar.maruthy@linaro.org> wrote:
>>> Hi,
>>>
>>> I am using mach-virt in qemu on a kvm enabled host.
>>>
>>> With 2 cpus, the guest fails to boot the second processor. Following
>>> is the message.
>>> CPU1: failed to boot: -22(-EINVAL)
>>>
>>> The PSCI device nodes are anyway passed from virt.c file.
>>> Is there anything extra that needs to be done to get 2 cpus working?
>>
>> In theory it should work (it works for kvmtool and there is code
>> to support it in the qemu patches). However I haven't tested it
>> and it's quite possible it got accidentally broken in the course
>> of the various rebasings and rewritings the mach-virt patches
>> have gone through. Feel free to debug it :-)
>>
>> thanks
>> -- PMM

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] PSCI with mach-virt
  2013-10-23  6:28     ` Giridhar Maruthy
@ 2013-10-23  7:05       ` Peter Maydell
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2013-10-23  7:05 UTC (permalink / raw)
  To: Giridhar Maruthy; +Cc: QEMU Developers, kvmarm@lists.cs.columbia.edu

On 23 October 2013 07:28, Giridhar Maruthy <giridhar.maruthy@linaro.org> wrote:
> I did compare with kvmtool and found that the below fix boots SMP in
> mach-virt with qemu.
>
> diff --git a/target-arm/kvm.c b/target-arm/kvm.c
> index b92e00d..28b8e2b 100644
> --- a/target-arm/kvm.c
> +++ b/target-arm/kvm.c
> @@ -82,6 +82,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
>
>      init.target = KVM_ARM_TARGET_CORTEX_A15;
>      memset(init.features, 0, sizeof(init.features));
> +    init.features[0] = (!!(kvm_arch_vcpu_id(cs)) << KVM_ARM_VCPU_POWER_OFF);
>      ret = kvm_vcpu_ioctl(cs, KVM_ARM_VCPU_INIT, &init);
>      if (ret) {
>          return ret;

Thanks for looking into this. We probably need to tweak this
a bit because the feature bit is only valid if the kernel supports
the KVM_ARM_CAP_PSCI capability, and we only want to do
this if we're using mach-virt rather than vexpress-a15, but we
certainly need to do something to set the "start powered down"
feature for CPUs after zero if we're using PSCI.

-- PMM

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-10-23  7:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-21 13:47 [Qemu-devel] PSCI with mach-virt Giridhar Maruthy
2013-10-21 13:56 ` Peter Maydell
2013-10-22  4:30   ` Giridhar Maruthy
2013-10-23  6:28     ` Giridhar Maruthy
2013-10-23  7:05       ` Peter Maydell

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).