malta: Clean allocation of bios region alias
It is sufficient to define the region alias once for all code branches.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
malta: Always allocate flash memory
There is no reason why there should not be a flash memory when theMalta emulation is started with a Linux kernel. When flash memoryis always available, the code is simpler, and it can be better tested.
malta: Use symbolic hardware addresses
The patch adds definitions of some hardware addresses and uses thesedefinitions.
It also replaces the type of all addresses from signed to unsigned values.This is only a cosmetic change because addresses are unsigned values,...
malta: Fix display for LED array
The 8-LED array was already implemented in the first commit to Malta,but this implementation was incomplete.
alpha hw/: Don't use CPUState
Scripted conversion: for file in hw/alpha_*.[hc]; do sed -i "s/CPUState/CPUAlphaState/g" $file done
Signed-off-by: Andreas Färber <afaerber@suse.de>Acked-by: Anthony Liguori <aliguori@us.ibm.com>
arm hw/: Don't use CPUState
Scripted conversion: for file in hw/arm-misc.h hw/arm_boot.c hw/arm_pic.c hw/armv7m.c hw/exynos4210.h hw/highbank.c hw/integratorcp.c hw/musicpal.c hw/omap.h hw/pxa.h hw/pxa2xx_gpio.c hw/pxa2xx_pic.c hw/realview.c hw/strongarm.h hw/versatilepb.c hw/vexpress.c hw/xilinx_zynq.c ; do...
cris hw/: Don't use CPUState
Scripted conversion: for file in hw/cris-boot.[hc] hw/cris_pic_cpu.c hw/axis_dev88.c hw/etraxfs.h hw/etraxfs_ser.c; do sed -i "s/CPUState/CPUCRISState/g" $file done
i386 hw/: Don't use CPUState
Scripted conversion: for file in hw/apic.h hw/kvm/apic.c hw/kvmvapic.c hw/pc.c hw/vmport.c hw/xen_machine_pv.c; do sed -i "s/CPUState/CPUX86State/g" $file done
lm32 hw/: Don't use CPUState
Scripted conversion: for file in hw/lm32_boards.c hw/milkymist.c; do sed -i "s/CPUState/CPULM32State/g" $file done
m68k hw/: Don't use CPUState
Scripted conversion: for file in hw/an5206.c hw/dummy_m68k.c hw/mcf.h hw/mcf5206.c hw/mcf5208.c hw/mcf_intc.c; do sed -i "s/CPUState/CPUM68KState/g" $file done
microblaze hw/: Don't use CPUState
Scripted conversion: for file in hw/microblaze_*.[hc] hw/petalogix_ml605_mmu.c hw/petalogix_s3adsp1800_mmu.c; do sed -i "s/CPUState/CPUMBState/g" $file done
mips hw/: Don't use CPUState
Scripted conversion: for file in hw/mips_*.[hc]; do sed -i "s/CPUState/CPUMIPSState/g" $file done
ppc hw/: Don't use CPUState
Scripted conversion: for file in hw/ppc*.[hc] hw/mpc8544_guts.c hw/spapr*.[hc] hw/virtex_ml507.c hw/xics.c; do sed -i "s/CPUState/CPUPPCState/g" $file done
s390x hw/: Don't use CPUState
Scripted conversion: for file in hw/s390-*.[hc]; do sed -i "s/CPUState/CPUS390XState/g" $file done
sh4 hw/: Don't use CPUState
Scripted conversion: for file in hw/sh.h hw/shix.c hw/r2d.c; do sed -i "s/CPUState/CPUSH4State/g" $file done
sparc hw/: Don't use CPUState
Scripted conversion: for file in hw/sun4m.c hw/sun4u.c hw/grlib.h hw/leon3.c; do sed -i "s/CPUState/CPUSPARCState/g" $file done
xtensa hw/: Don't use CPUState
Scripted conversion: for file in hw/xtensa_*.[hc]; do sed -i "s/CPUState/CPUXtensaState/g" $file done
PPC: 405: Use proper CPU reset
On ppc405ep there is a register that allows for software to reset thecore, but not the whole system. Implement this reset using a resetinterrupt.
This gets rid of a bunch of #if 0'ed code.
Reported-by: Andreas Färber <afaerber@suse.de>...
Rename cpu_reset() to cpu_state_reset()
Frees the identifier cpu_reset for QOM CPUs (manual rename).
Don't hide the parameter type behind explicit casts, use staticfunctions with strongly typed argument to indirect.
Signed-off-by: Andreas Färber <afaerber@suse.de>...
hw/mc146818: Drop unneeded #includes
pc.h and apic.h are not needed; apic.h would drag in x86 CPUState andis now included directly for TARGET_I386.
isa.h is already #included from mc146818rtc.h.
Signed-off-by: Andreas Färber <afaerber@suse.de>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
kvmvapic: align start address as well as size
The kvmvapic code remaps a section of ROM as RAM to allow the guest tomaintain state there. It is careful to align the section size to a pageboundary, to avoid creating subpages, but neglects to do the same for...
Merge remote-tracking branch 'kraxel/usb.44' into staging
kvmclock: Always register type
Currently, the "kvmclock" type is only registered when kvm_enabled().
This breaks when moving type registration to before command lineparsing (so that QOM types can be used for CPU and machine).
Since the QOM classes are lazy-initialized anyway and kvmclock_create()...
Endian fix an assertion in usb-msd
This fixes a broken endian assumption in an assertion in usb-msd.
Cc: Gerd Hoffman <kraxel@redhat.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>Signed-off-by: David Gibson <david@gibson.dropbear.id.au>...
usb: the big rename
Reorganize usb source files. Create a new hw/usb/ directory and moveall usb source code to that place. Also make filenames a bit moredescriptive. Host adapters are prefixed with "hch-" now, usb deviceemulations are prefixed with "dev-". Fixup paths Makefile and include...
usb: zap hw/ush-{ohic,uhci}.h + init wrappers
Remove the uhci and ohci init wrappers, which all wrapped apci_create_simple() one-liner. Switch callsites to callpci_create_simple directly. Remove the header files wherethe wrappers where declared.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb-ehci: drop unused isoch_pause variable
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb-ohci: DMA writeback bug fixes
This patch fixes two bugs in the OHCI device where the device writesback data to system memory that should be exclusively under thecontrol of the guest side driver.
In OHCI specification Section 5.2.7, it mentioned "In all cases, Host...
usb: improve packet state sanity checks
Add a new function to check whenever the packet state is as expected,log more informations in case it isn't.
uhci: pass addr to uhci_async_alloc
Also do async->td initialization in uhci_async_alloc now.Prepares for adding tracepoints.
uhci: fix uhci_async_cancel_all
It should also free all queues.
uhci: cancel on schedule stop.
Cancel any in-flight transaction when the guest stops the uhci schedule.
uhci: tracing support
Zap DPRINTF, add tracepoints instead.
uhci: use enum for uhci_handle_td return codes
Step #1 (separate for better bisectability): replace numbers with names.
uhci: renumber uhci_handle_td return codes
Step #2 (separate for better bisectability): renumber so the silly '-1'goes away. Pick a range which doesn't overlap the old values.
uhci: new uhci_handle_td return code for tds still in flight
uhci: alloc can't fail, drop check.
Merge remote-tracking branch 'stefanha/tracing' into staging
qdev: accept empty string properties
These were stored as NULL due to wrong cut-and-paste from set_pointer.
Reported-by: Gerhard Wiesinger <lists@wiesinger.com>Tested-by: Gerhard Wiesinger <lists@wiesinger.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
vga: add trace event for ppm_save
Signed-off-by: Alon Levy <alevy@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Add missing const attributes for MemoryRegionOps
Most MemoryRegionOps already had the const attribute.This patch adds it to the remaining ones.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
Merge remote-tracking branch 'kraxel/usb.42' into staging
xilinx_zynq: fix the build
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Spelling fixes in comments (it's -> its)
Reviewed-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Stefan Weil <sw@weilnetz.de>...
sh7750: Remove redundant 'struct' from MemoryRegionOps
The 'struct' is not needed, and all other MemoryRegionOps don't use it.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
usb: queue can have async packets
This can happen today in case the ->complete() callback queues up thenext packet. Also we'll support pipelining soon, which allows to havemultiple packets per queue in flight (aka ASYNC) state.
usb: add pipelining option to usb endpoints
With this patch applied USB drivers can enable pipelining per endpoint.With pipelining enabled the usb core will continue submitting packetseven when there are still async transfers in flight instead of passing...
usb: add shortcut for control transfers
Add a more direct code path to submit control transfers. Instead offeeding three usb packets (setup, data, ack) to usb_handle_packet andhave the do_token_* functions in usb.c poke the control transferparameters out of it just submit a single packet carrying the actual...
xhci: fix control xfers
Use the new, direct control transfer submission method instead ofbypassing the usb core by calling usb_device_handle_control directly.The later fails for async control transfers.
This patch gets xhci + usb-host combo going.
xhci: fix port status
Don't signal port status change if the usb device isn't in attachedstate. Happens with usb-host devices with the pass-through devicebeing plugged out at the host.
usb-ehci: Remove dead nakcnt code
This patch removes 2 bits of dead nakcnt code:
1) usb_ehci_execute calls ehci_qh_do_overlay which does:nakcnt = reload;and then has a block of code which is conditional on:if (reload && !nakcnt) {which ofcourse is never true now as nakcnt == reload....
usb-ehci: Fix and simplify nakcnt handling
The nakcnt code in ehci_execute_complete() marked transactions as finishedwhen a packet completed with a result of USB_RET_NAK, but USB_RET_NAKmeans that the device cannot receive / send data at that time and that...
usb-ehci: Cleanup itd error handling
All error statuses except for NAK are handled in a switch case, move thehandling of NAK into the same switch case.
usb: add USB_RET_IOERROR
We already have USB_RET_NAK, but that means that a device does not wantto send/receive right now. But with host / network redirection we canactually have a transaction fail due to some io error, rather then iethe device just not having any data atm....
uhci_fill_queue: zap debug printf
usb-ehci: split our qh queue into async and periodic queues
qhs can be part of both the async and the periodic schedule, as is shownin later patches in this series it is useful to keep track of the qhs ona per schedule basis.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>...
usb-ehci: always call ehci_queues_rip_unused for period queues
Before this patch USB 2 devices with interrupt endpoints were not workingproperly. The problem is that to avoid loops we stop processing as soonas we encounter a queue-head (qh) we've already seen since qhs can be linked...
usb-ehci: Drop cached qhs when the doorbell gets rung
The purpose of the IAAD bit / the doorbell is to make the ehci controllerforget about cached qhs, this is mainly used when cancelling transactions,the qh is unlinked from the async schedule and then the doorbell gets rung,...
usb-ehci: Rip the queues when the async or period schedule is halted
usb-ehci: Any packet completion except for NAK should set the interrupt
As clearly stated in the 2.3.2 of the EHCI spec, any time USBERRINT getsets then if the td has its IOC bit set USBINT should be set as well.
This means that for any status except for USB_RET_NAK we should set...
usb-ehci: Fix cerr tracking
cerr should only be decremented on errors which cause XactErr to be set, andwhen that happens the failing transaction should be retried until cerr reaches0 and only then should USBSTS_ERRINT be set (and inactive cleared andUSBSTS_INT set if requested)....
usb-ehci: Never follow table entries with the T-bit set
Before this patch the T-bit was not checked in 2 places, while it should be.
Once we properly check the T-bit everywhere we no longer need the weirdentry < 0x1000 and entry > 0x1000 checks, so this patch removes them....
kvm: x86: Add user space part for in-kernel i8254
This provides the required user space stubs to enable the in-kerneli8254 emulation of KVM.
The in-kernel model supports lost tick compensation according to the"delay" policy. This is enabled by default and can be switched off via a...
i8254: Open-code timer restore
Same as for the APIC: To enable migration between accelerated andnon-accelerated models, we need to arm the channel 0 timer only insidethe emulated PIT model. The common code just saves/restores that timerto the the next_transition_time field....
i8254: Factor out base class for KVM reuse
Applying the concept used for the *PICs once again: establish a baseclass for the i8254 that can be used both by the current user spaceemulation and the upcoming KVM in-kernel version. We share most of thepublic interface of the i8254, specifically to the pcspk, vmstate, reset...
cadence_uart: initial version of device model
Implemented cadence UART serial controller
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>Signed-off-by: John Linn <john.linn@xilinx.com>Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>...
cadence_ttc: initial version of device model
Implemented cadence Triple Timer Counter (TCC)
cadence_gem: initial version of device model
Device model for cadence gem ethernet controller.
xilinx_zynq: machine model initial version
Xilinx zynq-7000 machine model. Also includes device model for the zynq-specificsystem level control register (SLCR) module.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>...
petalogix_s2adsp1800: macro'd magic numbers
defined macros for the addresses of the peripherals in machine model
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
microblaze_boot: enabled -dtb argument
Use the -dtb argument for passing is a custom dtb rather than the oldhardcoded "mb.dtb"
microblaze: factored out common boot code
factored out the copy-pasted common boot code from the two microblaze platformsinto a dedicated microblaze bootloader (microblaze_boot.o).
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>...
petalogix_s2adsp1800: moved rst logic to rst fn
This belongs in the machine specific reset function
s390: Rework kernel loading: supports elf and newer kernels
This reworks the image loading on s390.
Newer kernels will not always have a 0dd0 (basr 13,0) at address 0x10000.We must not rely on specific code at certain addresses. This check wasintroduced to warn users that tried to load vmlinux, since ELF loading...
Merge branch 'arm-devs.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm
hw/arm11mpcore: Fix broken realview_mpcore/arm11mpcore_priv properties
Fix confusion in the Property arrays for the "arm11mpcore_priv" (per-CPU devices for the ARM11MPcore CPU) and "realview_mpcore" (realview-eb board specific device encapsulating CPU and some...
arm: clean up GIC constants
Interrupts numbers 0-31 are private to the processor interface, 32-1019 aregeneral interrupts. Add GIC_INTERNAL and substitute everywhere.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>[Peter Maydell: converted some tabs to spaces]...
arm: make sure that number of irqs can be represented in GICD_TYPER.
We currently assume that the number of interrupts (ITLinesNumber inthe architecture reference manual) is divisible by 32, since wepresent it to the guest when it reads GICD_TYPER (in gic_dist_readb())...
arm: add device tree support
If compiled with CONFIG_FDT, allow user to specify a device tree file usingthe -dtb argument. If the machine supports it then the dtb will be loadedinto memory and passed to the kernel on boot.
Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>...
Merge remote-tracking branch 'qemu-kvm/memory/core' into staging
Merge remote-tracking branch 'kwolf/for-anthony' into staging
Merge remote-tracking branch 'spice/spice.v49' into staging
Merge remote-tracking branch 'kraxel/usb.39' into staging
fdc: take side count into account
Floppies can be simple or double-sided. However, current codewas only taking the common case into account (ie 2 sides).
This repairs single-sided floppies, which where totally brokenbefore this patch : for track > 0, wrong sector number was...
fdc: set busy bit when starting a command
This bit must be active while a command is currently executed.
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
fdc: most control commands do not generate interrupts
In fact, only three control commands generate an interrupt:read_id, recalibrate and seek
fdc: handle read-only floppies (abort early on write commands)
A real floppy doesn't attempt to write to read-only media either.
fdc: add CCR (Configuration Control Register) write register
DIR and CCR registers share the same address ; DIR is read-onlywhile CCR is write-only
CCR register is used to change media transfer rate, which will bechecked in following changes.
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>...
block: add a transfer rate for floppy types
Floppies must be read at a specific transfer rate, depending of its own format.Update floppy description table to include required transfer rate.
fdc: add a 'check media rate' property. Not used yet
Set it to true for current Qemu versions, and false for previous ones
fdc: check if media rate is correct before doing any transfer
The programmed rate has to be the same as the required rate for thefloppy format ; if that's not the case, the transfer should abort.This check can be disabled by using the 'check_media_rate' property....
fdc: fix seek command, which shouldn't check tracks
The seek command just sends step pulses to the drive and doesn't care ifthere is a medium inserted of if it is banging the head against the drive.
fdc: DIR (Digital Input Register) should return status of current drive...
ide: fail I/O to empty disk
Requesting a read or a write operation on an empty disk can leadto QEMU dumping core.
Also fix a few braces here and there.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
memory: allow MemoryListeners to observe a specific address space
Ignore any regions not belonging to a specified address space.
Signed-off-by: Avi Kivity <avi@redhat.com>
memory: support stateless memory listeners
Current memory listeners are incremental; that is, they are expected tomaintain their own state, and receive callbacks for changes to that state.
This patch adds support for stateless listeners; these work by receiving...
memory: move ioeventfd ops to MemoryListener
This way the accelerator (kvm) can handle them directly.
Signed-off-by: Avi Kivity <avi@redhat.com>Reviewed-by: Richard Henderson <rth@twiddle.net>