@samitouri / QOSamiQemu / commits / 220c67b0ec

s390x/css: Fix css stsch detection to go beyond 8192 devices

find_last_bit expects a size in bits and not in words. the calculation limits the number of guest devices to 8192. This probably does not matter in reality, its wrong anyway. Fixes: df1fe5bb49241 ("s390: Virtual channel subsystem support") Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com> Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com> Reviewed-by: Eric Farman <farman@linux.ibm.com> Link: https://lore.kernel.org/qemu-devel/20260814152226.1834819-1-borntraeger@de.ibm.com Signed-off-by: Eric Farman <farman@linux.ibm.com>

Christian Borntraeger committed Aug 14, 2026 at 17:22 UTC 220c67b0ec1aaf000342cd2df4aa5df402fcadb3
1 file changed +1 -2
hw/s390x/css.c
+1 -2
@@ -2023,8 +2023,7 @@ bool css_schid_final(int m, uint8_t cssid, uint8_t ssid, uint16_t schid)
2023 return true;
2024 }
2025 set = channel_subsys.css[real_cssid]->sch_set[ssid];
2026 - return schid > find_last_bit(set->schids_used,
2027 - (MAX_SCHID + 1) / sizeof(unsigned long));
2026 + return schid > find_last_bit(set->schids_used, (MAX_SCHID + 1));
2027 }
2028
2029 unsigned int css_find_free_chpid(uint8_t cssid)