serial: Add MemoryRegion parameter to serial_mm_init
Remove the get_system_memory() call from serial_mm_init, pushingit back into the callers. In many cases we already have thesystem memory region available.
Signed-off-by: Richard Henderson <rth@twiddle.net>...
ppc405: Pass in address_space_mem to ppc405{cr, ep}_init
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Avi Kivity <avi@redhat.com>
ppc440: Pass in address_space_mem to ppc440ep_init
pxa: Pass in address_space to pxa{255, 270}_init
sm501: Pass address_space_mem to sm501_init
sun4u: Pass address_space_mem to sun4uv_init
hw/smc91c111: Convert to MemoryRegion
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Avi Kivity <avi@redhat.com>
openpic: Memory API conversion for mpic
This patch converts mpic to the new memory API (through old mmio).
Signed-off-by: Fabien Chouteau <chouteau@adacore.com>Signed-off-by: Avi Kivity <avi@redhat.com>
etrax-pic: Convert to MemoryRegion
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>Signed-off-by: Avi Kivity <avi@redhat.com>
etrax-ser: Convert to MemoryRegion
etrax-timer: Convert to MemoryRegion
etrax-dma: Convert to MemoryRegion
etrax-eth: Convert to MemoryRegion
serial: Convert serial_mm_init to MemoryRegion
serial: Use enum device_endian in serial_mm_init parameter
The use of DEVICE_NATIVE_ENDIAN cleans up lots of ifdefs inmany of the callers.
serial: Remove ioregister parameter from serial_mm_init
All callers passed 1.
ESP: convert to trace framework
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
PPC: Drop initial ESCC mapping
We are mapping ESCC to a static (incorrect) address on machine init. Thisoverlaps with our vram, rendering the screen barely usable.
Since openBIOS is clever enough to map ESCC to where it needs to be, we canjust drop that invalid map and everyone's happy....
mips_fulong2e: Reorder ISA bus and i8259 creation
Missed during memory region conversion: The i8259 now depends on the ISAbus being created first. Reorder the initialization.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Merge remote-tracking branch 'aneesh/for-upstream-5' into staging
PPC: use memory API to construct the PCI hole
Avoid vga.chain4 mapping by constructing a PCI hole for upper2G of the PCI space.
Merge remote-tracking branch 'qemu-kvm-tmp/memory/urgent' into staging
Merge remote-tracking branch 'qemu-kvm-tmp/memory/batch' into staging
Merge remote-tracking branch 'pmaydell/omap-for-upstream' into staging
ppc_prep: fix pci config space initialization
Use data_mem for the data mmio region, not conf_mem.
Signed-off-by: Avi Kivity <avi@redhat.com>
mips_r4k: initialize i8259 after the ISA bus
Succeeding i8259 conversion to ISA requires this.
ppc_prep: initialize i8259 after the ISA bus
i8259: Convert to MemoryRegion
The only non-obvious part is pic_poll_read which used"addr1 >> 7" to detect whether one referred to eitherthe master or slave PIC. Instead, test this directly.
pckbd: Convert to MemoryRegion
Slightly non-obvious with mips_jazz passing in the regionstructure to populate.
serial: Convert serial_isa_initfn to MemoryRegion
The serial_mm_init path is as yet unconverted.
fdc: Convert isabus_fdc_init1 to MemoryRegion
This requires some amount of hoop-jumping, so that we don'tinadvertently claim port 0x3f6, which is used by ISA IDE.
The sysbus initialization path is as yet unconverted.
isa: add isa_register_ioport()
To replace isa_init_ioport and isa_init_ioport_rangeas the ISA devices are converted to the memory api.
[avi: use memory_region_size()]
pc: Re-order pc_init1 to initialize the ISA bus before ISA devices
In particular, the i8259 was being initialized before the ISA bus,leading to a crash.
cs4231a: Convert to MemoryRegion
i8254: Convert to MemoryRegion
mips_malta: move i8259 initialization after piix4 initialization
i8259 is an ISA device (or at least, depends on the ISA infrastructure toregister its ioport); and the ISA bus is supplied by piix4. Later patchesmake this dependency explicit.
Use qemu_irq_proxy() to stop the cycle by adding an extra layer of...
mips_jazz: initialize i8259 after the ISA bus
isa: Pass i/o address space to isa_bus_new
Not used yet, but at least we're provided with the correct region.
pci: add pci_address_space_io()
Returns the I/O address space. Useful for implementingPCI-ISA bridge devices.
adlib: remove write-only variable
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio: Use global memory barrier macros
The virtio code uses wmb() macros in several places, as required by theSMP-aware virtio protocol. However the wmb() macro is locally definedto be a compiler barrier only. This is probably sufficient on x86due to its strong storage ordering model, but it certainly isn't on other...
irq: introduce qemu_irq_proxy()
In some cases we have a circular dependency involving irqs - the irqcontroller depends on a bus, which in turn depends on the irq controller.Add qemu_irq_proxy() which acts as a passthrough, except that the targetirq may be set later on....
isapc: give system address space when pci is disabled
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pci-devfn: check that device/slot number is within range
Need to check that guest slot/device number is not > 31 or walk offthe devfn table when checking if a devfn is available or not in a guest.
before this fix, passing in an addr=abc or addr=34,can crash qemu, sometimes fail gracefully if data past end...
pc: Unbreak ROM mapping for ISA machine
This is based on the original fix by Hervé Poussineau: pc_memory_initactually takes a memory region for mapping BIOS and extension ROMs. Thatequals the PCI memory region if PCI is available, but must be systemmemory in the ISA case....
pc: Disable HPET for ISA machine
There was no HPET on ISA boxes.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vga: Unbreak ISA support
We need to initialize legacy_address_space during ISA VGA setup so thatthe chain-4 alias can be registered properly.
cirrus: Unbreak ISA support
Do not try to map against the PCI bar in the ISA version of the device.
e1000: Don't set the Capabilities List bit
[Originally sent to qemu-kvm list, but I was redirected here]
The Capabilities Pointer is NULL, so this bit shouldn't be set. The state ofthis bit doesn't appear to change any behavior on Linux/Windows versions we've...
hw/omap1: Wire up GPIO clock
Wire up the OMAP1 GPIO clock -- this fixes a hw_error() on startupwith OMAP1 based machines (sx1, cheetah).
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
omap_intc: Use MemoryRegion API
Convert omap_intc to use the MemoryRegion API
omap_intc: Qdevify
Convert the omap_intc devices to qdev. This includes addinga 'revision' property which will be needed for omap3.
The bulk of this patch is the replacement of "s->irq[x][y]" with "qdev_get_gpio_in(s->ih[x], y)" now that the interrupt...
hw/omap_gpmc: Modify correct field when writing IRQSTATUS register
Writing to IRQSTATUS should affect irqst, not irqen -- errorspotted by Andrzej Zaborowski.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
hw/omap_gpmc: Add comment about FIFOTHRESHOLDSTATUS bit
Promote the remark about why we handle FIFOTHRESHOLDSTATUS theway we do from the commit message of de8af7fe0 to a comment inthe code.
hw/9pfs: Add handle based fs driver
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
hw/9pfs: Make v9fs_string* functions non-static
We will use them later in other files
hw/9pfs: Use read-write lock for protecting fid path.
On rename we take the write lock and this ensure pathdoesn't change as we operate on them.
hw/9pfs: Move fid pathname tracking to seperate data type.
This enables us to add handles to track fids later. TheV9fsPath added is similar to V9fsString except that thesize include the NULL byte also.
hw/9pfs: Add init callback to fs driver
This call back can be used to do fs driver specific initialization.
hw/9pfs: Add fs driver specific details to fscontext
Add a new context flag PATHNAME_FSCONTEXT and indicate whetherthe fs driver track fid using path names. Also add a privatepointer that help us to track fs driver specific values in there
hw/9pfs: Avoid unnecessary get_fid in v9fs_clunk
hw/9pfs: Implement TFLUSH operation
Merge remote-tracking branch 'kwolf/for-anthony' into staging
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
ahci: add port I/O index-data pair
Implement an I/O space index-data register pair as defined by the AHCIspec, including the corresponding SATA PCI capability and BAR.
This allows real-mode code to access the AHCI registers; real-modecode cannot address the memory-mapped register space because it is...
Drop unneeded pthread.h inclusions
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
omap1: convert to memory API (part VI)
Easy RAM stuff.
Acked-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Avi Kivity <avi@redhat.com>
soc_dma: drop soc_dma_port_add_mem_ram()
It's a trivial wrapper for soc_dma_port_add_mem(), which makesthe memory API conversion more difficult because it takes a ramaddr_t. Drop.
omap_lcdc: remove imif, emiff from structure
Not used.
omap1: convert to memory API (part V)
Tricky aliases.
omap1: convert to memory API (part IV)
omap1: convert to memory API (part III)
omap1: convert to memory API (part II)
omap1: convert to memory API (part I)
Merge remote-tracking branch 'mst-tmp/for_anthony' into staging
Merge remote-tracking branch 'qmp/queue/qmp' into staging
pci_bridge: simplify memory regions some more
replace alloc/free with struct members.todo: smash with initial implementation aftertesting.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
AHCI Port Interrupt Enable register cleaning on soft reset
I've found that FreeBSD AHCI driver doesn't work with AHCI hardwareemulation of QEMU 0.15.0. I believe the problem is on QEMU's side. As Isee, it clears port's Interrupt Enable register each time when reset of...
scsi: fix sign extension problems
When assigning a 32-bit value to cmd->xfer (which is 64-bits)it can be erroneously sign extended because the intermediate32-bit computation is signed. Fix this by standardizing onthe ld*_be_p functions.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
scsi-disk: commonize iovec creation between reads and writes
Also, consistently use qiov.size instead of iov.iov_len.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
scsi-disk: lazily allocate bounce buffer
It will not be needed for reads and writes if the HBA provides a sglist.In addition, this lets scsi-disk refuse commands with an excessiveallocation length, as well as limit memory on usual well-behaved guests....
pci_bridge: use parent bus's address space
The switch to the new memory API caused the following problem:
The pci device may call pci_register_bar() to use PCI bus's addressspace. But we don't init PCI bus's address space if it is not bus0. A crash was reported:...
pci: implement bridge filtering
Support bridge filtering on top of the memoryAPI as suggested by Avi Kivity:
Create a memory region for the bridge's address space. This region isnot directly added to system_memory or its descendants. Devices underthe bridge see this region as its pci_address_space(). The region is...
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.
pci: Remove unused mem_base from PCIBus
Obsoleted by f64e02b6cc.
dma-helpers: rename is_write to to_dev
scsi-generic: do not disable FUA
I found no rationale for this in the logs, and it is quite bad becauseit will make scsi-generic unsafe WRT power failures.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Christoph Hellwig <hch@lst.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
mips_jazz: convert to memory API
mips_malta: convert to memory API
mips_mipssim: convert to memory API
mips_r4k: convert to memory API
musicpal: convert to memory API
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.
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.
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...