From: Philippe Mathieu-Daudé Date: Wed, 7 Jan 2026 13:08:02 +0000 (+0100) Subject: target/s390x: Simplify S390_ADAPTER_SUPPRESSIBLE definition X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=901e2eb325efe91cd3e5b4368b9f2e2818adfcc4;p=thirdparty%2Fqemu.git target/s390x: Simplify S390_ADAPTER_SUPPRESSIBLE definition Commit 1497c160661 ("s390x: add flags field for registering I/O adapter") defined S390_ADAPTER_SUPPRESSIBLE twice, one when KVM is available and another when it isn't. However both definitions expand to the same value. Unify them, adding an extra safety check in KVM-specific file. This allows removing the target-specific 'CONFIG_KVM' definition in "cpu.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Message-ID: <20260107130807.69870-15-philmd@linaro.org> Signed-off-by: Thomas Huth --- diff --git a/include/hw/s390x/css.h b/include/hw/s390x/css.h index 0b0400a9d4..d3326237c9 100644 --- a/include/hw/s390x/css.h +++ b/include/hw/s390x/css.h @@ -238,6 +238,8 @@ uint32_t css_get_adapter_id(CssIoAdapterType type, uint8_t isc); void css_register_io_adapters(CssIoAdapterType type, bool swap, bool maskable, uint8_t flags, Error **errp); +#define S390_ADAPTER_SUPPRESSIBLE 0x01 + SubchDev *css_find_subch(uint8_t m, uint8_t cssid, uint8_t ssid, uint16_t schid); bool css_subch_visible(SubchDev *sch); diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index ba2bf177e8..40bc1f0741 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -39,12 +39,6 @@ #define S390_MAX_CPUS 248 -#ifndef CONFIG_KVM -#define S390_ADAPTER_SUPPRESSIBLE 0x01 -#else -#define S390_ADAPTER_SUPPRESSIBLE KVM_S390_ADAPTER_SUPPRESSIBLE -#endif - typedef struct PSW { uint64_t mask; uint64_t addr; diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c index bd6c440aef..54d28e37d4 100644 --- a/target/s390x/kvm/kvm.c +++ b/target/s390x/kvm/kvm.c @@ -2082,6 +2082,8 @@ int kvm_s390_vcpu_interrupt_post_load(S390CPU *cpu) return r; } +QEMU_BUILD_BUG_ON(S390_ADAPTER_SUPPRESSIBLE != KVM_S390_ADAPTER_SUPPRESSIBLE); + int kvm_arch_fixup_msi_route(struct kvm_irq_routing_entry *route, uint64_t address, uint32_t data, PCIDevice *dev) {