Statistics
| Branch: | Revision:

root / hw / ide / pci.c @ f487b677

History | View | Annotate | Download (14.9 kB)

# Date Author Comment
b39f9612 05/08/2013 04:28 pm Kevin Wolf

ide: Reset BMIDEA bit when the bus master is stopped

The device is supposed to reset the Bus Master IDE Active bit in the
status register when 0 is written to the Start/Stop Bus Master bit in
the command register.

In the common cases this happens automatically because bdrv_drain_all()...

0d09e41a 04/08/2013 07:13 pm Paolo Bonzini

hw: move headers to include/

Many of these should be cleaned up with proper qdev-/QOM-ification.
Right now there are many catch-all headers in include/hw/ARCH depending
on cpu.h, and this makes it necessary to compile these files per-target.
However, fixing this does not belong in these patches....

6bf3ee07 01/17/2013 11:51 am Kevin Wolf

ide: Remove wrong assertion

The Bus Master IDE Active bit (BM_STATUS_DMAING) is not only set when
the request is still in flight, but also when it has completed and the
size of the physical memory regions in the PRDT was larger than the
transfer size.

Signed-off-by: Kevin Wolf <>...

9c17d615 12/19/2012 09:32 am Paolo Bonzini

softmmu: move include files to include/sysemu/

Signed-off-by: Paolo Bonzini <>

737e150e 12/19/2012 09:31 am Paolo Bonzini

block: move include files to include/block/

Signed-off-by: Paolo Bonzini <>

a2cb15b0 12/17/2012 01:02 pm Michael S. Tsirkin

pci: update all users to look in pci/

update all users so we can remove the makefile hack.

Signed-off-by: Michael S. Tsirkin <>

a8170e5e 10/23/2012 04:58 pm Avi Kivity

Rename target_phys_addr_t to hwaddr

target_phys_addr_t is unwieldly, violates the C standard (_t suffixes are
reserved) and its purpose doesn't match the name (most target_phys_addr_t
addresses are not target specific). Replace it with a finger-friendly,...

1ceee0d5 09/28/2012 08:40 pm Paolo Bonzini

iostatus: change is_read to a bool

Do this while we are touching this part of the code, before introducing
more uses of "int is_read".

Signed-off-by: Paolo Bonzini <>
Reviewed-by: Eric Blake <>
Signed-off-by: Kevin Wolf <>

cb67be85 02/10/2012 12:44 pm Hervé Poussineau

ide: fix compilation errors when DEBUG_IDE is set

Signed-off-by: Hervé Poussineau <>
Signed-off-by: Stefan Hajnoczi <>

964455f3 01/21/2012 06:17 am David Gibson

Correct types in bmdma_addr_{read,write}

Back when I made patches introducing dma_addr_t and various PCI DMA
wrapper functions, I made a mistake. The bmdma_addr_{read,write} functions
need to take target_phys_addr_t not dma_addr_t, since they are assigned...

859e538d 12/12/2011 07:16 pm David Gibson

Remove unnecessary casts from PCI DMA code in PCI IDE

This patch removes some unnecessary casts in the PCI IDE device,
introduced by commit 552908fef5b67ad9d96b76d7cb8371ebc26c9bc8
'PCI IDE: Use PCI DMA stub functions'.

Signed-off-by: David Gibson <>...

922453bc 12/05/2011 03:56 pm Stefan Hajnoczi

block: convert qemu_aio_flush() calls to bdrv_drain_all()

Many places in QEMU call qemu_aio_flush() to complete all pending
asynchronous I/O. Most of these places actually want to drain all block
requests but there is no block layer API to do so.

This patch introduces the bdrv_drain_all() API to wait for requests...

552908fe 11/01/2011 11:52 pm David Gibson

PCI IDE: Use PCI DMA stub functions

This updates the PCI IDE device emulation to use the explicit PCI DMA
wrapper to initialize its scatter/gathjer structure. This means this
driver should not need further changes when the sglist interface is
extended to support IOMMUs....

1dfb4dd9 09/15/2011 10:39 pm Luiz Capitulino

Replace the VMSTOP macros with a proper state type

Today, when notifying a VM state change with vm_state_notify(),
we pass a VMSTOP macro as the 'reason' argument. This is not ideal
because the VMSTOP macros tell why qemu stopped and not exactly
what the current VM state is....

fb0c61a5 09/12/2011 04:17 pm Markus Armbruster

hw: Trim superfluous #include "block_int.h"

Including it in device models is unclean, including it without a
reason adds insult to injury.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

a9deb8c6 08/08/2011 06:15 pm Avi Kivity

ide: convert to memory API

Reviewed-by: Richard Henderson <>
Reviewed-by: Anthony Liguori <>
Signed-off-by: Avi Kivity <>
Signed-off-by: Anthony Liguori <>

ee752da7 06/15/2011 04:39 pm Kevin Wolf

ide: Clear error_status after restarting flush

Clearing the error status flag was missing for restarting flushes. Now that the
error status is separate from the BM status register, we can simply set it to 0
after restarting the request. This ensures that we never forget to clear a bit....

4e1e0051 06/15/2011 03:36 pm Christoph Hellwig

ide: allow other dma comands than read and write

Replace the is_read flag with a dma_cmd flag to allow the dma and
restart logic to handler other commands like TRIM.

Signed-off-by: Christoph Hellwig <>
Signed-off-by: Kevin Wolf <>

d353fb72 06/15/2011 03:36 pm Christoph Hellwig

ide: add TRIM support

Add support for TRIM sub function of the data set management command,
and wire it up to the qemu discard infrastructure.

Signed-off-by: Christoph Hellwig <>
Signed-off-by: Kevin Wolf <>

def93791 06/15/2011 03:36 pm Kevin Wolf

ide: Split error status from status register

When adding the werror=stop mode, some flags were added to s->status
which are used to determine what kind of operation should be restarted
when the VM is continued.

Unfortunately, it turns out that s->status is in fact a device register...

086cf4d3 05/18/2011 03:38 pm Andrea Arcangeli

ide: cleanup warnings

Add \n.

Signed-off-by: Andrea Arcangeli <>
Signed-off-by: Kevin Wolf <>

2860e3eb 05/18/2011 03:38 pm Kevin Wolf

ide: Turn debug messages into assertions

These printfs aren't really debug messages, but clearly indicate a bug if they
ever become effective. Noone uses DEBUG_IDE, let's re-enable the check
unconditionally and make it an assertion instead of printfs in the device...

a08784dd 04/15/2011 09:25 pm Blue Swirl

Remove unused sysemu.h include directives

Remove unused sysemu.h include directives to speed up build
with the following patches.

Signed-off-by: Blue Swirl <>

1635eecc 01/24/2011 05:41 pm Stefan Weil

ide: Remove unneeded null pointer check

With bm == NULL, other code in the same function would crash.

This bug was reported by cppcheck:
hw/ide/pci.c:280: error: Possible null pointer dereference: bm

Cc: Michael S. Tsirkin <>
Signed-off-by: Stefan Weil <>...

cd369c46 01/24/2011 12:08 pm Christoph Hellwig

ide: factor dma handling helpers

Factor the DMA I/O path that is duplicated between read and write
commands, into common helpers using the s->is_read flag added for
the macio ATA controller.

Signed-off-by: Christoph Hellwig <>
Signed-off-by: Kevin Wolf <>

40a6238a 12/17/2010 05:11 pm Alexander Graf

ide: Split out BMDMA code from ATA core

The ATA core is currently heavily intertwined with BMDMA code. Let's loosen
that a bit, so we can happily replace the DMA backend with different
implementations.

Signed-off-by: Alexander Graf <>
Signed-off-by: Kevin Wolf <>

b76876e6 11/29/2010 05:15 pm Kevin Wolf

ide: Reset current_addr after stopping DMA

Whenever SSBM is reset in the command register all state information is lost.
Restarting DMA means that current_addr must be reset to the base address of the
PRD table. The OS is not required to change the base address register before...

c29947bb 11/29/2010 05:15 pm Kevin Wolf

ide: Ignore double DMA transfer starts/stops

You can only start a DMA transfer if it's not running yet, and you can only
cancel it if it's running.

Signed-off-by: Kevin Wolf <>
Reviewed-by: Stefan Hajnoczi <>

9fbef1ac 11/24/2010 06:31 pm Avi Kivity

ide: convert bmdma address ioport to ioport_register()

cmd646, via compile tested, pci lightly boot tested.

Signed-off-by: Avi Kivity <>
Signed-off-by: Kevin Wolf <>

953844d1 08/03/2010 04:57 pm Andrea Arcangeli

ide: Avoid canceling IDE DMA

The reason for not actually canceling the I/O is because with
virtualization and lots of VM running, a guest fs may mistake a
overload of the host, as an IDE timeout. So rather than canceling the
I/O, it's safer to wait I/O completion and simulate that the I/O has...

57338424 07/27/2010 12:19 am Juan Quintela

Revert "ide save/restore current transfer fields"

This reverts commit 42ee76fe82093ba914f0dc83d2decbcf68866144.

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

5ee84c33 07/27/2010 12:19 am Juan Quintela

ide: fix migration in the middle of a bmdma transfer

It reintroduces
Revert "ide save/restore pio/atapi cmd transfer fields and io buffer"

but using subsections. Added bonus is the addition of ide_dummy_transfer_stop
to transfer_end_table, that was missing....

42ee76fe 01/26/2010 11:42 pm Marcelo Tosatti

ide save/restore current transfer fields

If migration takes place between write of the bmdma address register and
write of the command register (to initiate DMA), the destination will
not properly start the DMA op, hanging the guest:

ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen...

407a4f30 10/27/2009 07:28 pm Juan Quintela

ide: port pci ide to vmstate

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

61073e0f 10/12/2009 05:42 pm Juan Quintela

ide: change cast to DO_UPCAST

Patchworks-ID: 35293
Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

e6a7830a 10/12/2009 05:42 pm Juan Quintela

ide: Remove cast in pci_register_bar

We already have a PCIDevice at that point

Patchworks-ID: 35296
Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

65c0f135 10/12/2009 05:42 pm Juan Quintela

ide: create ide/pci.h for common ide pci definitions

Patchworks-ID: 35299
Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

3e7e1558 10/12/2009 05:42 pm Juan Quintela

ide: export needed ide-pci functions for split

Patchworks-ID: 35300
Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

4c3df0ec 10/12/2009 05:42 pm Juan Quintela

ide: split cmd646 and piix from pci.c

This patch splits cmd646 specific code from pci.c.
This patch splits piix4 specific code from pci.c.
And compile new piix.o and cmd646.o when they are needed.
The only change that is not code movemet is removal of cmd646 specific parts...

e23a1b33 10/07/2009 04:54 pm Markus Armbruster

New qdev_init_nofail()

Like qdev_init(), but terminate program via hw_error() instead of
returning an error value.

Use it instead of qdev_init() where terminating the program on failure
is okay, either because it's during machine construction, or because...

499cf102 10/05/2009 05:32 pm Markus Armbruster

Rename pci_create_noinit() to pci_create()

It's qdev_create() specialized for PCI, so name it accordingly.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Anthony Liguori <>

1f850f10 10/05/2009 05:32 pm Gerd Hoffmann

switch ide bus to inplace allocation.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

feef3102 09/15/2009 11:04 pm Gerd Hoffmann

ide/pci: convert to qdev.

With this patch applied ide drives (when attached to a pci adapter) can
be created via -device, like this:

-drive if=none,id=mydisk,file=/path/to/disk.img
-device ide-drive,drive=mydisk,bus=ide.0,unit=0

Note that creating a master on ide1 doesn't work that way. That is a...

9a43dba0 09/15/2009 11:00 pm Gerd Hoffmann

ide/pci: fix indention

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Blue Swirl <>

ae027ad3 09/04/2009 05:37 pm Stefan Weil

mips malta: Fix fdc regression and use qdev for i8042 setup

8baf73adf664e79eae201c3f618078a220a661d9 (qdev/isa: convert fdc)
breaks MIPS Malta:

Tried to create isa device isa-fdc with no isa bus present

Fix this by creating an isa bus for piix4.
This change also requires some more qdev related changes...

f455e98c 09/04/2009 05:37 pm Gerd Hoffmann

ide: pass down DriveInfo instead of BlockDriverState

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

59f2a787 08/28/2009 04:46 am Gerd Hoffmann

ide: move code to hw/ide/

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>