qemu/hw/ide
Lev Kujawski 8682ff6960 hw/ide/core.c (cmd_read_native_max): Avoid limited device parameters
Always use the native CHS device parameters for the ATA commands READ
NATIVE MAX ADDRESS and READ NATIVE MAX ADDRESS EXT, not those limited
by the ATA command INITIALIZE_DEVICE_PARAMETERS (introduced in patch
176e4961, hw/ide/core.c: Implement ATA INITIALIZE_DEVICE_PARAMETERS
command, 2022-07-07.)

As stated by the ATA/ATAPI specification, "[t]he native maximum is the
highest address accepted by the device in the factory default
condition."  Therefore this patch substitutes the native values in
drive_heads and drive_sectors before calling ide_set_sector().

One consequence of the prior behavior was that setting zero sectors
per track could lead to an FPE within ide_set_sector().  Thanks to
Alexander Bulekov for reporting this issue.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1243
Signed-off-by: Lev Kujawski <lkujaw@mailbox.org>
Message-ID: <20221010085229.2431276-1-lkujaw@mailbox.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2024-04-30 06:21:47 +02:00
..
ahci-allwinner.c hw/ide/ahci: Move SysBus definitions to 'ahci-sysbus.h' 2024-02-15 16:58:46 +01:00
ahci-internal.h hw/ide/ahci: Rename ahci_internal.h to ahci-internal.h 2024-03-11 22:09:42 +01:00
ahci.c hw/ide/ahci: Rename ahci_internal.h to ahci-internal.h 2024-03-11 22:09:42 +01:00
atapi.c hw/ide: Include 'ide-internal.h' from current path 2024-02-27 09:37:30 +01:00
cf.c hw/ide: Add the possibility to disable the CompactFlash device in the build 2024-02-22 12:47:40 +01:00
cmd646.c hw/ide: Include 'ide-internal.h' from current path 2024-02-27 09:37:30 +01:00
core.c hw/ide/core.c (cmd_read_native_max): Avoid limited device parameters 2024-04-30 06:21:47 +02:00
ich.c hw/ide/ahci: Rename ahci_internal.h to ahci-internal.h 2024-03-11 22:09:42 +01:00
ide-bus.c hw/ide: Include 'ide-internal.h' from current path 2024-02-27 09:37:30 +01:00
ide-dev.c ide, vl: turn -win2k-hack into a property on IDE devices 2024-02-28 00:23:39 +01:00
ide-internal.h ide: collapse parameters to ide_init_drive 2024-02-28 00:23:39 +01:00
ioport.c hw/ide: Include 'ide-internal.h' from current path 2024-02-27 09:37:30 +01:00
isa.c hw/ide: Include 'ide-internal.h' from current path 2024-02-27 09:37:30 +01:00
Kconfig hw/ide: Split qdev.c into ide-bus.c and ide-dev.c 2024-02-22 12:47:40 +01:00
macio.c hw/ide: Include 'ide-internal.h' from current path 2024-02-27 09:37:30 +01:00
meson.build hw/ide: Split qdev.c into ide-bus.c and ide-dev.c 2024-02-22 12:47:40 +01:00
microdrive.c hw/ide: Include 'ide-internal.h' from current path 2024-02-27 09:37:30 +01:00
mmio.c hw/ide: Include 'ide-internal.h' from current path 2024-02-27 09:37:30 +01:00
pci.c hw/ide: Include 'ide-internal.h' from current path 2024-02-27 09:37:30 +01:00
piix.c hw/ide: Include 'ide-internal.h' from current path 2024-02-27 09:37:30 +01:00
sii3112.c hw/ide: Include 'ide-internal.h' from current path 2024-02-27 09:37:30 +01:00
trace-events hw/ide: Rename ide_exec_cmd() -> ide_bus_exec_cmd() 2023-02-27 22:29:02 +01:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
via.c hw/ide: Include 'ide-internal.h' from current path 2024-02-27 09:37:30 +01:00