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é <[email protected]> Signed-off-by: Xiaoyao Li <[email protected]> --- target/i386/kvm/tdx.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c index 0d30506c2021..4128f27d6b64 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 "exec/ramblock.h" @@ -390,6 +391,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) { -- 2.34.1
