QEMU-Devel Archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Could not boot a guest vm from kvm mode based on APM X-Gene Host and latest qemu
@ 2015-09-15  0:03 liang yan
  2015-09-16  9:24 ` Tushar Jagad
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: liang yan @ 2015-09-15  0:03 UTC (permalink / raw
  To: qemu-devel

Hello, All,

I am trying to enable kvm for a guest vm on an APM X-Gene Host with 
latest qemu, but could not make it work.

The host is APM X-Gene 8-core, Linux kernel is 4.1.0-rc7-1-arm64,

Guest kernel is linux-3.16rc3

QEMU is latest version

Host has these dmesg info
[    2.708259] kvm [1]: GICH base=0x780c0000, GICV base=0x780e0000, IRQ=25
[    2.708327] kvm [1]: timer IRQ30
[    2.708335] kvm [1]: Hyp mode initialized successfully

Host has dev/kvm.

command-line is
aarch64-softmmu/qemu-system-aarch64 -machine virt,kernel_irqchip=off 
-cpu cortex-a57 -machine accel=kvm -nographic -smp 1 -m 2048 -kernel 
aarch64-linux-3.16rc3-buildroot.img  --append "console=ttyAMA0"


when using cpu "cortex-a57", got the error "kvm_init_vcpu failed: 
Invalid argument"
when using cpu "host", got the error "Failed to retrieve host CPU features!"

By the way, all the command line works well under "tcg" mode.
Anyone has a quick idea? Thanks in advance.

Best,
Liang

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

* Re: [Qemu-devel] Could not boot a guest vm from kvm mode based on APM X-Gene Host and latest qemu
  2015-09-15  0:03 [Qemu-devel] Could not boot a guest vm from kvm mode based on APM X-Gene Host and latest qemu liang yan
@ 2015-09-16  9:24 ` Tushar Jagad
  2015-09-16 23:32   ` liang yan
  2015-09-16  9:55 ` Peter Maydell
  2015-09-16 14:34 ` Alex Bennée
  2 siblings, 1 reply; 9+ messages in thread
From: Tushar Jagad @ 2015-09-16  9:24 UTC (permalink / raw
  To: liang yan; +Cc: qemu-devel

Hi,

On Mon, Sep 14, 2015 at 06:03:48PM -0600, liang yan wrote:
> Hello, All,
>
> I am trying to enable kvm for a guest vm on an APM X-Gene Host with
> latest qemu, but could not make it work.
>
> The host is APM X-Gene 8-core, Linux kernel is 4.1.0-rc7-1-arm64,
>
> Guest kernel is linux-3.16rc3
>
> QEMU is latest version
>
> Host has these dmesg info
> [    2.708259] kvm [1]: GICH base=0x780c0000, GICV base=0x780e0000, IRQ=25
> [    2.708327] kvm [1]: timer IRQ30
> [    2.708335] kvm [1]: Hyp mode initialized successfully
>
> Host has dev/kvm.
>
> command-line is
> aarch64-softmmu/qemu-system-aarch64 -machine virt,kernel_irqchip=off
> -cpu cortex-a57 -machine accel=kvm -nographic -smp 1 -m 2048 -kernel
> aarch64-linux-3.16rc3-buildroot.img  --append "console=ttyAMA0"
>
>
> when using cpu "cortex-a57", got the error "kvm_init_vcpu failed:
> Invalid argument"

Currently, it is not possible to run qemu with a cpu type other than the
host. I'm currently in the process of adding the necessary support and
have posted the necessary RFC patches for kvm[1] and qemu[2].

[1] http://comments.gmane.org/gmane.linux.ports.arm.kernel/438744
[2] https://lists.gnu.org/archive/html/qemu-devel/2015-09/msg02374.html
--
Regards,
Tushar

> when using cpu "host", got the error "Failed to retrieve host CPU features!"
>
> By the way, all the command line works well under "tcg" mode.
> Anyone has a quick idea? Thanks in advance.
>
> Best,
> Liang
>
>

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

* Re: [Qemu-devel] Could not boot a guest vm from kvm mode based on APM X-Gene Host and latest qemu
  2015-09-15  0:03 [Qemu-devel] Could not boot a guest vm from kvm mode based on APM X-Gene Host and latest qemu liang yan
  2015-09-16  9:24 ` Tushar Jagad
@ 2015-09-16  9:55 ` Peter Maydell
  2015-09-16 14:34 ` Alex Bennée
  2 siblings, 0 replies; 9+ messages in thread
From: Peter Maydell @ 2015-09-16  9:55 UTC (permalink / raw
  To: liang yan; +Cc: QEMU Developers

On 15 September 2015 at 01:03, liang yan <liangy@hpe.com> wrote:
> Hello, All,
>
> I am trying to enable kvm for a guest vm on an APM X-Gene Host with latest
> qemu, but could not make it work.
>
> The host is APM X-Gene 8-core, Linux kernel is 4.1.0-rc7-1-arm64,
>
> Guest kernel is linux-3.16rc3
>
> QEMU is latest version
>
> Host has these dmesg info
> [    2.708259] kvm [1]: GICH base=0x780c0000, GICV base=0x780e0000, IRQ=25
> [    2.708327] kvm [1]: timer IRQ30
> [    2.708335] kvm [1]: Hyp mode initialized successfully
>
> Host has dev/kvm.
>
> command-line is
> aarch64-softmmu/qemu-system-aarch64 -machine virt,kernel_irqchip=off -cpu
> cortex-a57 -machine accel=kvm -nographic -smp 1 -m 2048 -kernel
> aarch64-linux-3.16rc3-buildroot.img  --append "console=ttyAMA0"
>
>
> when using cpu "cortex-a57", got the error "kvm_init_vcpu failed: Invalid
> argument"
> when using cpu "host", got the error "Failed to retrieve host CPU features!"

-cpu host is the correct option here (as Tushar says, specifying
a CPU other than the one your host has won't work until the
functionality he's working on is done).

The error message you get when you try '-cpu host' indicates that
kvm_arm_get_host_cpu_features() failed. That function
really just does a "create scratch VM", so it is exercising the
basic kernel "create VM" operations. It (and the function
kvm_arm_create_scratch_host_vcpu() that it calls) are fairly
short and simple, so I would suggest either singlestepping
through them with a debugger or adding diagnostic printfs
to find out which system call is failing.

My gut feeling is that this is a bug or missing feature in your
host kernel.

thanks
-- PMM

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

* Re: [Qemu-devel] Could not boot a guest vm from kvm mode based on APM X-Gene Host and latest qemu
  2015-09-15  0:03 [Qemu-devel] Could not boot a guest vm from kvm mode based on APM X-Gene Host and latest qemu liang yan
  2015-09-16  9:24 ` Tushar Jagad
  2015-09-16  9:55 ` Peter Maydell
@ 2015-09-16 14:34 ` Alex Bennée
  2015-09-16 15:29   ` Marc Zyngier
                     ` (2 more replies)
  2 siblings, 3 replies; 9+ messages in thread
From: Alex Bennée @ 2015-09-16 14:34 UTC (permalink / raw
  To: liang yan; +Cc: Marc Zyngier, qemu-devel, Christoffer Dall, kvmarm


liang yan <liangy@hpe.com> writes:

> Hello, All,
>
> I am trying to enable kvm for a guest vm on an APM X-Gene Host with 
> latest qemu, but could not make it work.
>
> The host is APM X-Gene 8-core, Linux kernel is 4.1.0-rc7-1-arm64,
>
> Guest kernel is linux-3.16rc3
>
> QEMU is latest version
>
> Host has these dmesg info
> [    2.708259] kvm [1]: GICH base=0x780c0000, GICV base=0x780e0000, IRQ=25
> [    2.708327] kvm [1]: timer IRQ30
> [    2.708335] kvm [1]: Hyp mode initialized successfully
>
> Host has dev/kvm.
>
> command-line is
> aarch64-softmmu/qemu-system-aarch64 -machine virt,kernel_irqchip=off 
> -cpu cortex-a57 -machine accel=kvm -nographic -smp 1 -m 2048 -kernel 
> aarch64-linux-3.16rc3-buildroot.img  --append "console=ttyAMA0"

I thought I recognised one of my images ;-)

Why are you running with kernel_irqchip=off?

Without it I can boot the image fine on my APM running 4.3.0-rc1-ajb but
with it I helpfully seg the kernel:

[16035.990518] Bad mode in Synchronous Abort handler detected, code 0x86000006 -- IABT (current EL)
[16035.997970] CPU: 1 PID: 21328 Comm: qemu-system-aar Not tainted 4.3.0-rc1-ajb #446
[16036.004203] Hardware name: APM X-Gene Mustang board (DT)
[16036.008191] task: ffffffc3ecea8000 ti: ffffffc3d8078000 task.ti: ffffffc3d8078000
[16036.014338] PC is at 0x0
[16036.015564] LR is at kvm_vgic_map_resources+0x30/0x3c
[16036.019291] pc : [<0000000000000000>] lr : [<ffffffc0000ae900>] pstate: 00000145
[16036.025350] sp : ffffffc3d807bb20
[16036.027348] x29: ffffffc3d807bb20 x28: ffffffc3d8078000 
[16036.031355] x27: ffffffc000642000 x26: 000000000000001d 
[16036.035361] x25: 000000000000011b x24: ffffffc3d80c1000 
[16036.039368] x23: 0000000000000000 x22: 0000000000000000 
[16036.043374] x21: ffffffc0fa240000 x20: ffffffc0fa807800 
[16036.047380] x19: ffffffc0fa807800 x18: 0000007f97af20e0 
[16036.051387] x17: 0000007f99c44810 x16: ffffffc0001fb030 
[16036.055394] x15: 0000007f99cc9588 x14: 0000000000922000 
[16036.059401] x13: 000000000097eb80 x12: 00000000004de0f0 
[16036.063406] x11: 0000000000000038 x10: 00000000ffffffff 
[16036.067413] x9 : 0000007f97af2480 x8 : 0000000000000050 
[16036.071419] x7 : ffffffc3ec24c840 x6 : 0000000000000000 
[16036.075424] x5 : 0000000000000003 x4 : ffffffc3ece72080 
[16036.079430] x3 : ffffffc3ece72080 x2 : 0000000000000000 
[16036.083436] x1 : ffffffc000a26260 x0 : ffffffc0fa807800 

[16036.087628] Internal error: Oops - bad mode: 0 [#1] SMP
[16036.091528] Modules linked in:
[16036.093278] CPU: 1 PID: 21328 Comm: qemu-system-aar Not tainted 4.3.0-rc1-ajb #446
[16036.099510] Hardware name: APM X-Gene Mustang board (DT)
[16036.103497] task: ffffffc3ecea8000 ti: ffffffc3d8078000 task.ti: ffffffc3d8078000
[16036.109642] PC is at 0x0
[16036.110864] LR is at kvm_vgic_map_resources+0x30/0x3c
[16036.114590] pc : [<0000000000000000>] lr : [<ffffffc0000ae900>] pstate: 00000145
[16036.120649] sp : ffffffc3d807bb20
[16036.122648] x29: ffffffc3d807bb20 x28: ffffffc3d8078000 
[16036.126654] x27: ffffffc000642000 x26: 000000000000001d 
[16036.130659] x25: 000000000000011b x24: ffffffc3d80c1000 
[16036.134666] x23: 0000000000000000 x22: 0000000000000000 
[16036.138671] x21: ffffffc0fa240000 x20: ffffffc0fa807800 
[16036.142678] x19: ffffffc0fa807800 x18: 0000007f97af20e0 
[16036.146685] x17: 0000007f99c44810 x16: ffffffc0001fb030 
[16036.150690] x15: 0000007f99cc9588 x14: 0000000000922000 
[16036.154696] x13: 000000000097eb80 x12: 00000000004de0f0 
[16036.158701] x11: 0000000000000038 x10: 00000000ffffffff 
[16036.162706] x9 : 0000007f97af2480 x8 : 0000000000000050 
[16036.166712] x7 : ffffffc3ec24c840 x6 : 0000000000000000 
[16036.170719] x5 : 0000000000000003 x4 : ffffffc3ece72080 
[16036.174725] x3 : ffffffc3ece72080 x2 : 0000000000000000 
[16036.178731] x1 : ffffffc000a26260 x0 : ffffffc0fa807800 

>
>
> when using cpu "cortex-a57", got the error "kvm_init_vcpu failed: 
> Invalid argument"
> when using cpu "host", got the error "Failed to retrieve host CPU features!"
>
> By the way, all the command line works well under "tcg" mode.
> Anyone has a quick idea? Thanks in advance.
>
> Best,
> Liang

-- 
Alex Bennée

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

* Re: [Qemu-devel] Could not boot a guest vm from kvm mode based on APM X-Gene Host and latest qemu
  2015-09-16 14:34 ` Alex Bennée
@ 2015-09-16 15:29   ` Marc Zyngier
  2015-09-16 17:33   ` Marc Zyngier
  2015-09-17  0:02   ` liang yan
  2 siblings, 0 replies; 9+ messages in thread
From: Marc Zyngier @ 2015-09-16 15:29 UTC (permalink / raw
  To: Alex Bennée, liang yan; +Cc: qemu-devel, Christoffer Dall, kvmarm

On 16/09/15 15:34, Alex Bennée wrote:
> 
> liang yan <liangy@hpe.com> writes:
> 
>> Hello, All,
>>
>> I am trying to enable kvm for a guest vm on an APM X-Gene Host with 
>> latest qemu, but could not make it work.
>>
>> The host is APM X-Gene 8-core, Linux kernel is 4.1.0-rc7-1-arm64,
>>
>> Guest kernel is linux-3.16rc3
>>
>> QEMU is latest version
>>
>> Host has these dmesg info
>> [    2.708259] kvm [1]: GICH base=0x780c0000, GICV base=0x780e0000, IRQ=25
>> [    2.708327] kvm [1]: timer IRQ30
>> [    2.708335] kvm [1]: Hyp mode initialized successfully
>>
>> Host has dev/kvm.
>>
>> command-line is
>> aarch64-softmmu/qemu-system-aarch64 -machine virt,kernel_irqchip=off 
>> -cpu cortex-a57 -machine accel=kvm -nographic -smp 1 -m 2048 -kernel 
>> aarch64-linux-3.16rc3-buildroot.img  --append "console=ttyAMA0"
> 
> I thought I recognised one of my images ;-)
> 
> Why are you running with kernel_irqchip=off?
> 
> Without it I can boot the image fine on my APM running 4.3.0-rc1-ajb but
> with it I helpfully seg the kernel:
> 
> [16035.990518] Bad mode in Synchronous Abort handler detected, code 0x86000006 -- IABT (current EL)
> [16035.997970] CPU: 1 PID: 21328 Comm: qemu-system-aar Not tainted 4.3.0-rc1-ajb #446
> [16036.004203] Hardware name: APM X-Gene Mustang board (DT)
> [16036.008191] task: ffffffc3ecea8000 ti: ffffffc3d8078000 task.ti: ffffffc3d8078000
> [16036.014338] PC is at 0x0
> [16036.015564] LR is at kvm_vgic_map_resources+0x30/0x3c
> [16036.019291] pc : [<0000000000000000>] lr : [<ffffffc0000ae900>] pstate: 00000145
> [16036.025350] sp : ffffffc3d807bb20
> [16036.027348] x29: ffffffc3d807bb20 x28: ffffffc3d8078000 
> [16036.031355] x27: ffffffc000642000 x26: 000000000000001d 
> [16036.035361] x25: 000000000000011b x24: ffffffc3d80c1000 
> [16036.039368] x23: 0000000000000000 x22: 0000000000000000 
> [16036.043374] x21: ffffffc0fa240000 x20: ffffffc0fa807800 
> [16036.047380] x19: ffffffc0fa807800 x18: 0000007f97af20e0 
> [16036.051387] x17: 0000007f99c44810 x16: ffffffc0001fb030 
> [16036.055394] x15: 0000007f99cc9588 x14: 0000000000922000 
> [16036.059401] x13: 000000000097eb80 x12: 00000000004de0f0 
> [16036.063406] x11: 0000000000000038 x10: 00000000ffffffff 
> [16036.067413] x9 : 0000007f97af2480 x8 : 0000000000000050 
> [16036.071419] x7 : ffffffc3ec24c840 x6 : 0000000000000000 
> [16036.075424] x5 : 0000000000000003 x4 : ffffffc3ece72080 
> [16036.079430] x3 : ffffffc3ece72080 x2 : 0000000000000000 
> [16036.083436] x1 : ffffffc000a26260 x0 : ffffffc0fa807800 
> 
> [16036.087628] Internal error: Oops - bad mode: 0 [#1] SMP
> [16036.091528] Modules linked in:
> [16036.093278] CPU: 1 PID: 21328 Comm: qemu-system-aar Not tainted 4.3.0-rc1-ajb #446
> [16036.099510] Hardware name: APM X-Gene Mustang board (DT)
> [16036.103497] task: ffffffc3ecea8000 ti: ffffffc3d8078000 task.ti: ffffffc3d8078000
> [16036.109642] PC is at 0x0
> [16036.110864] LR is at kvm_vgic_map_resources+0x30/0x3c
> [16036.114590] pc : [<0000000000000000>] lr : [<ffffffc0000ae900>] pstate: 00000145
> [16036.120649] sp : ffffffc3d807bb20
> [16036.122648] x29: ffffffc3d807bb20 x28: ffffffc3d8078000 
> [16036.126654] x27: ffffffc000642000 x26: 000000000000001d 
> [16036.130659] x25: 000000000000011b x24: ffffffc3d80c1000 
> [16036.134666] x23: 0000000000000000 x22: 0000000000000000 
> [16036.138671] x21: ffffffc0fa240000 x20: ffffffc0fa807800 
> [16036.142678] x19: ffffffc0fa807800 x18: 0000007f97af20e0 
> [16036.146685] x17: 0000007f99c44810 x16: ffffffc0001fb030 
> [16036.150690] x15: 0000007f99cc9588 x14: 0000000000922000 
> [16036.154696] x13: 000000000097eb80 x12: 00000000004de0f0 
> [16036.158701] x11: 0000000000000038 x10: 00000000ffffffff 
> [16036.162706] x9 : 0000007f97af2480 x8 : 0000000000000050 
> [16036.166712] x7 : ffffffc3ec24c840 x6 : 0000000000000000 
> [16036.170719] x5 : 0000000000000003 x4 : ffffffc3ece72080 
> [16036.174725] x3 : ffffffc3ece72080 x2 : 0000000000000000 
> [16036.178731] x1 : ffffffc000a26260 x0 : ffffffc0fa807800 

Yeah, we have a fix for that one (from Pavel), though this hides another
gem. Patches on the list shortly.

>> when using cpu "cortex-a57", got the error "kvm_init_vcpu failed: 
>> Invalid argument"
>> when using cpu "host", got the error "Failed to retrieve host CPU features!"

Haven't seen that one yet.

	M.
-- 
Jazz is not dead. It just smells funny...

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

* Re: [Qemu-devel] Could not boot a guest vm from kvm mode based on APM X-Gene Host and latest qemu
  2015-09-16 14:34 ` Alex Bennée
  2015-09-16 15:29   ` Marc Zyngier
@ 2015-09-16 17:33   ` Marc Zyngier
  2015-09-17  0:02   ` liang yan
  2 siblings, 0 replies; 9+ messages in thread
From: Marc Zyngier @ 2015-09-16 17:33 UTC (permalink / raw
  To: Alex Bennée, liang yan; +Cc: qemu-devel, Christoffer Dall, kvmarm

On 16/09/15 15:34, Alex Bennée wrote:
> 
> liang yan <liangy@hpe.com> writes:
> 
>> Hello, All,
>>
>> I am trying to enable kvm for a guest vm on an APM X-Gene Host with 
>> latest qemu, but could not make it work.
>>
>> The host is APM X-Gene 8-core, Linux kernel is 4.1.0-rc7-1-arm64,
>>
>> Guest kernel is linux-3.16rc3
>>
>> QEMU is latest version
>>
>> Host has these dmesg info
>> [    2.708259] kvm [1]: GICH base=0x780c0000, GICV base=0x780e0000, IRQ=25
>> [    2.708327] kvm [1]: timer IRQ30
>> [    2.708335] kvm [1]: Hyp mode initialized successfully
>>
>> Host has dev/kvm.
>>
>> command-line is
>> aarch64-softmmu/qemu-system-aarch64 -machine virt,kernel_irqchip=off 
>> -cpu cortex-a57 -machine accel=kvm -nographic -smp 1 -m 2048 -kernel 
>> aarch64-linux-3.16rc3-buildroot.img  --append "console=ttyAMA0"
> 
> I thought I recognised one of my images ;-)
> 
> Why are you running with kernel_irqchip=off?
> 
> Without it I can boot the image fine on my APM running 4.3.0-rc1-ajb but
> with it I helpfully seg the kernel:
> 
> [16035.990518] Bad mode in Synchronous Abort handler detected, code 0x86000006 -- IABT (current EL)
> [16035.997970] CPU: 1 PID: 21328 Comm: qemu-system-aar Not tainted 4.3.0-rc1-ajb #446
> [16036.004203] Hardware name: APM X-Gene Mustang board (DT)
> [16036.008191] task: ffffffc3ecea8000 ti: ffffffc3d8078000 task.ti: ffffffc3d8078000
> [16036.014338] PC is at 0x0
> [16036.015564] LR is at kvm_vgic_map_resources+0x30/0x3c
> [16036.019291] pc : [<0000000000000000>] lr : [<ffffffc0000ae900>] pstate: 00000145
> [16036.025350] sp : ffffffc3d807bb20
> [16036.027348] x29: ffffffc3d807bb20 x28: ffffffc3d8078000 
> [16036.031355] x27: ffffffc000642000 x26: 000000000000001d 
> [16036.035361] x25: 000000000000011b x24: ffffffc3d80c1000 
> [16036.039368] x23: 0000000000000000 x22: 0000000000000000 
> [16036.043374] x21: ffffffc0fa240000 x20: ffffffc0fa807800 
> [16036.047380] x19: ffffffc0fa807800 x18: 0000007f97af20e0 
> [16036.051387] x17: 0000007f99c44810 x16: ffffffc0001fb030 
> [16036.055394] x15: 0000007f99cc9588 x14: 0000000000922000 
> [16036.059401] x13: 000000000097eb80 x12: 00000000004de0f0 
> [16036.063406] x11: 0000000000000038 x10: 00000000ffffffff 
> [16036.067413] x9 : 0000007f97af2480 x8 : 0000000000000050 
> [16036.071419] x7 : ffffffc3ec24c840 x6 : 0000000000000000 
> [16036.075424] x5 : 0000000000000003 x4 : ffffffc3ece72080 
> [16036.079430] x3 : ffffffc3ece72080 x2 : 0000000000000000 
> [16036.083436] x1 : ffffffc000a26260 x0 : ffffffc0fa807800 
> 
> [16036.087628] Internal error: Oops - bad mode: 0 [#1] SMP
> [16036.091528] Modules linked in:
> [16036.093278] CPU: 1 PID: 21328 Comm: qemu-system-aar Not tainted 4.3.0-rc1-ajb #446
> [16036.099510] Hardware name: APM X-Gene Mustang board (DT)
> [16036.103497] task: ffffffc3ecea8000 ti: ffffffc3d8078000 task.ti: ffffffc3d8078000
> [16036.109642] PC is at 0x0
> [16036.110864] LR is at kvm_vgic_map_resources+0x30/0x3c
> [16036.114590] pc : [<0000000000000000>] lr : [<ffffffc0000ae900>] pstate: 00000145
> [16036.120649] sp : ffffffc3d807bb20
> [16036.122648] x29: ffffffc3d807bb20 x28: ffffffc3d8078000 
> [16036.126654] x27: ffffffc000642000 x26: 000000000000001d 
> [16036.130659] x25: 000000000000011b x24: ffffffc3d80c1000 
> [16036.134666] x23: 0000000000000000 x22: 0000000000000000 
> [16036.138671] x21: ffffffc0fa240000 x20: ffffffc0fa807800 
> [16036.142678] x19: ffffffc0fa807800 x18: 0000007f97af20e0 
> [16036.146685] x17: 0000007f99c44810 x16: ffffffc0001fb030 
> [16036.150690] x15: 0000007f99cc9588 x14: 0000000000922000 
> [16036.154696] x13: 000000000097eb80 x12: 00000000004de0f0 
> [16036.158701] x11: 0000000000000038 x10: 00000000ffffffff 
> [16036.162706] x9 : 0000007f97af2480 x8 : 0000000000000050 
> [16036.166712] x7 : ffffffc3ec24c840 x6 : 0000000000000000 
> [16036.170719] x5 : 0000000000000003 x4 : ffffffc3ece72080 
> [16036.174725] x3 : ffffffc3ece72080 x2 : 0000000000000000 
> [16036.178731] x1 : ffffffc000a26260 x0 : ffffffc0fa807800 

I've posted the relevant patches there:

https://lists.cs.columbia.edu/pipermail/kvmarm/2015-September/016487.html

I'd appreciate any form of testing.

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

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

* Re: [Qemu-devel] Could not boot a guest vm from kvm mode based on APM X-Gene Host and latest qemu
  2015-09-16  9:24 ` Tushar Jagad
@ 2015-09-16 23:32   ` liang yan
  0 siblings, 0 replies; 9+ messages in thread
From: liang yan @ 2015-09-16 23:32 UTC (permalink / raw
  To: Tushar Jagad; +Cc: qemu-devel



On 09/16/2015 03:24 AM, Tushar Jagad wrote:
> Hi,
>
> On Mon, Sep 14, 2015 at 06:03:48PM -0600, liang yan wrote:
>> Hello, All,
>>
>> I am trying to enable kvm for a guest vm on an APM X-Gene Host with
>> latest qemu, but could not make it work.
>>
>> The host is APM X-Gene 8-core, Linux kernel is 4.1.0-rc7-1-arm64,
>>
>> Guest kernel is linux-3.16rc3
>>
>> QEMU is latest version
>>
>> Host has these dmesg info
>> [    2.708259] kvm [1]: GICH base=0x780c0000, GICV base=0x780e0000, IRQ=25
>> [    2.708327] kvm [1]: timer IRQ30
>> [    2.708335] kvm [1]: Hyp mode initialized successfully
>>
>> Host has dev/kvm.
>>
>> command-line is
>> aarch64-softmmu/qemu-system-aarch64 -machine virt,kernel_irqchip=off
>> -cpu cortex-a57 -machine accel=kvm -nographic -smp 1 -m 2048 -kernel
>> aarch64-linux-3.16rc3-buildroot.img  --append "console=ttyAMA0"
>>
>>
>> when using cpu "cortex-a57", got the error "kvm_init_vcpu failed:
>> Invalid argument"
> Currently, it is not possible to run qemu with a cpu type other than the
> host. I'm currently in the process of adding the necessary support and
> have posted the necessary RFC patches for kvm[1] and qemu[2].
>
> [1] http://comments.gmane.org/gmane.linux.ports.arm.kernel/438744
> [2] https://lists.gnu.org/archive/html/qemu-devel/2015-09/msg02374.html
> --
> Regards,
> Tushar

Hello, Tushar,

Thanks for your reply.

Actually, I already patched your code there, also used the command "-cpu 
cortex-a57,bpts=2,wpts=2" ,but did not change the output,
I am trying to check the KVM code from Linux kernel now.

By the way, I am very interested in your work here, feel free to let me 
know if there
are anything I can be involved.

Best,
Liang
>> when using cpu "host", got the error "Failed to retrieve host CPU features!"
>>
>> By the way, all the command line works well under "tcg" mode.
>> Anyone has a quick idea? Thanks in advance.
>>
>> Best,
>> Liang
>>
>>

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

* Re: [Qemu-devel] Could not boot a guest vm from kvm mode based on APM X-Gene Host and latest qemu
  2015-09-16 14:34 ` Alex Bennée
  2015-09-16 15:29   ` Marc Zyngier
  2015-09-16 17:33   ` Marc Zyngier
@ 2015-09-17  0:02   ` liang yan
  2015-09-17  7:44     ` Alex Bennée
  2 siblings, 1 reply; 9+ messages in thread
From: liang yan @ 2015-09-17  0:02 UTC (permalink / raw
  To: Alex Bennée; +Cc: Marc Zyngier, qemu-devel, Christoffer Dall, kvmarm



On 09/16/2015 08:34 AM, Alex Bennée wrote:
> liang yan <liangy@hpe.com> writes:
>
>> Hello, All,
>>
>> I am trying to enable kvm for a guest vm on an APM X-Gene Host with
>> latest qemu, but could not make it work.
>>
>> The host is APM X-Gene 8-core, Linux kernel is 4.1.0-rc7-1-arm64,
>>
>> Guest kernel is linux-3.16rc3
>>
>> QEMU is latest version
>>
>> Host has these dmesg info
>> [    2.708259] kvm [1]: GICH base=0x780c0000, GICV base=0x780e0000, IRQ=25
>> [    2.708327] kvm [1]: timer IRQ30
>> [    2.708335] kvm [1]: Hyp mode initialized successfully
>>
>> Host has dev/kvm.
>>
>> command-line is
>> aarch64-softmmu/qemu-system-aarch64 -machine virt,kernel_irqchip=off
>> -cpu cortex-a57 -machine accel=kvm -nographic -smp 1 -m 2048 -kernel
>> aarch64-linux-3.16rc3-buildroot.img  --append "console=ttyAMA0"
> I thought I recognised one of my images ;-)
>
> Why are you running with kernel_irqchip=off?


Hello, Alex,

Thanks for your reply and your pre-boot image. Very helpful.

The reason I ran with "kernel_irqchip=off" is because it showed the 
error "Create kernel irqchip failed: No such device"
are you familiar with it?

I did not try kernel 4.3.x yet, have you released on your linaro website 
now?

Thanks for your log file, it shows something wrong with the vcpu, I am 
gonna check the kvm code from host kernel now.
Will let you know the update.


Best,
Liang

> Without it I can boot the image fine on my APM running 4.3.0-rc1-ajb but
> with it I helpfully seg the kernel:
=============================================
>
> [16035.990518] Bad mode in Synchronous Abort handler detected, code 0x86000006 -- IABT (current EL)
=============================================
> [16035.997970] CPU: 1 PID: 21328 Comm: qemu-system-aar Not tainted 4.3.0-rc1-ajb #446
> [16036.004203] Hardware name: APM X-Gene Mustang board (DT)
> [16036.008191] task: ffffffc3ecea8000 ti: ffffffc3d8078000 task.ti: ffffffc3d8078000
> [16036.014338] PC is at 0x0
> [16036.015564] LR is at kvm_vgic_map_resources+0x30/0x3c
> [16036.019291] pc : [<0000000000000000>] lr : [<ffffffc0000ae900>] pstate: 00000145
> [16036.025350] sp : ffffffc3d807bb20
> [16036.027348] x29: ffffffc3d807bb20 x28: ffffffc3d8078000
> [16036.031355] x27: ffffffc000642000 x26: 000000000000001d
> [16036.035361] x25: 000000000000011b x24: ffffffc3d80c1000
> [16036.039368] x23: 0000000000000000 x22: 0000000000000000
> [16036.043374] x21: ffffffc0fa240000 x20: ffffffc0fa807800
> [16036.047380] x19: ffffffc0fa807800 x18: 0000007f97af20e0
> [16036.051387] x17: 0000007f99c44810 x16: ffffffc0001fb030
> [16036.055394] x15: 0000007f99cc9588 x14: 0000000000922000
> [16036.059401] x13: 000000000097eb80 x12: 00000000004de0f0
> [16036.063406] x11: 0000000000000038 x10: 00000000ffffffff
> [16036.067413] x9 : 0000007f97af2480 x8 : 0000000000000050
> [16036.071419] x7 : ffffffc3ec24c840 x6 : 0000000000000000
> [16036.075424] x5 : 0000000000000003 x4 : ffffffc3ece72080
> [16036.079430] x3 : ffffffc3ece72080 x2 : 0000000000000000
> [16036.083436] x1 : ffffffc000a26260 x0 : ffffffc0fa807800
====================================
> [16036.087628] Internal error: Oops - bad mode: 0 [#1] SMP
====================================

> [16036.091528] Modules linked in:
> [16036.093278] CPU: 1 PID: 21328 Comm: qemu-system-aar Not tainted 4.3.0-rc1-ajb #446
> [16036.099510] Hardware name: APM X-Gene Mustang board (DT)
> [16036.103497] task: ffffffc3ecea8000 ti: ffffffc3d8078000 task.ti: ffffffc3d8078000
> [16036.109642] PC is at 0x0
> [16036.110864] LR is at kvm_vgic_map_resources+0x30/0x3c
> [16036.114590] pc : [<0000000000000000>] lr : [<ffffffc0000ae900>] pstate: 00000145
> [16036.120649] sp : ffffffc3d807bb20
> [16036.122648] x29: ffffffc3d807bb20 x28: ffffffc3d8078000
> [16036.126654] x27: ffffffc000642000 x26: 000000000000001d
> [16036.130659] x25: 000000000000011b x24: ffffffc3d80c1000
> [16036.134666] x23: 0000000000000000 x22: 0000000000000000
> [16036.138671] x21: ffffffc0fa240000 x20: ffffffc0fa807800
> [16036.142678] x19: ffffffc0fa807800 x18: 0000007f97af20e0
> [16036.146685] x17: 0000007f99c44810 x16: ffffffc0001fb030
> [16036.150690] x15: 0000007f99cc9588 x14: 0000000000922000
> [16036.154696] x13: 000000000097eb80 x12: 00000000004de0f0
> [16036.158701] x11: 0000000000000038 x10: 00000000ffffffff
> [16036.162706] x9 : 0000007f97af2480 x8 : 0000000000000050
> [16036.166712] x7 : ffffffc3ec24c840 x6 : 0000000000000000
> [16036.170719] x5 : 0000000000000003 x4 : ffffffc3ece72080
> [16036.174725] x3 : ffffffc3ece72080 x2 : 0000000000000000
> [16036.178731] x1 : ffffffc000a26260 x0 : ffffffc0fa807800
>
>>
>> when using cpu "cortex-a57", got the error "kvm_init_vcpu failed:
>> Invalid argument"
>> when using cpu "host", got the error "Failed to retrieve host CPU features!"
>>
>> By the way, all the command line works well under "tcg" mode.
>> Anyone has a quick idea? Thanks in advance.
>>
>> Best,
>> Liang

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

* Re: [Qemu-devel] Could not boot a guest vm from kvm mode based on APM X-Gene Host and latest qemu
  2015-09-17  0:02   ` liang yan
@ 2015-09-17  7:44     ` Alex Bennée
  0 siblings, 0 replies; 9+ messages in thread
From: Alex Bennée @ 2015-09-17  7:44 UTC (permalink / raw
  To: liang yan; +Cc: Marc Zyngier, qemu-devel, Christoffer Dall, kvmarm


liang yan <liangy@hpe.com> writes:

> On 09/16/2015 08:34 AM, Alex Bennée wrote:
>> liang yan <liangy@hpe.com> writes:
>>
>>> Hello, All,
>>>
>>> I am trying to enable kvm for a guest vm on an APM X-Gene Host with
>>> latest qemu, but could not make it work.
>>>
>>> The host is APM X-Gene 8-core, Linux kernel is 4.1.0-rc7-1-arm64,
>>>
>>> Guest kernel is linux-3.16rc3
>>>
>>> QEMU is latest version
>>>
>>> Host has these dmesg info
>>> [    2.708259] kvm [1]: GICH base=0x780c0000, GICV base=0x780e0000, IRQ=25
>>> [    2.708327] kvm [1]: timer IRQ30
>>> [    2.708335] kvm [1]: Hyp mode initialized successfully
>>>
>>> Host has dev/kvm.
>>>
>>> command-line is
>>> aarch64-softmmu/qemu-system-aarch64 -machine virt,kernel_irqchip=off
>>> -cpu cortex-a57 -machine accel=kvm -nographic -smp 1 -m 2048 -kernel
>>> aarch64-linux-3.16rc3-buildroot.img  --append "console=ttyAMA0"
>> I thought I recognised one of my images ;-)
>>
>> Why are you running with kernel_irqchip=off?
>
>
> Hello, Alex,
>
> Thanks for your reply and your pre-boot image. Very helpful.
>
> The reason I ran with "kernel_irqchip=off" is because it showed the 
> error "Create kernel irqchip failed: No such device"
> are you familiar with it?

No but I suspect it is a kernel configuration issue. Are you running a
defconfig?

>
> I did not try kernel 4.3.x yet, have you released on your linaro website 
> now?

That's running directly from Linus' tree so it's pure mainline.

> Thanks for your log file, it shows something wrong with the vcpu, I am 
> gonna check the kvm code from host kernel now.
> Will let you know the update.

Mark Zyngier pointed out that's a know bug that there are patches
in-flight for.

>
>
> Best,
> Liang
>
>> Without it I can boot the image fine on my APM running 4.3.0-rc1-ajb but
>> with it I helpfully seg the kernel:
> =============================================
>>
>> [16035.990518] Bad mode in Synchronous Abort handler detected, code 0x86000006 -- IABT (current EL)
> =============================================
>> [16035.997970] CPU: 1 PID: 21328 Comm: qemu-system-aar Not tainted 4.3.0-rc1-ajb #446
>> [16036.004203] Hardware name: APM X-Gene Mustang board (DT)
>> [16036.008191] task: ffffffc3ecea8000 ti: ffffffc3d8078000 task.ti: ffffffc3d8078000
>> [16036.014338] PC is at 0x0
>> [16036.015564] LR is at kvm_vgic_map_resources+0x30/0x3c
>> [16036.019291] pc : [<0000000000000000>] lr : [<ffffffc0000ae900>] pstate: 00000145
>> [16036.025350] sp : ffffffc3d807bb20
>> [16036.027348] x29: ffffffc3d807bb20 x28: ffffffc3d8078000
>> [16036.031355] x27: ffffffc000642000 x26: 000000000000001d
>> [16036.035361] x25: 000000000000011b x24: ffffffc3d80c1000
>> [16036.039368] x23: 0000000000000000 x22: 0000000000000000
>> [16036.043374] x21: ffffffc0fa240000 x20: ffffffc0fa807800
>> [16036.047380] x19: ffffffc0fa807800 x18: 0000007f97af20e0
>> [16036.051387] x17: 0000007f99c44810 x16: ffffffc0001fb030
>> [16036.055394] x15: 0000007f99cc9588 x14: 0000000000922000
>> [16036.059401] x13: 000000000097eb80 x12: 00000000004de0f0
>> [16036.063406] x11: 0000000000000038 x10: 00000000ffffffff
>> [16036.067413] x9 : 0000007f97af2480 x8 : 0000000000000050
>> [16036.071419] x7 : ffffffc3ec24c840 x6 : 0000000000000000
>> [16036.075424] x5 : 0000000000000003 x4 : ffffffc3ece72080
>> [16036.079430] x3 : ffffffc3ece72080 x2 : 0000000000000000
>> [16036.083436] x1 : ffffffc000a26260 x0 : ffffffc0fa807800
> ====================================
>> [16036.087628] Internal error: Oops - bad mode: 0 [#1] SMP
> ====================================
>
>> [16036.091528] Modules linked in:
>> [16036.093278] CPU: 1 PID: 21328 Comm: qemu-system-aar Not tainted 4.3.0-rc1-ajb #446
>> [16036.099510] Hardware name: APM X-Gene Mustang board (DT)
>> [16036.103497] task: ffffffc3ecea8000 ti: ffffffc3d8078000 task.ti: ffffffc3d8078000
>> [16036.109642] PC is at 0x0
>> [16036.110864] LR is at kvm_vgic_map_resources+0x30/0x3c
>> [16036.114590] pc : [<0000000000000000>] lr : [<ffffffc0000ae900>] pstate: 00000145
>> [16036.120649] sp : ffffffc3d807bb20
>> [16036.122648] x29: ffffffc3d807bb20 x28: ffffffc3d8078000
>> [16036.126654] x27: ffffffc000642000 x26: 000000000000001d
>> [16036.130659] x25: 000000000000011b x24: ffffffc3d80c1000
>> [16036.134666] x23: 0000000000000000 x22: 0000000000000000
>> [16036.138671] x21: ffffffc0fa240000 x20: ffffffc0fa807800
>> [16036.142678] x19: ffffffc0fa807800 x18: 0000007f97af20e0
>> [16036.146685] x17: 0000007f99c44810 x16: ffffffc0001fb030
>> [16036.150690] x15: 0000007f99cc9588 x14: 0000000000922000
>> [16036.154696] x13: 000000000097eb80 x12: 00000000004de0f0
>> [16036.158701] x11: 0000000000000038 x10: 00000000ffffffff
>> [16036.162706] x9 : 0000007f97af2480 x8 : 0000000000000050
>> [16036.166712] x7 : ffffffc3ec24c840 x6 : 0000000000000000
>> [16036.170719] x5 : 0000000000000003 x4 : ffffffc3ece72080
>> [16036.174725] x3 : ffffffc3ece72080 x2 : 0000000000000000
>> [16036.178731] x1 : ffffffc000a26260 x0 : ffffffc0fa807800
>>
>>>
>>> when using cpu "cortex-a57", got the error "kvm_init_vcpu failed:
>>> Invalid argument"
>>> when using cpu "host", got the error "Failed to retrieve host CPU features!"
>>>
>>> By the way, all the command line works well under "tcg" mode.
>>> Anyone has a quick idea? Thanks in advance.
>>>
>>> Best,
>>> Liang

-- 
Alex Bennée

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

end of thread, other threads:[~2015-09-17  7:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-15  0:03 [Qemu-devel] Could not boot a guest vm from kvm mode based on APM X-Gene Host and latest qemu liang yan
2015-09-16  9:24 ` Tushar Jagad
2015-09-16 23:32   ` liang yan
2015-09-16  9:55 ` Peter Maydell
2015-09-16 14:34 ` Alex Bennée
2015-09-16 15:29   ` Marc Zyngier
2015-09-16 17:33   ` Marc Zyngier
2015-09-17  0:02   ` liang yan
2015-09-17  7:44     ` Alex Bennée

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 read-only IMAP folder(s) and NNTP newsgroup(s).