pci: Remove unused pci_reserve_capability
eepro100 was the last user. Now pci_add_capability is powerful enough.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
pci: interrupt pin documentation update
Fix up some erroneous comments in code:interrupt pins are named A-D, theinterrupt pin register is always readonlyand isn't zeroed out on reset.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
pci: Remove unused mem_base from PCIBus
Obsoleted by f64e02b6cc.
sun4u: don't set up isa_mem_base
Since we use memory API in sun4u.c, after71579cae30b53c910cd6c47ab4e683f647d36519, setting up isa_mem_baseputs vga.chain4 outside of the physical address space.
Fix by removing obsolete isa_mem_base set up.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
trace: add virtio_set_status() trace event
The virtio device lifecycle can be observed by looking at the sequenceof set status operations. This is especially important for catching thereset operation (status value 0), which resets the device and allvirtqueues....
vga: Respect isa_mem_base when registering chain4 alias
This does not yet unbreak PPC (which has its own problems) butpotentially other non-x86 systems where isa_mem_base is != 0.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qdev: print bus properties too
Make qdev_device_help print both device and bus properties.Helps libvirt to figure whenever bus properties such asPCI.multifunction are supported present or not.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/integratorcp: Fix bugs in writes to CM_CTRL system register
Fix a number of bugs in the implementation of writes to the CM_CTRLsystem register: * write to cm_ctrl, not cm_init ! * an '&' vs '^' typo meant we would write the inverse of the bits * handling the LED via printf() meant we spew lots of output...
vga: Fix text mode screendumps
In text mode, even a full refresh of the screen takes multiple updates.As we reset the dump file pointer after the first call, we only wrotethe first line.
Remove blanks before \n in output strings
Those blanks violate the coding conventions, seescripts/checkpatch.pl.
Blanks missing after colons in the changed lines were added.
This patch does not try to fix tabs, long lines and otherproblems in the changed lines, therefore checkpatch.pl reports...
Merge remote-tracking branch 'aneesh/for-upstream-4' into staging
block: New bdrv_set_buffer_alignment()
Device models should be able to set it without an unclean include ofblock_int.h.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: New change_media_cb() parameter load
To let device models distinguish between eject and load.
ide/atapi scsi-disk: Make monitor eject -f, then change work
change fails while the tray is locked by the guest. eject -f forcesit open and removes any media. Unfortunately, the tray closes againinstantly. Since the lock remains as it is, there is no way to insert...
ahci: Remove unused struct member
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: Don't fail eject when tray is already open
MMC-5 6.40.2.6 specifies that START STOP UNIT succeeds when the drivealready has the requested state. cmd_start_stop_unit() fails whenasked to eject while the tray is open and locked. Fix that.
Signed-off-by: Markus Armbruster <armbru@redhat.com>...
scsi-disk: Fix START_STOP to fail when it can't eject
Don't fail when tray is already open.
ide/atapi: Preserve tray state on migration
Use a subsection, so that migration to older version still works,provided the tray is closed and unlocked.
block: Clean up remaining users of "removable"
BlockDriverState member removable is a confused mess. It is true whenan ide-cd, scsi-cd or floppy qdev is attached, or when theBlockDriverState was created with -drive if={floppy,sd} or -driveif={ide,scsi,xen,none},media=cdrom ("created removable"), except when...
block: Drop BlockDriverState member removable
It's a confused mess (see previous commit). No users remain.
block: Show whether the virtual tray is open in info block
Need to ask the device, so this requires new BlockDevOps memberis_tray_open().
block: Move BlockConf & friends from block_int.h to block.h
It's convenience stuff for block device models, so block.h isn't theideal home either, but better than block_int.h.
Permits moving some #include "block_int.h" from device model .h into.c.
hw: Trim superfluous #include "block_int.h"
Including it in device models is unclean, including it without areason adds insult to injury.
ide/atapi: Track tray open/close state
We already track it in BlockDriverState since commit 4be9762a. Asdiscussed in that commit's message, we should track it in the devicedevice models instead, because it's device state.
scsi-disk: Factor out scsi_disk_emulate_start_stop()
scsi-disk: Track tray open/close state
block: Revert entanglement of bdrv_is_inserted() with tray status
Commit 4be9762a changed bdrv_is_inserted() to fail when the tray isopen. Unfortunately, there are two different kinds of users, withconflicting needs.
1. Device models using bdrv_eject(), currently ide-cd and scsi-cd....
ide/atapi: Track tray locked state
We already track it in BlockDriverState. Just like tray open/closestate, we should track it in the device models instead, because it'sdevice state.
scsi-disk: Track tray locked state
block: Leave enforcing tray lock to device models
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.
block: Drop medium lock tracking, ask device models instead
Requires new BlockDevOps member is_medium_locked(). Implement for IDEand SCSI CD-ROMs.
block: Rename bdrv_set_locked() to bdrv_lock_medium()
While there, make the locked parameter bool.
ide: Use a table to declare which drive kinds accept each command
No functional change.
It would be nice to have handler functions in the table, like commite1a064f9 did for ATAPI. Left for another day.
ide: Reject ATA commands specific to drive kinds
ACS-2 Table B.2 explicitly prohibits ATAPI devices from implementingWIN_RECAL, WIN_READ_EXT, WIN_READDMA_EXT, WIN_READ_NATIVE_MAX,WIN_MULTREAD_EXT, WIN_WRITE, WIN_WRITE_ONCE, WIN_WRITE_EXT,WIN_WRITEDMA_EXT, WIN_MULTWRITE_EXT, WIN_WRITE_VERIFY, WIN_VERIFY,...
ide/atapi: Clean up misleading name in cmd_start_stop_unit()
"eject" is misleading; it means "eject" when start is clear, but"load" when start is set. Rename to loej, because that's how MMC-5calls it, in section 6.40.
ide: Fix ATA command READ to set ATAPI signature for CD-ROM
Must set the ATAPI device signature, see ATA4 8.27.5.2 Outputs forPACKET Command feature set devices, and ACS-2 7.36.6 Outputs forPACKET feature set devices.
target-xtensa: add dc232b core and board
This is Diamond 232L Standard Core Rev.B (LE).
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
target-xtensa: implement interrupt option
See ISA, 4.4.6 (interrupt option), 4.4.7 (high priority interruptoption) and 4.4.8 (timer interrupt option) for details.
target-xtensa: implement CPENABLE and PRID SRs
target-xtensa: add target stubs
target-xtensa: add sample board
Sample board and sample CPU core are used for debug and may be used fordevelopment of custom SoC emulators.
This board has two fixed size memory regions for DTCM and ITCM andvariable length SRAM region.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>...
mipsnet: convert to qdev
Move mipsnet_init() function to mipssim machine
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
mipsnet: use trace framework
PCI: delete unused mem_base and pci_to_cpu_addr
lsi53c895a: avoid a warning from clang analyzer
Avoid this warning from clang analyzer by deleting the variable:/src/qemu/hw/lsi53c895a.c:895:5: warning: Value stored to 'id' is never read id = (current_tag >> 8) & 0xf;
hid: fix misassignment
The code does not have any effect as is, fix it.
Spotted by clang analyzer:/src/qemu/hw/hid.c:99:13: warning: Value stored to 'x1' is never read x1 = 1;
scsi-bus: remove duplicate table entries
Remove duplicate entries from SCSI command table, spotted byclang analyzer:/src/qemu/hw/scsi-bus.c:979:40: warning: initializer overrides prior initialization of this subobject [ ERASE_16 ] = "ERASE_16",...
g364fb: compile in hwlib
Compile g364fb in hwlib. Two compilations less for the full build.
Acked-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Merge remote-tracking branch 'sstabellini/xen-next' into staging
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
virtio-balloon: Disassociate from the balloon handlers on unplug
Adding a 2nd balloon device after unplugging the first one doesn't work.Also, the 'info balloon' command should indicate an error mentioning noballoon device is registered after unplug.
Reproduction steps given by Shaolong Hu:...
Don't use g_thread_get_initialized.
Initialize glib threads unconditionally in main() insteadof using g_thread_get_initialized in the 9p code.
Fixes a build failure on RHEL-5, which ships glib 2.12.g_thread_get_initialized was added in 2.20.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>...
Introduce a new 'connected' xendev op called when Connected.
Rename the existing xendev 'connect' op to 'initialised' and introducea new 'connected' op. This new op, if defined, is called when thebackend is connected. Note that since there is no state transition this...
Move the xenfb pointer handler to the connected method
Ensure that we read "request-abs-pointer" after the frontend has writtenit. This means that we will correctly set up an ansolute or relativepointer handler correctly.
Signed-off-by: John Haxby <john.haxby@oracle.com>...
hw/9pfs: add 9P2000.L unlinkat operation
unlinkat - Remove a directory entry
size4 Tunlinkat tag2 dirfid4 name[s] flag4size4 Runlinkat tag2
older Tremove have the below request format
size4 Tremove tag2 fid4
The remove message is used to remove a directory entry either file or directory...
hw/9pfs: add 9P2000.L renameat operation
rename - change name of file or directory
size4 Trenameat tag2 olddirfid4 oldname[s] newdirfid4 newname[s]size4 Rrenameat tag2
older Trename have the below request format
size4 Trename tag2 fid4 newdirfid4 name[s]...
hw/9pfs: Fix memleaks in some 9p operation
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
hw/9pfs: Initialize rest of qid field to zero.
Since qid is allocated out of stack we need to intializethe field to zero. Otherwise we will send wrong qid valueto client.
hw/9pfs: Update the fidp path before opendir
We need to update the fidp path before opendir. Since we don'tuse the fid returned by mkdir, earlier code should not havemuch issue. We do a double v9fs_string_copy here. The later patchcleanup the entire function....
Fix include statements for qemu-common.h
virtio-9p: Fix syntax error in debug code
This error was reported by cppcheck:
qemu/hw/9pfs/virtio-9p-debug.c:342:error: Invalid number of character ({) when these macros are defined:'DEBUG_DATA'.
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>...
Merge remote-tracking branch 'spice/spice.v42' into staging
Merge remote-tracking branch 'kwolf/for-anthony' into staging
Merge remote-tracking branch 'qemu-kvm-tmp/memory/batch' into staging
Merge remote-tracking branch 'kraxel/usb.26' into staging
Merge remote-tracking branch 'aneesh/for-upstream-3' into staging
usb: Remove leading underscores from __musb_irq_max
Identifiers with double leading underscore are reserved, so rename__musb_irq_max so we don't encroach on reserved namespace.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb-musb: Take a DeviceState* in init function
Initialise usb-musb by passing it a DeviceState* and the offset of theIRQs in its gpio array, rather than a plain pointer to an irq array.This is simpler for callers and also allows us to pass in a valid parent...
usb-musb: Add reset function
Add a separate reset function musb_reset() to the usb-musb interface,so that users who implement a reset function can also reset usb-musb.Use this in tusb6010.
Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>[Riku Voipio: Fixes and restructuring patchset]...
usb: fix use after free
The ->complete() callback might have released the USBPacket (uhciactually does), so we must not touch it after the callback returns.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb-ccid: switch to USBDesc*
Switch the smard card emulation to use the USBDesc*structs for the usb descriptors.
usb-ccid: remote wakeup support
usb: claim port at device initialization time.
This patch makes qemu assign a port when creating the device, not whenattaching it. For most usb devices this isn't a noticable differencebecause they are in attached state all the time.
The change affects usb-host devices which live in detached state while...
usb-ehci: handle siTDs
This patch adds code to do minimal siTD handling, which is basicallyjust following the next pointer. This is good enougth to handle theinactive siTDs used by FreeBSD. Active siTDs are skipped too as wedon't have split transfer support in qemu, additionally a warning is...
hw/qxl: Fix format string errors
Fix format string errors causing compile failure on 32 bit hostswhen spice is enabled.
qxl: send interrupt after migration in case ram->int_pending != 0, RHBZ #732949
if qxl_send_events was called from spice server context, and thenmigration had completed before a call to pipe_read, the targetguest qxl driver didn't get the interrupt. In addition,...
qxl: s/qxl_set_irq/qxl_update_irq/
Signed-off-by: Yonit Halperin <yhalperi@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
scsi: improve MODE SENSE emulation
- do not return extra pages when requesting all pages (PAGE CODE = 0x3f)
- return correct sense code for PC = 3 (saved parameters not supported)
- do not return geometry pages for CD devices
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
scsi: fill in additional sense length correctly
Even though we do not use them, we should include the last threebytes of sense data in the additional sense length.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
scsi: refine constants for READ CAPACITY 16
Rename SERVICE_ACTION_IN to SERVICE_ACTION_IN_16 to distinguishfrom the 12-byte CDB variant, and add a constant for the subcommand.
scsi: fix accounting of writes
Writes go through scsi_write_complete at least twice, the first timeto get some data without having actually written anything. Becauseof this, the first time scsi_write_complete is called it will callbdrv_acct_done and account a read incorrectly. Fix this by looking...
scsi: execute SYNCHRONIZE_CACHE asynchronously
xen: Clean up pci_piix3_xen_ide_unplug()'s test for "not a CD"
pci_piix3_xen_ide_unplug() unplugs only disks, not CD-ROMs. It peeksinto the DriveInfo's BlockDriverState to distinguish between the two.Unclean; use DriveInfo member media_cd, like xen_config_dev_blk()....
spitz tosa: Simplify "drive is suitable for microdrive" test
We try the drive defined with drive if=ide,index=0 (or equivalentsugar). We use it only if (dinfo && bdrv_is_inserted(dinfo>bdrv) &&!bdrv_is_removable(dinfo->bdrv)). This is a convoluted way to test...
block: Declare qemu_blockalign() in block.h, not block_int.h
Device models should be able to use it without an unclean include ofblock_int.h.
ide: Give vmstate structs internal linkage where possible
block: Leave tracking media change to device models
hw/fdc.c is the only one that cares.
fdc: Make media change detection more robust
fdctrl_change_cb() gets called on a virtual media change via monitor.It would be nice if host device block drivers called it on physicalmedia change, but they don't.
bdrv_media_changed() lets you poll for media change, but it returns...
block: Attach non-qdev devices as well
For now, this just protects against programming errors like having thesame drive back multiple non-qdev devices, or untimely bdrv_delete().Later commits will add other interesting uses.
While there, rename BlockDriverState member peer to dev, bdrv_attach()...
block: Generalize change_cb() to BlockDevOps
So we can more easily add device model callbacks.
block: Split change_cb() into change_media_cb(), resize_cb()
Multiplexing callbacks complicates matters needlessly.
ide: Update command code definitions as per ACS-2 Table B.2
Drop WIN_SRST, it has the same value as WIN_DEVICE_RESET.
Drop unused WIN_RESTORE, it has the same value as WIN_RECAL.
Drop codes that are not implemented and long obsolete: WIN_READ_LONG,WIN_READ_LONG_ONCE, WIN_WRITE_LONG, WIN_WRITE_LONG_ONCE, WIN_FORMAT...
ide: Clean up case label indentation in ide_exec_cmd()
mips: Add SMP support to the Malta board
No change to the CPU kinds, so SMP will only work ifmanually changing the cpu to 34Kf:
-cpu 34Kf -smp 2
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
milkymist-minimac2: convert to memory API
Reviewed-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Avi Kivity <avi@redhat.com>
milkymist-softusb: convert to memory API
milkymist: convert to memory API
mainstone: convert to memory API
mcf5208: convert to memory API