x86: Enable in-kernel irqchip before creating PIT
PATCH 1/1 x86: Enable in-kernel irqchip before creating PIT
As the kvm api(https://docs.kernel.org/virt/kvm/api.html) reads, KVM_CREATE_PIT2 call is only valid after enabling in-kernel irqchip support via KVM_CREATE_IRQCHIP.
Signed-off-by Tengfei Yu <[email protected]>
--- x86/kvm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
x86/kvm.c +4 -4
@@ -150,10 +150,6 @@ void kvm__arch_init(struct kvm *kvm)if (ret <0 )die_perror ("KVM_SET_TSS_ADDR ioctl" ); - ret =ioctl (kvm->vm_fd,KVM_CREATE_PIT2 , &pit_config); -if (ret <0 ) -die_perror ("KVM_CREATE_PIT2 ioctl" ); -if (ram_size <KVM_32BIT_GAP_START ) { kvm->ram_size = ram_size; kvm->ram_start =mmap_anon_or_hugetlbfs (kvm, hugetlbfs_path, ram_size);
@@ -175,6 +171,10 @@ void kvm__arch_init(struct kvm *kvm) ret =ioctl (kvm->vm_fd,KVM_CREATE_IRQCHIP );if (ret <0 )die_perror ("KVM_CREATE_IRQCHIP ioctl" ); + + ret =ioctl (kvm->vm_fd,KVM_CREATE_PIT2 , &pit_config); +if (ret <0 ) +die_perror ("KVM_CREATE_PIT2 ioctl" ); }void kvm__arch_delete_ram (struct kvm *kvm)
Signature · 1 line
2.39.3
Will Deacon
AppliedQuoted 5 lines · Tengfei Yu
As the kvm api(https://docs.kernel.org/virt/kvm/api.html) reads,
KVM_CREATE_PIT2call is only valid after enabling in-kernel irqchip support viaKVM_CREATE_IRQCHIP.
Applied to kvmtool (master), thanks!
[1/1] x86: Enable in-kernel irqchip before creating PIT
https://git.kernel.org/will/kvmtool/c/e73a6b29f1eb
Cheers,
Signature · 5 lines
Will https://fixes.arm64.dev https://next.arm64.dev https://will.arm64.dev