sysbus: add sysbus_add_memory_overlap()
Signed-off-by: Avi Kivity <avi@redhat.com>
axis_dev88: convert to memory API (RAM only)
Reviewed-by: Richard Henderson <rth@twiddle.net>Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>Signed-off-by: Avi Kivity <avi@redhat.com>
armv7m: convert to memory API
Reviewed-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Avi Kivity <avi@redhat.com>
an5206: convert to memory API
pci_host: convert conf index and data ports to memory API
sysbus: add helpers to add and delete memory regions to the system bus
stellaris_enet: convert to memory API
hw/omap_gpmc: Don't try to map CS0 twice on reset
Remove a spurious second map of the OMAP GPMC CS0 region on reset.This fixes an assertion failure when we try to add the region toits container when it was already added. (The old code did notcomplain about mismatched map/unmap calls, but the new MemoryRegion...
xilinx.h: Added missing includes
Added some missing #includes for this file. Previously this filerelied on its clients to pre-include its dependencies.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
xilinx: removed microbalze_pic_init from xilinx.h
This is a microblaze target specific function that belongs outsideof xilinx.h (which is a collection of target independent device modelinstantiator functions)
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>...
target-i386: Remove unused polarity arguments from APIC API
Polarity of external interrupts needs to be handled in the IOAPIC.Passing it to the APIC is pointless. So remove all these arguments.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ioapic: Implement polarity
If the polarity bit is set in the redirection table, the input levelsimply has to inverted as it is low active in this case.
vmware-vga: Register reset service
Fixes cold reset in vmware graphic modes. We need to split up the resetfunction for this purpose, breaking out init-once bits.
Cc: Andrzej Zaborowski <balrogg@gmail.com>Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
vmware-vga: Disable verbose mode
Elimiates 'vmsvga_value_write: guest runs Linux.' messages from theconsole.
CC: Andrzej Zaborowski <balrogg@gmail.com>Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vmware-vga: Remove dead DIRECT_VRAM mode
The code was disabled since day 1 of vmware-vga, and now it does noteven build anymore. Time for a cleanup.
vmware-vga: Eliminate vga_dirty_log_restart
After the conversion to the new Memory API, vga_dirty_log_restart becameseriously pointless. Remove it from vmware-vga and and then finally dropthe service.
CC: Andrzej Zaborowski <balrogg@gmail.com>CC: Avi Kivity <avi@redhat.com>...
vga: Use linear mapping + dirty logging in chain 4 memory access mode
Most VGA memory access modes require MMIO handling as they demand weirdlogic to get a byte from or into the video RAM. However, there is oneexception: chain 4 mode with all memory planes enabled for writing. This...
vga: Drop some unused fields
Memory region refactorings obsoleted them.
CC: Avi Kivity <avi@redhat.com>Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
isa: add isa_address_space()
A helper that returns the address space used by ISA devices. Usefulfor getting rid of isa_mem_base, multiple ISA buses, or ISA buses behindbridges.
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pci: add pci_address_space()
Returns the PCI address space. Useful for bridges that can obscurepart of the PCI address space.
vga: drop get_system_memory() from vga devices and derivatives
Instead, use the bus accessors, or get the address space directlyfrom the board constructor.
440fx: fix PAM, PCI holes
The current implementation of PAM and the PCI holes is broken in severalways:
- PCI BARs are not restricted to the PCI hole (a BAR may hide memory) - PCI devices do not respect PAM (if a PCI device maps a region while PAM maps the region to RAM, the request will be honored)...
sh_pci: convert to memory API
arm11mpcore: use sysbus_init_mmio_cb2
This tells the sysbus code it need not use IO_MEM_UNASSIGNED.
versatile_pci: convert to memory API
ppce500_pci: convert to sysbus_init_mmio_cb2()
Not a huge step forward, but at least we now have a 1:1 relationshipbetween registration and unregistration.
sysbus: remove sysbus_init_mmio_cb()
This problem with this function is that it is not reversible - it isimpossible to know where things are registered and unregister themexactly. As there are no more users, we can remove it.
Signed-off-by: Avi Kivity <avi@redhat.com>...
sysbus: add a variant of sysbus_init_mmio_cb with an unmap callback
sysbus_init_mmio_cb() uses the destructive IO_MEM_UNASSIGNED to remove aregion. Provide an alternative that calls an unmap callback, so the removalmay be done non-destructively.
ppc4xx_sdram: convert to memory API
Clumsy due to the lack of clipping support, needed forchanging exposed ram size.
ppc405_uc: convert to memory API
onenand: convert to memory API
pcie_host: convert to memory API
Assuming that mmcfg size cannot change at runtime.
omap_gpmc/nseries/tusb6010: convert to memory API
Somewhat clumsy since it needs a variable sized region.
arm_timer: convert to memory API
gt64xxx.c: convert to memory API
tusb6010: move declarations to new file tusb6010.h
Avoid #include hell.
arm_sysctl: convert to memory API
pcnet: fix wrong opaque (broken by bd8d6f7cadb6ace98c779135217a4ed7b5fccc23)
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
apb_pci: convert to memory API
apic: convert to memory API
arm_gic: convert to memory API
e1000: use MII status register for link up/down
Some guests will use the standard MII status registerto verify link state. They will not notice link changesunless this register is updated.
Verified with Linux 3.0 and Windows XP guests.
Without this patch, ethtool will report speed and duplex as...
char: rename qemu_chr_get_msgfd() -> qemu_chr_fe_get_msgfd()
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
char: remove qemu_chr_send_event()
It's dead code.
char: rename qemu_chr_open() -> qemu_chr_new()
char: rename qemu_chr_close() -> qemu_chr_delete()
char: qemu_chr_ioctl() -> qemu_chr_fe_ioctl()
char: rename qemu_chr_read() -> qemu_chr_be_write()
char: rename qemu_chr_can_read() -> qemu_chr_be_can_read()
char: rename qemu_chr_guest_open() -> qemu_chr_fe_open()
char: rename qemu_chr_guest_close() -> qemu_chr_fe_close()
char: rename qemu_chr_write() -> qemu_chr_fe_write()
char: rename qemu_chr_printf() -> qemu_chr_fe_printf()
Merge remote-tracking branch 'pmaydell/armhw-for-upstream' into staging
escc: replace DPRINTFs with tracepoints
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
m48t59: avoid structure holes spotted by pahole
Report from pahole on amd64 host:struct M48t59State { uint32_t type; /* 0 4 */
/* XXX 4 bytes hole, try to pack */
qemu_irq IRQ; /* 8 8 */...
escc: avoid structure holes spotted by pahole
Edited report from pahole on amd64 host:struct ChannelState {... ChnType type; /* 32 4 */
/* XXX 4 bytes hole, try to pack /... uint8_t rregs[16]; / 66 16 */...
fdc: avoid structure holes spotted by pahole
Edited report from pahole on amd64 host:struct FDCtrl { uint8_t version; /* 0 1 */
/* XXX 7 bytes hole, try to pack */
qemu_irq irq; /* 8 8 */...
pcnet: avoid structure holes spotted by pahole
Edited report from pahole on amd64 host:struct PCNetState_st {... uint16_t bcr32; /* 340 64 */
/* XXX 4 bytes hole, try to pack /... int tx_busy; / 4520 4 */...
esp: avoid structure holes spotted by pahole
Report from pahole on amd64 host:struct ESPState { SysBusDevice busdev; /* 0 5648 / / --- cacheline 88 boundary (5632 bytes) was 16 bytes ago --- / uint32_t it_shift; / 5648 4 */...
sun4m: avoid structure holes spotted by pahole
Edited report from pahole on amd64 host:struct sun4c_hwdef {... uint8_t nvram_machine_id; /* 112 1 */
/* XXX 1 byte hole, try to pack /... / size: 136, cachelines: 3 / / sum members: 135, holes: 1, sum holes: 1 */...
tcx: avoid structure holes spotted by pahole
Report from pahole on amd64 host:struct TCXState { SysBusDevice busdev; /* 0 5648 / / --- cacheline 88 boundary (5632 bytes) was 16 bytes ago --- / target_phys_addr_t addr; / 5648 8 */...
sun4m_iommu: avoid structure holes spotted by pahole
Report from pahole on amd64 host:struct IOMMUState { SysBusDevice busdev; /* 0 5648 / / --- cacheline 88 boundary (5632 bytes) was 16 bytes ago --- / uint32_t regs4096; / 5648 16384 */...
slavio_intctl: avoid structure holes spotted by pahole
Report from pahole on amd64 host:struct SLAVIO_INTCTLState { SysBusDevice busdev; /* 0 5648 / / --- cacheline 88 boundary (5632 bytes) was 16 bytes ago --- / uint32_t intregm_pending; / 5648 4 */...
slavio_misc: avoid structure holes spotted by pahole
Report from pahole on amd64 host:struct MiscState { SysBusDevice busdev; /* 0 5648 / / --- cacheline 88 boundary (5632 bytes) was 16 bytes ago --- / qemu_irq irq; / 5648 8 */...
slavio_timer: avoid structure holes spotted by pahole
Report from pahole on amd64 host:struct SLAVIO_TIMERState { SysBusDevice busdev; /* 0 5648 / / --- cacheline 88 boundary (5632 bytes) was 16 bytes ago --- / uint32_t num_cpus; / 5648 4 */...
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
scsi-disk: fix DPRINTF
The variable 'status' does not exist anymore, adjust DPRINTFaccordingly.
hw/stellaris: Add support for RCC2 register
Add support for the RCC2 register on Fury class devices.Based on a patch by Vijay Kumar.
Signed-off-by: Engin AYDOGAN <engin@bzzzt.biz>[Peter Maydell: fixed comment typos, minor cleanup of unreachable code]Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/pl061.c: Support GPIOAMSEL register
Support the GPIOAMSEL register found on some Stellaris boards.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/pl061: Convert to VMState
Convert the PL061 to VMState. We choose to widen the struct membersto uint32_t rather than the other two options of breaking migrationcompatibility or using vmstate hacks to read/write a 32 bit valueinto an 8 bit struct field....
vexpress, realview: Use pl111, not pl110
The Versatile Express, Realview EB, PBX A9 and PB A8 boards alluse a PL111 for their graphics, not a PL110. Now we model thePL111, use it on these board models.
versatilepb: Implement SYS_CLCD mux control register bits
On the Versatile PB, PL110 graphics adaptor only natively supports5551 pixel format; an external mux swaps bits around to allowRGB565 and BGR565, under the control of bits [1:0] in the SYS_CLCDsystem register....
hw/pl110: Model the PL111 CLCD controller
Model the PL111 CLCD controller. This is a minor variationon the PL110; the major programmer visible differences aresupport for hardware cursor (unimplemented) and two newpixel formats.
Since syborg_fb.c borrows the pl11x pixel drawing routines,...
scsi: do not overwrite memory on REQUEST SENSE commands with a large buffer
Other scsi_target_reqops commands were careful about not using r->cmd.xferdirectly, and instead always cap it to a fixed length. This was not donefor REQUEST SENSE, and this patch fixes it....
hw/scsi-bus.c: Fix use of uninitialised variable
Don't use req before it has been initialised in scsi_req_new().This fixes a compile failure due to gcc complaining about this.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Acked-by: Paolo Bonzini <pbonzini@redhat.com>...
scsi: add support for unit attention conditions
Unit attention conditions override any sense data the device alreadyhas. Their signaling and clearing is handled entirely by the SCSIBuscode, and they are completely transparent to the SCSIDevices.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
scsi: report unit attention on reset
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
scsi: add special traces for common commands
Can be useful when debugging the device scan phase.
scsi: move handling of REQUEST SENSE to common code
scsi: add a bunch more common sense codes
scsi: move handling of REPORT LUNS and invalid LUNs to common code
scsi: introduce SCSICommand
This struct is currently unnamed. Give it a name and use itexplicitly to decouple (some parts of) CDB parsing fromSCSIRequest.
scsi: push lun field to SCSIDevice
This will let SCSIBus detect requests sent to an invalid LUN, andhandle them itself. However, there will be still support for only oneLUN per target
scsi: move request parsing to common code
Also introduce the first occurrence of "independent" SCSIReqOps,to handle invalid commands in common code.
scsi: move request-related callbacks from SCSIDeviceInfo to SCSIReqOps
scsi: pass cdb already to scsi_req_new
Right now the CDB is not passed to the SCSIBus until scsi_req_enqueue.Passing it to scsi_req_new will let scsi_req_new dispatch common requeststhrough different reqops.
Moving the memcpy to scsi_req_new is a hack that will go away as...
scsi: introduce SCSIReqOps
This will let allow requests to be dispatched through different callbacks,either common or per-device.
This patch adjusts the API, the next one will move members to SCSIReqOps.
scsi: move sense handling to generic code
With this patch, sense data is stored in the generic data structuresfor SCSI devices and requests. The SCSI layer takes care of storingsense data in the SCSIDevice for the subsequent REQUEST SENSE command.
At the same time, get_sense is removed and scsi_req_get_sense can use...
pc: make vgabios exit port more useful
We've always listened on port 501 for vgabios panic messages. In the entiretime I've worked on QEMU, I've never actually seen a vgabios panic message :-)
If we change the semantics of this port a little bit, it makes it possible to...
scsi-disk: no need to call scsi_req_data on a short read
In fact, if the HBA's transfer_data callback goes on with scsi_req_continuethe request will be completed successfully instead of showing a failure.It can even cause a segmentation fault.
An easy way to trigger it is "eject -f cd" during installation (during media...
vscsi: always use get_sense
vscsi supports autosensing by providing sense data directly in theresponse. When get_sense was added, the older state machine approachthat sent REQUEST SENSE commands separately was left in place. Removeit, all existing SCSIDevices do support autosensing and the next patches...
scsi: pass status when completing
A small improvement in the SCSI request API. Pass the statusat the time the request is completed, so that we can assert thatno request is completed twice. This would have detected theproblem fixed in the previous patch....
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Merge remote-tracking branch 'aneesh/for-upstream-1' into staging
Merge remote-tracking branch 'spice/spice.v41' into staging
Merge remote-tracking branch 'kraxel/usb.23' into staging
scsi-bus: use DO_UPCAST
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>Reviewed-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
hw/qdev: Don't crash if qdev_create(NULL, ...) fails
If an attempt to create a qdev device on the default sysbus (by passingNULL as the bus to qdev_create) fails, print a useful error messagerather than crashing trying to dereference a NULL pointer.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...