Statistics
| Branch: | Revision:

root / hw / ide / ahci.c @ 2c9b15ca

History | View | Annotate | Download (38.8 kB)

# Date Author Comment
2c9b15ca 07/04/2013 06:42 pm Paolo Bonzini

memory: add owner argument to initialization functions

Signed-off-by: Paolo Bonzini <>

f487b677 07/04/2013 06:42 pm Paolo Bonzini

dma: keep a device alive while it has SGLists

Reviewed-by: Anthony Liguori <>
Signed-off-by: Paolo Bonzini <>

df32fd1c 06/20/2013 05:39 pm Paolo Bonzini

dma: eliminate DMAContext

The DMAContext is a simple pointer to an AddressSpace that is now always
already available. Make everyone hold the address space directly,
and clean up the DMA API to use the AddressSpace directly.

Reviewed-by: Peter Maydell <>...

0ee20e66 05/08/2013 04:28 pm Kevin Wolf

ahci: Don't allow creating slave drives

An IDE bus provided by AHCI can only take a single IDE drive. If you add
a drive as slave, qemu used to accept the command line but the device
wouldn't be actually usable. Catch the situation instead and error out....

0bc3cd62 04/15/2013 07:19 pm Paolo Bonzini

include: avoid useless includes of exec/ headers

Headers in include/exec/ are for the deepest innards of QEMU,
they should almost never be included directly.

Signed-off-by: Paolo Bonzini <>

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....

1147bb15 01/25/2013 07:18 pm Jason Baron

ahci: Remove unused AHCIDevice fields

'dma_status' and 'dma_cb' are written to, but never read.
Remove these fields in preparation for AHCI migration bits.

Signed-off-by: Jason Baron <>
Reviewed-by: Juan Quintela <>
Signed-off-by: Kevin Wolf <>

4ac557c8 01/25/2013 07:18 pm Kevin Wolf

ahci: Change data types in preparation for migration

The size of an int depends on the host, so in order to be able to
migrate these fields, make them either int32_t or bool, depending on the
use.

Signed-off-by: Kevin Wolf <>

a2623021 01/25/2013 07:18 pm Jason Baron

ahci: Add migration support

Jason tested these patches by migrating Windows 7 and Fedora 17 guests
(while under I/O) on both piix with ahci attached and on q35 (which has
a built-in AHCI controller).

Signed-off-by: Andreas Färber <>
Signed-off-by: Jason Baron <>...

8c43a6f0 01/10/2013 11:11 pm Andreas Färber

Make all static TypeInfos const

Since 39bffca2030950ef6efe57c2fac8327a45ae1015 (qdev: register all
types natively through QEMU Object Model), TypeInfo as used in
the common, non-iterative pattern is no longer amended with information
and should therefore be const....

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

softmmu: move include files to include/sysemu/

Signed-off-by: Paolo Bonzini <>

83c9089e 12/19/2012 09:31 am Paolo Bonzini

monitor: move include files to include/monitor/

Signed-off-by: Paolo Bonzini <>

022c62cb 12/19/2012 09:31 am Paolo Bonzini

exec: move include files to include/exec/

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,...

2a4f4f34 09/12/2012 04:50 pm Jason Baron

ahci: properly reset PxCMD on HBA reset

While testing q35, I found that windows 7 (specifically, windows 7 ultimate
with sp1 x64), wouldn't install because it can't find the cdrom or disk drive.
The failure message is: 'A required cd/dvd device driver is missing. If you...

61f52e06 08/10/2012 11:25 am Jason Baron

ahci: Fix ahci cdrom read corruptions for reads > 128k

While testing q35, which has its cdrom attached to the ahci controller, I found
that the Fedora 17 install would panic on boot. The panic occurs while
squashfs is trying to read from the cdrom. The errors are:...

ea8d82a1 08/10/2012 11:25 am Jason Baron

ahci: Fix sglist memleak in ahci_dma_rw_buf()

I noticed that in hw/ide/ahci:ahci_dma_rw_buf() we do not free the sglist. Thus,
I've added a call to qemu_sglist_destroy() to fix this memory leak.

In addition, I've adeed a call in qemu_sglist_destroy() to 0 all of the sglist...

c65bcef3 06/28/2012 12:33 am David Gibson

iommu: Make sglists and dma_bdrv helpers use new universal DMA helpers

dma-helpers.c contains a number of helper functions for doing
scatter/gather DMA, and various block device related DMA. Currently,
these directly access guest memory using cpu_physical_memory_*(),...

10ca2943 06/28/2012 12:33 am David Gibson

ide/ahci: Use universal DMA helper functions

The AHCI device can provide both PCI and SysBus AHCI device
emulations. For this reason, it wasn't previously converted to use
the pci_dma_*() helper functions. Now that we have universal DMA
helper functions, this converts AHCI to use them....

8ab60a07 06/07/2012 05:18 pm Jan Kiszka

ahci: Clean up reset functions

Properly register reset functions via the device class.

CC: Alexander Graf <>
Signed-off-by: Jan Kiszka <>
Signed-off-by: Michael S. Tsirkin <>

4bb9c939 05/30/2012 03:51 pm Daniel Verkamp

ahci: SATA FIS is 20 bytes, not 0x20

As in the SATA and AHCI specifications, a FIS is 5 Dwords of 4 bytes
each, which comes to 20 bytes (decimal), not 0x20.

Signed-off-by: Daniel Verkamp <>
Signed-off-by: Kevin Wolf <>

a348f108 03/11/2012 01:40 pm Stefan Weil

Add missing const attributes for MemoryRegionOps

Most MemoryRegionOps already had the const attribute.
This patch adds it to the remaining ones.

Signed-off-by: Stefan Weil <>
Signed-off-by: Blue Swirl <>

da221327 02/22/2012 02:29 pm Paolo Bonzini

ahci: use new DMA helpers

Signed-off-by: Paolo Bonzini <>

65b31cc2 02/16/2012 01:18 am Anthony Liguori

Merge remote-tracking branch 'kwolf/for-anthony' into staging

  • kwolf/for-anthony:
    AHCI: Masking of IRQs actually masks them
    sheepdog: fix co_recv coroutine context
    AHCI: Fix port reset race
    rewrite QEMU_BUILD_BUG_ON
    qcow2: Keep unknown header extension when rewriting header...
83f7d43a 02/15/2012 05:39 pm Andreas Färber

qom: Unify type registration

Replace device_init() with generalized type_init().

While at it, unify naming convention: type_init([$prefix_]register_types)
Also, type_init() is a function, so add preceding blank line where
necessary and don't put a semicolon after the closing brace....

c9b308d2 02/09/2012 05:17 pm Alexander Graf

AHCI: Fix port reset race

bdrv_aio_cancel() can trigger bdrv_aio_flush() which makes all aio
that is currently in flight finish. So what we do is:

port reset
detect ncq in flight
cancel ncq
delete ncq sg list

at which point we have double freed the sg list. Instead, with this...

b8676728 02/09/2012 05:17 pm Alexander Graf

AHCI: Masking of IRQs actually masks them

When masking IRQ lines, we should actually mask them out and not declare
them active anymore. Once we mask them in again, they are allowed to trigger
again.

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

39bffca2 02/03/2012 06:41 pm Anthony Liguori

qdev: register all types natively through QEMU Object Model

This was done in a mostly automated fashion. I did it in three steps and then
rebased it into a single step which avoids repeatedly touching every file in
the tree.

The first step was a sed-based addition of the parent type to the subclass...

999e12bb 01/27/2012 06:50 pm Anthony Liguori

sysbus: apic: ioapic: convert to QEMU Object Model

This converts three devices because apic and ioapic are subclasses of sysbus.
Converting subclasses independently of their base class is prohibitively hard.

Signed-off-by: Anthony Liguori <>

d9fa31a3 01/26/2012 01:43 pm Rob Herring

ahci: add support for non-PCI based controllers

Add support for ahci on sysbus.

Signed-off-by: Rob Herring <>
Signed-off-by: Mark Langsdorf <>
Reviewed-by: Andreas Färber <>
Signed-off-by: Peter Maydell <>

3899edf7 10/26/2011 04:22 pm Max Filippov

ahci: fix DPRINTF format strings

Signed-off-by: Max Filippov <>
Signed-off-by: Stefan Hajnoczi <>

465f1ab1 09/21/2011 03:32 pm Daniel Verkamp

ahci: add port I/O index-data pair

Implement an I/O space index-data register pair as defined by the AHCI
spec, including the corresponding SATA PCI capability and BAR.

This allows real-mode code to access the AHCI registers; real-mode
code cannot address the memory-mapped register space because it is...

c8af89af 09/20/2011 11:21 pm Anthony Liguori

Merge remote-tracking branch 'kwolf/for-anthony' into staging

a26a13da 09/20/2011 01:27 pm Alexander Motin

AHCI Port Interrupt Enable register cleaning on soft reset

I've found that FreeBSD AHCI driver doesn't work with AHCI hardware
emulation of QEMU 0.15.0. I believe the problem is on QEMU's side. As I
see, it clears port's Interrupt Enable register each time when reset of...

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....

847f171e 09/12/2011 04:17 pm Stefan Weil

ahci: Remove unused struct member

Member variable is_read is written, but never read
(contrary to its name). Remove it.

Kevin Wolf <>
Signed-off-by: Stefan Weil <>
Signed-off-by: Kevin Wolf <>

a597e79c 08/25/2011 07:18 pm Christoph Hellwig

block: explicit I/O accounting

Decouple the I/O accounting from bdrv_aio_readv/writev/flush and
make the hardware models call directly into the accounting helpers.

This means:
- we do not count internal requests from image formats in addition
to guest originating I/O...

7267c094 08/21/2011 07:01 am Anthony Liguori

Use glib memory allocation and free functions

qemu_malloc/qemu_free no longer exist after this commit.

Signed-off-by: Anthony Liguori <>

67e576c2 08/08/2011 06:22 pm Avi Kivity

ahci: convert to memory API

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

1fddfba1 05/19/2011 01:08 pm Alexander Graf

ahci: Fix non-NCQ accesses for LBA > 16bits

AHCI provides two ways of reading/writing data:

1) NCQ
2) ATA commands with the LBA in the command FIS

In the second code path, we didn't handle any LBAs that were bigger than
16 bits, so whenever a guest that used high LBA numbers wanted to access...

4d29b50a 05/18/2011 03:38 pm Jan Kiszka

ahci: Fix crashes on duplicate BH registration

If ahci_dma_set_inactive is called a while there is still a pending BH
from a previous run, we will crash on the second run of
ahci_check_cmd_bh as it overwrites AHCIDevice::check_bh. Avoid this
broken and redundant duplicate registration....

667bb59d 04/07/2011 01:56 pm Avi Kivity

ich/ahci: convert to pci_register_bar_simple()

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

2c4b9d0e 02/07/2011 12:40 pm Alexander Graf

ahci: make number of ports runtime determined

Different AHCI controllers have a different number of ports, so the core
shouldn't care about the amount of ports available.

This patch makes the number of ports available to the AHCI core runtime
configurable, allowing us to have multiple different AHCI implementations...

760c3e44 02/07/2011 12:38 pm Alexander Graf

ahci: Implement HBA reset

The ahci code was missing its soft reset functionality. This wasn't really an
issue for Linux guests, but Windows gets confused when the controller doesn't
reset when it tells it so.

Using this patch I can now successfully boot Windows 7 from AHCI using AHCI...

87e62065 02/07/2011 12:38 pm Alexander Graf

ahci: send init d2h fis on fis enable

The drive sends a d2h init fis on initialization. Usually, the guest doesn't
receive fises yet at that point though, so the delivery is deferred.

Let's reflect that by sending the init fis on fis receive enablement....

7fb6577b 02/07/2011 12:37 pm Alexander Graf

ahci: split ICH and AHCI even more

Sebastian's patch already did a pretty good job at splitting up ICH-9
AHCI code and the AHCI core. We need some more though. Copyright was missing,
the lspci dump belongs to ICH-9, we don't need the AHCI core to have its...

03c7a6a8 02/07/2011 12:14 pm Sebastian Herbszt

ahci: split ICH9 from core

There are multiple ahci devices out there. The currently implemented ich-9
is only one of the many. So let's split that one out into a separate file
to stress the difference.

Signed-off-by: Sebastian Herbszt <>
Signed-off-by: Alexander Graf <>...

27d6bf40 01/31/2011 11:42 am Markus Armbruster

blockdev: Fix regression in -drive if=scsi,index=N

Before commit 622b520f, index=12 meant bus=1,unit=5.

Since the commit, it means bus=0,unit=12. The drive is created, but
not the guest device. That's because the controllers we use with
if=scsi drives (lsi53c895a and esp) support only 7 units, and...

fe6ceac8 01/31/2011 11:03 am Stefan Hajnoczi

ahci: Fix cpu_physical_memory_unmap() argument ordering

The len and is_write arguments to cpu_physical_memory_unmap() were
swapped. This patch changes calls to use the correct argument ordering.

Signed-off-by: Stefan Hajnoczi <>...

cdfe17df 12/19/2010 12:43 pm Blue Swirl

ahci: delete write-only variables (v2)

Avoid these warnings with GCC 4.6.0:
/src/qemu/hw/ide/ahci.c: In function 'ahci_reset_port':
/src/qemu/hw/ide/ahci.c:810:14: error: variable 'tfd' set but not used [-Werror=unused-but-set-variable]
/src/qemu/hw/ide/ahci.c: In function 'handle_cmd':...

38a08f05 12/17/2010 05:11 pm Sebastian Herbszt

ahci: set SATA Mode Select

Set SATA Mode Select to AHCI in the Address Map Register.

Signed-off-by: Sebastian Herbszt <>
Signed-off-by: Kevin Wolf <>

f6ad2e32 12/17/2010 05:11 pm Alexander Graf

ahci: add ahci emulation

This patch adds an emulation layer for an ICH-9 AHCI controller. For now
this controller does not do IDE legacy emulation. It is a pure AHCI controller.

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