]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/s390x: Simplify S390_ADAPTER_SUPPRESSIBLE definition
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Wed, 7 Jan 2026 13:08:02 +0000 (14:08 +0100)
committerThomas Huth <thuth@redhat.com>
Mon, 12 Jan 2026 12:56:28 +0000 (13:56 +0100)
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é <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260107130807.69870-15-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
include/hw/s390x/css.h
target/s390x/cpu.h
target/s390x/kvm/kvm.c

index 0b0400a9d4f73b83410fb9b073cbdde701de6074..d3326237c9f03bb12872971ca2d5f232943bcc2b 100644 (file)
@@ -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);
index ba2bf177e8f9e65f0cdd901e19b45cc149d232bf..40bc1f0741d5f3cafe3d0db2dbe98842fe3d973f 100644 (file)
 
 #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;
index bd6c440aefb3b98019bb83d8cebe3e633683a951..54d28e37d4dda8e341675e6bbaf5cc74ca80f45f 100644 (file)
@@ -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)
 {