summaryrefslogtreecommitdiffstats
path: root/hw/ide
Commit message (Collapse)AuthorAgeFilesLines
* ahci: add support for non-PCI based controllersRob Herring2012-01-261-0/+44
| | | | | | | | | Add support for ahci on sysbus. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Mark Langsdorf <mark.langsdorf@calxeda.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* Correct types in bmdma_addr_{read,write}David Gibson2012-01-211-2/+2
| | | | | | | | | | | | 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 to MemoryRegionOps callbacks. This patch corrects my error. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
* isa: give ISABus/ISADevice to isa_create(), isa_bus_irqs() and isa_get_irq() ↵Hervé Poussineau2011-12-203-4/+4
| | | | | | | | | functions NULL is a valid bus/device, so there is no change in behaviour. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori2011-12-191-3/+3
|\
| * ide: drop argument to dma_buf_commitPaolo Bonzini2011-12-161-3/+3
| | | | | | | | | | | | | | | | The argument is unused and even wrong when the function is called by ide_handle_rw_error. Drop it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* | block: dma_bdrv_* does not return NULLPaolo Bonzini2011-12-152-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Initially attempted with the following semantic patch: @ rule1 @ expression E; statement S; @@ E = ( dma_bdrv_io | dma_bdrv_read | dma_bdrv_write ) (...); ( - if (E == NULL) { ... } | - if (E) { <... S ...> } ) which however did not match anything. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | block: bdrv_aio_* do not return NULLPaolo Bonzini2011-12-153-20/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Initially done with the following semantic patch: @ rule1 @ expression E; statement S; @@ E = ( bdrv_aio_readv | bdrv_aio_writev | bdrv_aio_flush | bdrv_aio_discard | bdrv_aio_ioctl ) (...); ( - if (E == NULL) { ... } | - if (E) { <... S ...> } ) which however missed the occurrence in block/blkverify.c (as it should have done), and left behind some unused variables. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* Merge remote-tracking branch 'stefanha/trivial-patches-next' into stagingAnthony Liguori2011-12-142-2/+2
|\
| * fix spelling in hw sub directoryDong Xu Wang2011-12-061-1/+1
| | | | | | | | | | | | | | Correct obvious spelling errors in qemu/hw directory. Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
| * fix typo: delete redundant semicolonDong Xu Wang2011-12-061-1/+1
| | | | | | | | | | | | | | Double semicolons should be single. Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* | Remove unnecessary casts from PCI DMA code in PCI IDEDavid Gibson2011-12-121-2/+2
|/ | | | | | | | | 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 <david@gibson.dropbear.id.au> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote-tracking branch 'kwolf/for-anthony' into stagingAnthony Liguori2011-12-052-3/+4
|\
| * block: convert qemu_aio_flush() calls to bdrv_drain_all()Stefan Hajnoczi2011-12-052-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 across all BlockDriverStates to complete. As a bonus we perform checks after qemu_aio_wait() to ensure that requests really have finished. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | ide/mmio: convert to memory APIAvi Kivity2011-11-241-33/+24
|/ | | | Signed-off-by: Avi Kivity <avi@redhat.com>
* atapi: kill MODE SENSE(6), fix MODE SENSE(10)Paolo Bonzini2011-11-181-12/+8
| | | | | | | | | | | | | | | | Mode page 2A of emulated ATAPI DVD-ROM should have page length 0x14 like SCSI CD-ROM, rather than 0x12. Mode page length is off by 8, as it should contain the length of the payload after the first two bytes. MODE SENSE(6) should be thrown out of ATAPI DVD-ROM emulation. It is not specified in the ATAPI list of MMC-2, and MMC-5 prescribes to use MODE SENSE(10). Anyway, its implementation is wrong. Reported-by: Thomas Schmitt <scdbackup@gmx.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* atapi: implement eject requestsPaolo Bonzini2011-11-112-3/+21
| | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* PCI IDE: Use PCI DMA stub functionsDavid Gibson2011-11-011-9/+10
| | | | | | | | | | 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. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote-tracking branch 'kwolf/for-anthony' into stagingAnthony Liguori2011-10-314-148/+50
|\ | | | | | | | | Conflicts: block/vmdk.c
| * atapi/scsi-disk: make mode page values coherent between the twoPaolo Bonzini2011-10-281-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds to scsi-disk the missing mode page 0x01 for both disk and CD-ROM drives, and mode page 0x0e for CD drives only. A few offsets were wrong in atapi.c. Also change the 2Ah mode page to expose DVD media read capabilities in the IDE cdrom. This lets you run dvd+rw-mediainfo on the virtual DVD drives. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * atapi: cleanup/fix mode sense resultsPaolo Bonzini2011-10-281-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | The first two bytes (after the 8-byte ATAPI header) are the mode page number and the number of bytes after the length field itself. Make this clear in the code. The AUDIO_CTL page was filled with wrong values. It is not anymore in MMC, but at least keep the values sane. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * atapi: move GESN definitions to scsi-defs.hPaolo Bonzini2011-10-281-37/+6
| | | | | | | | | | | | | | | | | | | | | | As a complement to the previous patch, move definitions for GET EVENT STATUS NOTIFICATION from the two functions to scsi-defs.h. The NCR_* constants are just bit values corresponding to the ENC_* values, with no offsets even, so keep just one copy. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * atapi/scsi: unify definitions for MMCPaolo Bonzini2011-10-284-99/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The definitions in ide/internal.h are duplicates, since ATAPI commands actually come from SCSI. Use the ones in scsi-defs.h and move the missing ones there. Two exceptions: - MODE_PAGE_WRITE_PARMS conflicts with the "flexible disk geometry" page in scsi-disk.c. It is unused, so pick the latter. - GPCMD_* is left in ide/internal.h, at least for now. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * ide: Fix off-by-one error in array index checkKevin Wolf2011-10-281-1/+1
| | | | | | | | | | Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
* | ahci: fix DPRINTF format stringsMax Filippov2011-10-261-6/+10
|/ | | | | Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* Merge remote-tracking branch 'kwolf/for-anthony' into stagingAnthony Liguori2011-10-141-0/+2
|\
| * ide: Support I/O statusLuiz Capitulino2011-10-111-0/+2
| | | | | | | | | | | | Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | Merge remote-tracking branch 'qemu-kvm-tmp/memory/batch' into stagingAnthony Liguori2011-10-145-21/+30
|\ \ | |/ |/|
| * ide: Convert to isa_register_portio_listRichard Henderson2011-10-115-21/+30
| | | | | | | | | | Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Avi Kivity <avi@redhat.com>
* | RunState: Rename enum values as generated by the QAPILuiz Capitulino2011-10-041-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | Next commit will convert the query-status command to use the RunState type as generated by the QAPI. In order to "transparently" replace the current enum by the QAPI one, we have to make some changes to some enum values. As the changes are simple renames, I'll do them in one shot. The changes are: - Rename the prefix from RSTATE_ to RUN_STATE_ - RUN_STATE_SAVEVM to RUN_STATE_SAVE_VM - RUN_STATE_IN_MIGRATE to RUN_STATE_INMIGRATE - RUN_STATE_PANICKED to RUN_STATE_INTERNAL_ERROR - RUN_STATE_POST_MIGRATE to RUN_STATE_POSTMIGRATE - RUN_STATE_PRE_LAUNCH to RUN_STATE_PRELAUNCH - RUN_STATE_PRE_MIGRATE to RUN_STATE_PREMIGRATE - RUN_STATE_RESTORE to RUN_STATE_RESTORE_VM - RUN_STATE_PRE_MIGRATE to RUN_STATE_FINISH_MIGRATE Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* ahci: add port I/O index-data pairDaniel Verkamp2011-09-213-3/+75
| | | | | | | | | | | | 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 beyond the first megabyte. Signed-off-by: Daniel Verkamp <daniel@drv.nu> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* Merge remote-tracking branch 'kwolf/for-anthony' into stagingAnthony Liguori2011-09-203-5/+7
|\
| * AHCI Port Interrupt Enable register cleaning on soft resetAlexander Motin2011-09-201-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 any level happens. Is is reasonable for the global controller reset. It is probably not good, but acceptable for FreeBSD driver for the port hard reset. But it is IMO wrong for the device soft reset. None of real hardware I know behaves that way. Signed-off-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * dma-helpers: rename is_write to to_devPaolo Bonzini2011-09-192-2/+2
| | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | Replace the VMSTOP macros with a proper state typeLuiz Capitulino2011-09-154-5/+6
|/ | | | | | | | | | | | | | | 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. One example to demonstrate this problem is that vm_start() calls vm_state_notify() with reason=0, which turns out to be VMSTOP_USER. This commit fixes that by replacing the VMSTOP macros with a proper state type called RunState. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* ahci: Remove unused struct memberStefan Weil2011-09-122-3/+0
| | | | | | | | | Member variable is_read is written, but never read (contrary to its name). Remove it. Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* ide/atapi scsi-disk: Make monitor eject -f, then change workMarkus Armbruster2011-09-121-0/+1
| | | | | | | | | | | | change fails while the tray is locked by the guest. eject -f forces it open and removes any media. Unfortunately, the tray closes again instantly. Since the lock remains as it is, there is no way to insert another medium unless the guest voluntarily unlocks. Fix by leaving the tray open after monitor eject. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: New change_media_cb() parameter loadMarkus Armbruster2011-09-121-1/+1
| | | | | | | To let device models distinguish between eject and load. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: New bdrv_set_buffer_alignment()Markus Armbruster2011-09-121-1/+1
| | | | | | | | Device models should be able to set it without an unclean include of block_int.h. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* hw: Trim superfluous #include "block_int.h"Markus Armbruster2011-09-128-8/+0
| | | | | | | | Including it in device models is unclean, including it without a reason adds insult to injury. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: Move BlockConf & friends from block_int.h to block.hMarkus Armbruster2011-09-122-1/+1
| | | | | | | | | | | It's convenience stuff for block device models, so block.h isn't the ideal home either, but better than block_int.h. Permits moving some #include "block_int.h" from device model .h into .c. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: Show whether the virtual tray is open in info blockMarkus Armbruster2011-09-121-0/+6
| | | | | | | | Need to ask the device, so this requires new BlockDevOps member is_tray_open(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: Drop BlockDriverState member removableMarkus Armbruster2011-09-121-1/+0
| | | | | | | It's a confused mess (see previous commit). No users remain. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* ide/atapi: Preserve tray state on migrationMarkus Armbruster2011-09-121-0/+32
| | | | | | | | Use a subsection, so that migration to older version still works, provided the tray is closed and unlocked. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* ide/atapi: Don't fail eject when tray is already openMarkus Armbruster2011-09-121-1/+1
| | | | | | | | | MMC-5 6.40.2.6 specifies that START STOP UNIT succeeds when the drive already has the requested state. cmd_start_stop_unit() fails when asked to eject while the tray is open and locked. Fix that. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: Rename bdrv_set_locked() to bdrv_lock_medium()Markus Armbruster2011-09-121-1/+1
| | | | | | | While there, make the locked parameter bool. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: Drop medium lock tracking, ask device models insteadMarkus Armbruster2011-09-121-0/+6
| | | | | | | | Requires new BlockDevOps member is_medium_locked(). Implement for IDE and SCSI CD-ROMs. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: Leave enforcing tray lock to device modelsMarkus Armbruster2011-09-121-20/+9
| | | | | | | | | | The device model knows best when to accept the guest's eject command. No need to detour through the block layer. bdrv_eject() can't fail anymore. Make it void. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* ide/atapi: Track tray locked stateMarkus Armbruster2011-09-122-1/+4
| | | | | | | | | We already track it in BlockDriverState. Just like tray open/close state, we should track it in the device models instead, because it's device state. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: Revert entanglement of bdrv_is_inserted() with tray statusMarkus Armbruster2011-09-121-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | Commit 4be9762a changed bdrv_is_inserted() to fail when the tray is open. Unfortunately, there are two different kinds of users, with conflicting needs. 1. Device models using bdrv_eject(), currently ide-cd and scsi-cd. They expect bdrv_is_inserted() to reflect the tray status. Commit 4be9762a makes them happy. 2. Code that wants to know whether a BlockDriverState has media, such as find_image_format(), bdrv_flush_all(). Commit 4be9762a makes them unhappy. In particular, it breaks flush on VM stop for media ejected by the guest. Revert the change to bdrv_is_inserted(). Check the tray status in the device models instead. Note on IDE: Since only ATAPI devices have a tray, and they don't accept ATA commands since the recent commit "ide: Reject ATA commands specific to drive kinds", checking in atapi.c suffices. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* ide/atapi: Track tray open/close stateMarkus Armbruster2011-09-122-1/+6
| | | | | | | | | We already track it in BlockDriverState since commit 4be9762a. As discussed in that commit's message, we should track it in the device device models instead, because it's device state. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
OpenPOWER on IntegriCloud