No irqchip created after commit 11bc4a13d1f4 ("kvm: convert "-machine kernel_irqchip" to an accelerator property")
I apologize if this was already reported,
I just noticed that with the latest updates QEMU doesn't start with the following configuration:
qemu-system-x86_64 -name guest=win10 -machine pc,accel=kvm -cpu host,hv_vpindex,hv_synic ...
qemu-system-x86_64: failed to turn on HyperV SynIC in KVM: Invalid argument
qemu-system-x86_64: kvm_init_vcpu failed: Invalid argument
If I add 'kernel-irqchip=split' or ',kernel-irqchip=on' it starts as usual. I bisected this to the following commit:
commit 11bc4a13d1f4b07dafbd1dda4d4bf0fdd7ad65f2 (HEAD, refs/bisect/bad)
Author: Paolo Bonzini <[email protected]> Date: Wed Nov 13 10:56:53 2019 +0100
kvm: convert "-machine kernel_irqchip" to an accelerator property
so aparently we now default to 'kernel_irqchip=off'. Is this the desired behavior?
Signature · 1 line
Vitaly
No, absolutely not. I was sure I had tested it, but I will take a look.
Paolo
Il ven 20 dic 2019, 15:11 Vitaly Kuznetsov <[email protected]> ha scritto:
Quoted 27 lines
I apologize if this was already reported,
I just noticed that with the latest updates QEMU doesn't start with the following configuration:
qemu-system-x86_64 -name guest=win10 -machine pc,accel=kvm -cpu host,hv_vpindex,hv_synic ...
qemu-system-x86_64: failed to turn on HyperV SynIC in KVM: Invalid argument
qemu-system-x86_64:kvm_init_vcpufailed: Invalid argumentIf I add 'kernel-irqchip=split' or ',kernel-irqchip=on' it starts as usual. I bisected this to the following commit:
commit
11bc4a13d1f4b07dafbd1dda4d4bf0fdd7ad65f2(HEAD, refs/bisect/bad)Author: Paolo Bonzini <[email protected]> Date: Wed Nov 13 10:56:53 2019 +0100kvm: convert "-machine
kernel_irqchip" to an accelerator propertyso aparently we now default to 'kernel_irqchip=off'. Is this the desired behavior?
--
Vitaly
PATCH 1/1 accel/kvm: Make "kernel_irqchip" default on
Commit 11bc4a13d1f4 ("kvm: convert "-machine kernel_irqchip" to an accelerator property") moves kernel_irqchip property from "-machine" to "-accel kvm", but it forgets to set the default value of kernel_irqchip_allowed and kernel_irqchip_split.
Also cleaning up the three useless members (kernel_irqchip_allowed, kernel_irqchip_required, kernel_irqchip_split) in struct MachineState.
--- accel/kvm/kvm-all.c | 3 +++ include/hw/boards.h | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-)
accel/kvm/kvm-all.c +3 -0
@@ -3044,8 +3044,11 @@ bool kvm_kernel_irqchip_split(void)static void kvm_accel_instance_init (Object *obj) {KVMState *s =KVM_STATE (obj); +MachineClass *mc =MACHINE_GET_CLASS (current_machine); s->kvm_shadow_mem =-1 ; + s->kernel_irqchip_allowed = true; + s->kernel_irqchip_split = mc->default_kernel_irqchip_split; }static void kvm_accel_class_init (ObjectClass *oc,void *data)
include/hw/boards.h +0 -3
@@ -271,9 +271,6 @@ struct MachineState {/*< public >*/ -bool kernel_irqchip_allowed; -bool kernel_irqchip_required; -bool kernel_irqchip_split;char *dtb;char *dumpdtb;int phandle_start;
Signature · 1 line
2.19.1
Re: [PATCH] accel/kvm: Make "kernel_irqchip" default on
Il sab 28 dic 2019, 09:48 Xiaoyao Li <[email protected]> ha scritto:
Quoted 5 lines
Commit
11bc4a13d1f4("kvm: convert "-machinekernel_irqchip" to an accelerator property") moveskernel_irqchipproperty from "-machine" to "-accel kvm", but it forgets to set the default value ofkernel_irqchip_allowedandkernel_irqchip_split.
Quoted 7 lines
Also cleaning up the three useless members (
kernel_irqchip_allowed,kernel_irqchip_required,kernel_irqchip_split) in struct MachineState.Fixes 11bc4a13d1f4 ("kvm: convert "-machine kernel_irqchip" to anaccelerator property")
Signed-off-by Xiaoyao Li <[email protected]>
Please also add a Reported-by line for Vitaly Kuznetsov.
---
Quoted 9 lines
accel/kvm/kvm-all.c | 3 +++ include/hw/boards.h | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-)accel/kvm/kvm-all.c +0
-0
accel/kvm/kvm-all.c bool kvm_kernel_irqchip_split(void) · line 3052
Quoted 9 lines
accel/kvm/kvm-all.c +3
-0@@ -3044,8 +3044,11 @@ bool kvm_kernel_irqchip_split(void)static void kvm_accel_instance_init (Object *obj) {KVMState *s =KVM_STATE (obj); +MachineClass *mc =MACHINE_GET_CLASS (current_machine); s->kvm_shadow_mem =-1 ; + s->kernel_irqchip_allowed = true; + s->kernel_irqchip_split = mc->default_kernel_irqchip_split;
Can you initialize this from the init_machine method instead of assuming that current_machine has been initialized earlier?
Thanks for the quick fix!
Paolo
Quoted 21 lines
accel/kvm/kvm-all.c +0
-0}static void
kvm_accel_class_init(ObjectClass *oc, void *data)include/hw/boards.h +0
-4@@ -271,9 +271,6 @@ struct MachineState {/*< public >*/ -bool kernel_irqchip_allowed; -bool kernel_irqchip_required; -bool kernel_irqchip_split;char *dtb;char *dumpdtb;int phandle_start; --2.19.1
Re: [PATCH] accel/kvm: Make "kernel_irqchip" default on
Quoted 8 lines · Paolo Bonzini
Il sab 28 dic 2019, 09:48 Xiaoyao Li <[email protected]> ha scritto:
Quoted 5 lines
Commit
11bc4a13d1f4("kvm: convert "-machinekernel_irqchip" to an accelerator property") moveskernel_irqchipproperty from "-machine" to "-accel kvm", but it forgets to set the default value ofkernel_irqchip_allowedandkernel_irqchip_split.
Quoted 8 lines
Quoted 6 lines
Also cleaning up the three useless members (
kernel_irqchip_allowed,kernel_irqchip_required,kernel_irqchip_split) in struct MachineState.Fixes 11bc4a13d1f4 ("kvm: convert "-machine kernel_irqchip" to anaccelerator property")
Signed-off-by Xiaoyao Li <[email protected]>Please also add a Reported-by line for Vitaly Kuznetsov.
Sure.
Quoted 15 lines
Quoted 15 lines
--- accel/kvm/kvm-all.c | 3 +++ include/hw/boards.h | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-)accel/kvm/kvm-all.c +1
-0@@ -3044,8 +3044,11 @@ bool kvm_kernel_irqchip_split(void)static void kvm_accel_instance_init (Object *obj) {KVMState *s =KVM_STATE (obj); +MachineClass *mc =MACHINE_GET_CLASS (current_machine);
Quoted 6 lines
accel/kvm/kvm-all.c bool kvm_kernel_irqchip_split(void) · line 3051
Quoted 3 lines
accel/kvm/kvm-all.c +2
-0s->kvm_shadow_mem =-1 ; + s->kernel_irqchip_allowed = true; + s->kernel_irqchip_split = mc->default_kernel_irqchip_split;Can you initialize this from the
init_machinemethod instead of assuming thatcurrent_machinehas been initialized earlier?
OK, will do it in v2.
Quoted 1 line
Thanks for the quick fix!
BTW, it seems that this patch makes kernel_irqchip default on to workaround the bug.
However, when explicitly configuring kernel_irqchip=off, guest still fails booting due to "KVM: failed to send PV IPI: -95" with a latest upstream kernel ubuntu guest. Any idea about this?
Quoted 18 lines
Paolo
Quoted 17 lines
accel/kvm/kvm-all.c +0
-0}static void kvm_accel_class_init (ObjectClass *oc,void *data)include/hw/boards.h +0
-3@@ -271,9 +271,6 @@ struct MachineState {/*< public >*/ -bool kernel_irqchip_allowed; -bool kernel_irqchip_required; -bool kernel_irqchip_split;char *dtb;char *dumpdtb;int phandle_start;
Re: [PATCH] accel/kvm: Make "kernel_irqchip" default on
Il sab 28 dic 2019, 10:24 Xiaoyao Li <[email protected]> ha scritto:
Quoted 8 lines
BTW, it seems that this patch makes
kernel_irqchipdefault on to workaround the
bug.
However, when explicitly configuring kernel_irqchip=off, guest still fails booting due to "KVM: failed to send PV IPI: -95" with a latest upstream kernel
ubuntu guest. Any idea about this?
We need to clear the PV IPI feature for userspace irqchip. Are you using -cpu host by chance?
Paolo
Quoted 20 lines
Quoted 18 lines
Paolo
Quoted 17 lines
}
static void
kvm_accel_class_init(ObjectClass *oc, void *data)include/hw/boards.h +0
-3@@ -271,9 +271,6 @@ struct MachineState {/*< public >*/ -bool kernel_irqchip_allowed; -bool kernel_irqchip_required; -bool kernel_irqchip_split;char *dtb;char *dumpdtb;int phandle_start;
Re: [PATCH] accel/kvm: Make "kernel_irqchip" default on
Quoted 11 lines · Paolo Bonzini
Il sab 28 dic 2019, 10:24 Xiaoyao Li <[email protected]> ha scritto:
Quoted 7 lines
BTW, it seems that this patch makes
kernel_irqchipdefault on to workaround the
bug.
However, when explicitly configuring kernel_irqchip=off, guest still fails booting due to "KVM: failed to send PV IPI: -95" with a latest upstream kernel
ubuntu guest. Any idea about this?
Quoted 2 lines
We need to clear the PV IPI feature for userspace irqchip. Are you using -cpu host by chance?
Yes, I used -cpu host.
After using "-cpu host,-kvm-pv-ipi" with kernel_irqchip=off, it can boot successfully.
Quoted 21 lines
Paolo
Quoted 19 lines
Quoted 18 lines
Paolo
Quoted 17 lines
}
static void
kvm_accel_class_init(ObjectClass *oc, void *data)include/hw/boards.h +0
-3@@ -271,9 +271,6 @@ struct MachineState {/*< public >*/ -bool kernel_irqchip_allowed; -bool kernel_irqchip_required; -bool kernel_irqchip_split;char *dtb;char *dumpdtb;int phandle_start;