mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
pc-bios/s390-ccw Really big EAV ECKD DASD handling
For EAV ECKD DASD, the cylinder count will have the magic value 0xfffeU. Therefore, use the block number to test for valid eckd addresses instead. Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
This commit is contained in:
parent
b0885f7599
commit
f04db28b86
3 changed files with 25 additions and 25 deletions
|
@ -93,25 +93,6 @@ static inline void verify_boot_info(BootInfo *bip)
|
|||
"Bad block size in zIPL section of the 1st record.");
|
||||
}
|
||||
|
||||
static bool eckd_valid_address(BootMapPointer *p)
|
||||
{
|
||||
const uint64_t cylinder = p->eckd.cylinder
|
||||
+ ((p->eckd.head & 0xfff0) << 12);
|
||||
const uint64_t head = p->eckd.head & 0x000f;
|
||||
|
||||
if (head >= virtio_get_heads()
|
||||
|| p->eckd.sector > virtio_get_sectors()
|
||||
|| p->eckd.sector <= 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!virtio_guessed_disk_nature() && cylinder >= virtio_get_cylinders()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static block_number_t eckd_block_num(BootMapPointer *p)
|
||||
{
|
||||
const uint64_t sectors = virtio_get_sectors();
|
||||
|
@ -126,6 +107,24 @@ static block_number_t eckd_block_num(BootMapPointer *p)
|
|||
return block;
|
||||
}
|
||||
|
||||
static bool eckd_valid_address(BootMapPointer *p)
|
||||
{
|
||||
const uint64_t head = p->eckd.head & 0x000f;
|
||||
|
||||
if (head >= virtio_get_heads()
|
||||
|| p->eckd.sector > virtio_get_sectors()
|
||||
|| p->eckd.sector <= 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!virtio_guessed_disk_nature() &&
|
||||
eckd_block_num(p) >= virtio_get_blocks()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static block_number_t load_eckd_segments(block_number_t blk, uint64_t *address)
|
||||
{
|
||||
block_number_t block_nr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue