Joerg Roedel 84d036
From: David Woodhouse <dwmw@amazon.co.uk>
Joerg Roedel 84d036
Date: Wed, 7 Oct 2020 13:20:46 +0100
Joerg Roedel 84d036
Subject: [PATCH 5/5] x86/kvm: Add KVM_FEATURE_MSI_EXT_DEST_ID
Joerg Roedel 84d036
Patch-mainline: Never, upstream uses different implementation
Joerg Roedel 84d036
References: bsc#1181001, jsc#ECO-3191
Joerg Roedel 84d036
Joerg Roedel 84d036
This allows the host to indicate that IOAPIC and MSI emulation supports
Joerg Roedel 84d036
15-bit destination IDs, allowing up to 32768 CPUs without interrupt
Joerg Roedel 84d036
remapping.
Joerg Roedel 84d036
Joerg Roedel 84d036
cf. https://patchwork.kernel.org/patch/11816693/ for qemu
Joerg Roedel 84d036
Joerg Roedel 84d036
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Joerg Roedel 84d036
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Joerg Roedel 84d036
Acked-by: Joerg Roedel <jroedel@suse.de>
Joerg Roedel 84d036
---
Joerg Roedel 84d036
 arch/x86/kernel/kvm.c |    6 ++++++
Joerg Roedel 84d036
 1 file changed, 6 insertions(+)
Joerg Roedel 84d036
Joerg Roedel 84d036
--- a/arch/x86/kernel/kvm.c
Joerg Roedel 84d036
+++ b/arch/x86/kernel/kvm.c
Joerg Roedel 84d036
@@ -578,11 +578,17 @@ static uint32_t __init kvm_detect(void)
Joerg Roedel 84d036
 	return kvm_cpuid_base();
Joerg Roedel 84d036
 }
Joerg Roedel 84d036
 
Joerg Roedel 84d036
+static bool __init kvm_msi_ext_dest_id(void)
Joerg Roedel 84d036
+{
Joerg Roedel 84d036
+	return kvm_para_has_feature(KVM_FEATURE_MSI_EXT_DEST_ID);
Joerg Roedel 84d036
+}
Joerg Roedel 84d036
+
Joerg Roedel 84d036
 const __initconst struct hypervisor_x86 x86_hyper_kvm = {
Joerg Roedel 84d036
 	.name			= "KVM",
Joerg Roedel 84d036
 	.detect			= kvm_detect,
Joerg Roedel 84d036
 	.type			= X86_HYPER_KVM,
Joerg Roedel 84d036
 	.init.x2apic_available	= kvm_para_available,
Joerg Roedel 84d036
+	.init.msi_ext_dest_id	= kvm_msi_ext_dest_id,
Joerg Roedel 84d036
 };
Joerg Roedel 84d036
 
Joerg Roedel 84d036
 static __init int activate_jump_labels(void)