From: David Woodhouse Date: Sat, 24 Oct 2020 21:35:35 +0000 (+0100) Subject: x86/kvm: Enable 15-bit extension when KVM_FEATURE_MSI_EXT_DEST_ID detected X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=3b0c20ef1faacd177aa747a1e3fd9ac14b37e4f5;p=users%2Fdwmw2%2Flinux.git x86/kvm: Enable 15-bit extension when KVM_FEATURE_MSI_EXT_DEST_ID detected This allows the host to indicate that MSI emulation supports 15-bit destination IDs, allowing up to 32768 CPUs without interrupt remapping. cf. https://patchwork.kernel.org/patch/11816693/ for qemu Signed-off-by: David Woodhouse Signed-off-by: Thomas Gleixner Acked-by: Paolo Bonzini Link: https://lore.kernel.org/r/20201024213535.443185-36-dwmw2@infradead.org (cherry picked from commit 2e008ffe426f927b1697adb4ed10c1e419927ae4) --- diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index 9663ba31347c2..32ea09bc82081 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -744,12 +744,18 @@ static void __init kvm_init_platform(void) x86_platform.apic_post_init = kvm_apic_init; } +static bool __init kvm_msi_ext_dest_id(void) +{ + return kvm_para_has_feature(KVM_FEATURE_MSI_EXT_DEST_ID); +} + const __initconst struct hypervisor_x86 x86_hyper_kvm = { .name = "KVM", .detect = kvm_detect, .type = X86_HYPER_KVM, .init.guest_late_init = kvm_guest_init, .init.x2apic_available = kvm_para_available, + .init.msi_ext_dest_id = kvm_msi_ext_dest_id, .init.init_platform = kvm_init_platform, };