pc-bios/s390-ccw: Fix off-by-one errors with loadparm and boot entries
The loadparm may optionally be used to select a boot entry, with the intended range being 0 through 31 inclusive, for a total of 32 entries. Previously, MAX_BOOT_ENTRIES was defined as 31, indicating that it was intended to correspond to the index of the boot entry rather than the count; however, some guards also used MAX_BOOT_ENTRIES as a count of the maximum allowed entries, which resulted in a mismatch between the intended and actual range such that index 31 could never be used in practice. Move the definition of MAX_BOOT_ENTRIES to qipl.h so it is shared and change the value to 32, representing a count of the maximum number of allowed boot entries and allowing the loadparm to accept values 0 through 31 as intended. Update some instances in the netboot code where MAX_BOOT_ENTRIES was used as the max index so that all guards treat MAX_BOOT_ENTRIES as a count across all boot methods. Cc: qemu-stable@nongnu.org Fixes: 806315279d5c ("pc-bios/s390-ccw: Remove panics from ECKD IPL path") Signed-off-by: Jared Rossi <jrossi@linux.ibm.com> Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com> Link: https://lore.kernel.org/qemu-devel/20260728223013.4047042-1-jrossi@linux.ibm.com Signed-off-by: Eric Farman <farman@linux.ibm.com>