qemu/hw/ide
Niklas Cassel ccac65fbd1 hw/ide/ahci: fix broken SError handling
When encountering an NCQ error, you should not write the NCQ tag to the
SError register. This is completely wrong.

The SError register has a clear definition, where each bit represents a
different error, see PxSERR definition in AHCI 1.3.1.

If we write a random value (like the NCQ tag) in SError, e.g. Linux will
read SError, and will trigger arbitrary error handling depending on the
NCQ tag that happened to be executing.

In case of success, ncq_cb() will call ncq_finish().
In case of error, ncq_cb() will call ncq_err() (which will clear
ncq_tfs->used), and then call ncq_finish(), thus using ncq_tfs->used is
sufficient to tell if finished should get set or not.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20230609140844.202795-9-nks@flawful.org
Signed-off-by: John Snow <jsnow@redhat.com>
(cherry picked from commit 9f89423537)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2023-09-11 10:53:51 +03:00
..
ahci_internal.h hw: replace most qemu_bh_new calls with qemu_bh_new_guarded 2023-09-11 10:53:50 +03:00
ahci-allwinner.c ahci: Move QOM macro to header 2020-08-27 14:04:54 -04:00
ahci.c hw/ide/ahci: fix broken SError handling 2023-09-11 10:53:51 +03:00
atapi.c block: Change blk_{pread,pwrite}() param order 2022-07-12 12:14:56 +02:00
cmd646.c ide: Rename ide_bus_new() to ide_bus_init() 2021-09-30 13:44:13 +01:00
core.c hw/ide/core: set ERR_STAT in unsupported command completion 2023-09-11 10:53:50 +03:00
ich.c nomaintainer: Fix Lesser GPL version number 2020-11-15 17:04:40 +01:00
ioport.c hw/ide: Fix crash when plugging a piix3-ide device into the x-remote machine 2021-07-19 10:08:45 +02:00
isa.c hw/isa: Inline and remove one-line isa_init_irq() 2022-03-08 19:38:17 +01:00
Kconfig hw/ide/Kconfig: Add missing dependency PCI -> IDE_QDEV 2021-07-20 15:30:42 +02:00
macio.c hw/ppc/mac.h: Rename to include/hw/nvram/mac_nvram.h 2022-10-31 18:48:23 +00:00
meson.build meson: convert hw/ide 2020-08-21 06:30:30 -04:00
microdrive.c hw/ide/microdrive: Use device_cold_reset() for self-resets 2022-10-20 12:11:53 +01:00
mmio.c ide: Rename ide_bus_new() to ide_bus_init() 2021-09-30 13:44:13 +01:00
pci.c ide: rename cmd_write to ctrl_write 2020-10-01 13:04:16 -04:00
piix.c hw/ide/piix: properly initialize the BMIBA register 2023-07-15 10:01:15 +03:00
qdev.c ide: Rename ide_bus_new() to ide_bus_init() 2021-09-30 13:44:13 +01:00
sii3112.c ide: Rename ide_bus_new() to ide_bus_init() 2021-09-30 13:44:13 +01:00
trace-events docs: fix references to docs/devel/tracing.rst 2021-06-02 06:51:09 +02:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
via.c hw/isa/vt82c686: Introduce TYPE_VIA_IDE define 2022-10-31 11:32:07 +01:00