sh4: Fix potential crash in debug code
cppcheck reports this error:
qemu/hw/sh_intc.c:390: error: Possible null pointer dereference: s - otherwise it is redundant to check if s is null at line 385
If s were NULL, the printf() statement would crash.Setting braces fixes this bug....
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
tusb6010: Convert to qdev
Convert the tusb6010 to qdev.
Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>[Riku Voipio: Fixes and restructuring patchset]Signed-off-by: Riku Voipio <riku.voipio@iki.fi>[Peter Maydell: More fixes and cleanups for upstream submission]...
Merge branch 'omap-for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm into pm
Merge remote-tracking branch 'kwolf/for-anthony' into staging
Merge remote-tracking branch 'qemu-kvm/memory/urgent' into staging
Merge remote-tracking branch 'mst/for_anthony' into staging
hw/pci-stub: fix comment typo
[Stefan fixed "doesn't" -> "don't"]
Signed-off-by: Alon Levy <alevy@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
omap_gpmc: Accept a zero mask field on omap3630
OMAP3630 adds an extra bit of address masking, so a mask of0xb1111 is valid. Unfortunately the GPMC_REVISION is the same ason the OMAP3430 which only has three bits of address masking, sowe have to derive this feature directly from the OMAP revision...
omap_gpmc: Pull prefetch engine data into sub-struct
Refactor the gpmc state structure so items relating tothe prefetch engine are in their own sub-struct and havemore useful names.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
omap: Wire up the DMA request line to the GPMC
omap_gpmc: Implement prefetch engine
This commit implements the prefetch engine feature of the GPMCwhich can be used for NAND devices. This includes both interruptdriven and DMA-filling modes.
hw/onenand: Minor spacing fixes
Minor whitespace-only cleanup (separated out from the qdevifyingpatch for clarity).
Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>[Riku Voipio: Fixes and restructuring patchset]Signed-off-by: Riku Voipio <riku.voipio@iki.fi>...
omap_gpmc: Clean up omap_gpmc_attach MemoryRegion conversion
Now that all callers of omap_gpmc_attach pass in a MemoryRegion*,we can remove the base_update and unmap function pointer arguments,and the opaque pointer that was passed into these callbacks....
omap_gpmc: Refactor omap_gpmc_cs_map and omap_gpmc_cs_unmap
Refactor the omap_gpmc_cs_map/unmap functions: * take the omap_gpmc_s* and a chipselect id rather than the omap_gpmc_cs_file_s*, so they have access to the general gpmc member fields * extract the base and mask from the config registers in the functions...
omap_gpmc: GPMC_IRQSTATUS is write-one-to-clear
Fix a bug in the handling of writes to GPMC_IRQSTATUS:it behaves as "write one to clear, writing zero is ignored".
omap_gpmc: Wire up the GPMC IRQ correctly
The omap_gpmc wasn't actually wiring up its IRQ, soanything that provoked an interrupt would be usinguninitialised data for its IRQ number.
omap_gpmc: Fix handling of FIFOTHRESHOLDSTATUS bit
The OMAP3 TRM is inconsistent about whether the GPMC FIFOTHRESHOLDSTATUSbit should be set when FIFOPOINTER > FIFOTHRESHOLD or when it is >=FIFOTHRESHOLD. Apparently the underlying functional spec from which...
omap_gpmc: Take omap_mpu_state* in omap_gpmc_init
Take a pointer to the omap mpu state struct in omap_gpmc_init.Some details of GPMC behaviour depend on the OMAP version weare a part of.
Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>[Riku Voipio: Fixes and restructuring patchset]...
omap_gpmc: Calculate revision from OMAP model
omap_gpmc: Reindent misindented switch statements
Whitespace-only change fixing indentation.
omap_gpmc: Support NAND devices
Support accesses to NAND devices, both by mapping them intothe GPMC address space, and via the NAND_COMMAND, NAND_ADDRESSand NAND_DATA GPMC registers.
hw/omap.h: Add OMAP 3630 to omap_mpu_model enumeration
Add the OMAP 3630 to the omap_mpu_model enumeration, and add thecorresponding cpu_is_omap3630() function.
(OMAP3 isn't supported yet but this is useful in upgrading commoncomponents to be "OMAP3 ready". We already have this for OMAP3430.)...
hw/onenand: Qdevify
Qdevify the ONENAND device.
hw/onenand: Remove unnecessary argument from onenand_command()
Refactor onenand_command() -- since it is essentially a method ofthe device object, it doesn't make sense to pass in something asan argument which is one of the object's own member fields....
hw/sysbus: Add sysbus_mmio_get_region()
Add a sysbus_mmio_get_region() which allows users of sysbusdevices to turn a (SysBusDevice*, mmioidx) tuple into aMemoryRegion*. This enables some useful simplifications ofdevices which pass through another device's mmio region...
sh_pci: Fix sh_pci memory alias confusion
The a7 area was set up as an alias of itself, rather than the p4 area. Thissent the memory core into infinite recursion.
Fix by aliasing the a7 area to the p4 area.
Signed-off-by: Avi Kivity <avi@redhat.com>
Fix disabling interrupts in sun4u
clear interrupt request if the interrupt priority < CPU pilclear hardware interrupt request if interrupts are disabled
Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>[blauwirbel@gmail.com: added a comment about magic 2]...
xilinx: Convert most xilinx devices to MemoryRegion
This converts ethlite, intc, timer and uartlite to useMemoryRegions.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
g364fb: convert to qdev
Extract G364 ROM contents from device emulation to machine emulation,so device emulation can be reused in other machines (Commodore Amiga)
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
g364fb: use trace framework
vhost-net: cleanup host notifiers at last step
When the vhost notifier is disabled, the userspace handler runsimmediately: virtio_pci_set_host_notifier_internal mightcall virtio_queue_notify_vq.Since the VQ state and the tap backend state aren'trecovered yet, this causes...
Revert "Merge remote-tracking branch 'qemu-kvm/memory/batch' into staging"
This reverts commit 8ef9ea85a2cc1007eaefa53e6871f1f83bcef22d, reversingchanges made to 444dc48298c480e42e15a8fe676be737d8a6b2a1.
From Avi:
Please revert the entire pull (git revert 8ef9ea85a2cc1) while I work this...
vga: Silence bogus gcc warning about uninitialized variables
Some gcc versions do not properly detect that all possible cases arecovered and base and size are always initialized. Please gcc by defininga pseudo default case.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
block: explicit I/O accounting
Decouple the I/O accounting from bdrv_aio_readv/writev/flush andmake 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...
Merge remote-tracking branch 'qemu-kvm/memory/batch' into staging
Merge remote-tracking branch 'aneesh/for-upstream-2' into staging
mainstone: convert to memory API
Reviewed-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Avi Kivity <avi@redhat.com>
mcf5208: convert to memory API
milkymist-minimac2: convert to memory API
milkymist-softusb: convert to memory API
milkymist: convert to memory API
sysbus: add sysbus_add_memory_overlap()
integratorcp: convert to memory API (RAM/flash only)
leon3: convert to memory API
cirrus: wrap memory update in a transaction
This prevents spurious unmapping and remapping of the vga windows,which reduces performance.
piix_pci: wrap memory update in a transaction
The code will remap all PAMs, even if just one is updated, resultingin reduced performance. Wrap in a transaction to detect that thoseother PAMs have not changed.
Reviewed-by: Richard Henderson <rth@twiddle.net>...
pflash_cfi01/pflash_cfi02: convert to memory API
cfi02 is annoying in that is ignores some address bits; we probablywant explicit support in the memory API for that.
dummy_m68k: convert to memory API
g364fb: convert to memory API
lm32_boards: convert to memory API
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>
ppc_oldworld, ppc_newworld: fix escc BAR related crash
ppc maps the escc mmio region both at a fixed offset (as a sysbus area) and as part of a PCI BAR.This crashes, since a MemoryRegion may have only one parent. Use an alias so we have a separateMemoryRegion for the BAR....
gt64xxx: fix crash in gt64120_pci_mapping()
The map/unmap code was assymetric - unmap used the local MemoryRegion whilemap used isa_mmio_init(), which cannot handle dynamic mappings.
Fix by using isa_mmio_setup() and the local MemoryRegion.
Signed-off-by: Avi Kivity <avi@redhat.com>...
armv7m: convert to memory API
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
pcie/slot: fix hotplug event
When slot status register is cleared, PCIDevice::exp.hpev_notifyneeds to be cleared.Otherwise, PCIDevice::exp.hpev_notify is never set to false resultingin no more hot plug event once it's raised.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>...
pcie/aer: fix inject aer error command
various fixes to make aer inject error command work.- wrong assert- command line parser- err.status needs initialization
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
pci: Error on PCI capability collisions
Nothing good can happen when we overlap capabilities. This may happenwhen plugging in assigned devices or when devices models contain bugs.Detect the overlap and report it.
Based on qemu-kvm commit by Alex Williamson....
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.
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.