qemu-e2k/hw
Alexander Popov ed78352a59 ide: Fix incorrect handling of some PRDTs in ide_dma_cb()
The commit a718978ed5 from July 2015 introduced the assertion which
implies that the size of successful DMA transfers handled in ide_dma_cb()
should be multiple of 512 (the size of a sector). But guest systems can
initiate DMA transfers that don't fit this requirement.

For fixing that let's check the number of bytes prepared for the transfer
by the prepare_buf() handler. The code in ide_dma_cb() must behave
according to the Programming Interface for Bus Master IDE Controller
(Revision 1.0 5/16/94):
1. If PRDs specified a smaller size than the IDE transfer
   size, then the Interrupt and Active bits in the Controller
   status register are not set (Error Condition).
2. If the size of the physical memory regions was equal to
   the IDE device transfer size, the Interrupt bit in the
   Controller status register is set to 1, Active bit is set to 0.
3. If PRDs specified a larger size than the IDE transfer size,
   the Interrupt and Active bits in the Controller status register
   are both set to 1.

Signed-off-by: Alexander Popov <alex.popov@linux.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-id: 20191223175117.508990-2-alex.popov@linux.com
Signed-off-by: John Snow <jsnow@redhat.com>
2020-01-27 17:07:31 -05:00
..
9pfs * Register qdev properties as class properties (Marc-André) 2020-01-27 09:44:04 +00:00
acpi * Register qdev properties as class properties (Marc-André) 2020-01-27 09:44:04 +00:00
adc
alpha hw: replace hw/i386/pc.h with a header just for the i8259 2019-12-17 19:33:49 +01:00
arm * Register qdev properties as class properties (Marc-André) 2020-01-27 09:44:04 +00:00
audio qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
block qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
bt Remove the core bluetooth code 2019-12-17 09:01:14 +01:00
char * Register qdev properties as class properties (Marc-André) 2020-01-27 09:44:04 +00:00
core qdev: register properties as class properties 2020-01-24 20:59:16 +01:00
cpu qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
cris cris: improve passing PIC interrupt vector to the CPU 2020-01-07 17:24:29 +04:00
display qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
dma * Register qdev properties as class properties (Marc-André) 2020-01-27 09:44:04 +00:00
gpio qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
hppa hw: replace hw/i386/pc.h with a header just for the i8259 2019-12-17 19:33:49 +01:00
hyperv hyperv: Use auto rcu_read macros 2019-12-17 19:33:52 +01:00
i2c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
i386 * Register qdev properties as class properties (Marc-André) 2020-01-27 09:44:04 +00:00
ide ide: Fix incorrect handling of some PRDTs in ide_dma_cb() 2020-01-27 17:07:31 -05:00
input qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
intc s390x: adapter routes error handling 2020-01-27 12:13:09 +01:00
ipack qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
ipmi qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
isa qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
lm32
m68k Clean-ups: qom-ify serial and remove QDEV_PROP_PTR 2020-01-07 17:54:29 +00:00
mem qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
microblaze
mips qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
misc * Register qdev properties as class properties (Marc-André) 2020-01-27 09:44:04 +00:00
moxie
net qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
nios2
nubus hw/m68k: add Nubus support 2019-10-28 19:06:47 +01:00
nvram qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
openrisc
pci qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
pci-bridge qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
pci-host * Register qdev properties as class properties (Marc-André) 2020-01-27 09:44:04 +00:00
pcmcia
ppc qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
rdma qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
riscv * Register qdev properties as class properties (Marc-André) 2020-01-27 09:44:04 +00:00
rtc qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
s390x hw/s390x: Add a more verbose comment about get_machine_class() and the wrappers 2020-01-27 12:13:10 +01:00
scsi qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
sd qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
semihosting semihosting: add qemu_semihosting_console_inc for SYS_READC 2020-01-09 11:41:29 +00:00
sh4 sm501: make SerialMM a child, export chardev property 2020-01-07 17:24:29 +04:00
smbios
sparc qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
sparc64 qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
ssi qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
timer qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
tpm qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
tricore
unicore32
usb qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
vfio qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
virtio * Register qdev properties as class properties (Marc-André) 2020-01-27 09:44:04 +00:00
watchdog qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
xen qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
xenpv
xtensa
Kconfig Remove the core bluetooth code 2019-12-17 09:01:14 +01:00
Makefile.objs Remove the core bluetooth code 2019-12-17 09:01:14 +01:00