diff options
author | Xiaoyao Li <xiaoyao.li@intel.com> | 2025-05-08 10:59:44 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2025-05-28 19:35:54 +0200 |
commit | bb45580d842530d78b58179eaf80b6331b15324e (patch) | |
tree | 01e8e11da6eed84ba57594f6421f107bcb6e1d5a | |
parent | e7ef60892c80a9ce5b8504ceb13a81f4e0d4b3f7 (diff) | |
download | qemu-bb45580d842530d78b58179eaf80b6331b15324e.zip qemu-bb45580d842530d78b58179eaf80b6331b15324e.tar.gz qemu-bb45580d842530d78b58179eaf80b6331b15324e.tar.bz2 |
i386/tdx: Set and check kernel_irqchip mode for TDX
KVM mandates kernel_irqchip to be split mode.
Set it to split mode automatically when users don't provide an explicit
value, otherwise check it to be the split mode.
Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20250508150002.689633-39-xiaoyao.li@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | target/i386/kvm/tdx.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c index 32c3f37..68ed3b9 100644 --- a/target/i386/kvm/tdx.c +++ b/target/i386/kvm/tdx.c @@ -16,6 +16,7 @@ #include "qapi/error.h" #include "qom/object_interfaces.h" #include "crypto/hash.h" +#include "system/kvm_int.h" #include "system/runstate.h" #include "system/system.h" #include "system/ramblock.h" @@ -388,6 +389,13 @@ static int tdx_kvm_init(ConfidentialGuestSupport *cgs, Error **errp) return -EINVAL; } + if (kvm_state->kernel_irqchip_split == ON_OFF_AUTO_AUTO) { + kvm_state->kernel_irqchip_split = ON_OFF_AUTO_ON; + } else if (kvm_state->kernel_irqchip_split != ON_OFF_AUTO_ON) { + error_setg(errp, "TDX VM requires kernel_irqchip to be split"); + return -EINVAL; + } + if (!tdx_caps) { r = get_tdx_capabilities(errp); if (r) { |