arm_boot: Fix typos in comment
mimicing -> mimickingthei -> the
Signed-off-by: Andreas Färber <afaerber@suse.de>Reviewed-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm_gic: Remove NVIC ifdefs from gic_state struct
Remove some NVIC ifdefs from the gic_state struct and itsstate save/load functions. This means there are some fieldsin it which are present for the NVIC but not used, but meansit always has the same layout and can be pulled out into a...
hw/arm_gic: Remove the special casing of NCPU for the NVIC
Drop the special casing of NCPU=1 for the NVIC. This slightlyincreases the amount of memory used by its state structure,but removes some ifdeffery and means we can safely move theGIC state into a common subclass structure....
ARM: Exynos4210 IRQ: Introduce new IRQ gate functionality.
New IRQ gate consists of n_in input qdev gpio lines and oneoutput sysbus IRQ line. The output IRQ level is formed as ORbetween all gpio inputs.
Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com>...
Merge remote-tracking branch 'afaerber-or/qom-next-2' into staging
Merge remote-tracking branch 'qmp/queue/qmp' into staging
Merge remote-tracking branch 'kwolf/for-anthony' into staging
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
qdev: Remove qdev_prop_set_defaults
Instead, qdev_property_add_static can set the default.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
qdev: Use wrapper for qdev_get_path
This makes it easier to remove it from BusInfo.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>[AF: Drop now unnecessary NULL initialization in scsibus_get_dev_path()]...
qdev: Move SysBus initialization to sysbus.c
TYPE_SYSTEM_BUS will be local to hw/sysbus.c, so move existing referencesto main_system_bus and system_bus_info there.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
qdev: Convert busses to QEMU Object Model
This is far less interesting than it sounds. We simply add an Object to eachBusState and then register the types appropriately. Most of the interestingrefactoring will follow in the next patches.
Since we're changing fundamental type names (BusInfo -> BusClass), it all needs...
qdev: Connect busses with their parent devices
This makes SysBus part of the root hierarchy and all busses children oftheir respective parent DeviceState.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
qbus: Make child devices links
Make qbus children show up as link<> properties. There is no stableaddressing for qbus children so we use an unstable naming convention.
This is okay in QOM though because the composition name is expected tobe what's stable....
qbus: Initialize in standard way
Move code to an initfn and finalizer.Replace do_qbus_create_inplace() with qbus_realize().
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
qdev: Remove qdev_prop_exists()
Can be replaced everywhere with object_property_find().
qom: Push error reporting to object_property_find()
Avoids duplicated error_set().
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>[AF: Also drop error_set() in object_property_del().]Signed-off-by: Andreas Färber <afaerber@suse.de>
m48t59: Rename "type" property to "model"
This resolves a name conflict with the qdev "type" property that isabout to move into Object.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>[AF: Add braces missing in original code.]Signed-off-by: Andreas Färber <afaerber@suse.de>
arm_l2x0: Rename "type" property to "cache-type"
Resolves a name conflict with the qdev "type" property that is about tobe moved to Object.
Signed-off-by: Andreas Färber <afaerber@suse.de>Acked-by: Mark Langsdorf <mark.langsdorf@calxeda.com>
qdev: Push "type" property up to Object
Now that Object is a type, add an instance_init function and pushthe "type" property from qdev to there.
qdev: Move bus properties to a separate global
Simple code movement in order to simplify future refactoring.
qdev: Move bus properties to abstract superclasses
In qdev, each bus in practice identified an abstract superclass, butthis was mostly hidden. In QOM, instead, these abstract classes areexplicit so we can move bus properties there.
All bus property walks are removed, and all device property walks...
qdev: Clean up global properties
Now that global properties do not depend on buses anymore, setthem directly in the device instance_init function.
Add event notification for guest balloon changes
After setting a balloon target value, applications have tocontinually poll 'query-balloon' to determine whether theguest has reacted to this request. The virtio-balloon backendknows exactly when the guest has reacted though, and thus it...
scsi-disk: Don't peek behind the BlockDriverState abstraction
Use the appropriate interface instead.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Acked-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ide: support enable/disable write cache
Enabling or disabling the write cache is done with the SET FEATUREScommand. The command can be issued with sg_sat_set_features fromsg3-utils.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
xen: Don't change -drive if=xen device name during machine init
A "top" BlockDriverState has a non-empty device_name. If the userdoesn't specify one with -drive parameter id, the system supplies adefault name.
xen_config_dev_blk() changes this name, during machine initialization....
xen: Don't peek behind the BlockDriverState abstraction
First offender is xen_config_dev_blk()'s use of disk->bdrv->filename.Get the filename from disk->opts instead. Same result, except forsnapshots: there, we now get the filename specified by the user...
fdc: fix implied seek while there is no media in drive
The Windows uses 'READ' command at the start of an instalationwithout checking the 'dir' register. We have to abort the transferwith an abnormal termination if there is no media in the drive.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>...
xtensa_lx60: add missing #include "blockdev.h"
This should fix the following build failure:
/home/buildbot/slave-public/block_mingw32/build/hw/xtensa_lx60.c: In function 'lx_init':/home/buildbot/slave-public/block_mingw32/build/hw/xtensa_lx60.c:212: warning: implicit declaration of function 'drive_get'...
Un-inline fdctrl_init_isa()
Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
xilinx_axidma: (un)reversed irq initialisation
The axidma irq orders are reversed in both the device model and the instantion.Undid both reversal (for no net change). Also needs to be reversed forconsistency with Xilinx tools IRQ listing.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>...
xilinx_uartlite: changed device name
Changed device name to xlnx,xps-uartlite. This is the exact name of the devicein the xilinx EDK development tools.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
xilinx_timer: added default frequency
Added a reasonable default frequency for the xilinx timer (the 62MHz froms3adsp machine model).
xilinx_timer: changed nr_timers to one_timer_only
The configurable property for this IP in the Xilinx tools is a boolean switch"one-timer-only" that flicks this timer from being dual channel to single.Updated QEMU to work the same way for better match with the IP core and its TRM....
xilinx_timer: changed device name
Changed device name to xlnx,xps-timer. This is the exact name of the devicein the xilinx EDK development tools.
xilinx_intc: changed device name
Changed device name to xlnx,xps-intc. This is the exact name of the devicein the xilinx EDK development tools.
xilinx_ethlite: tweaked naming of ping-pong props
Changed "txpingpong" prop to "tx-ping-pong". Same for rx. This is done tomake the property name exactly match what is output by the xilinx tools forthis IP.
xilinx_ethlite: changed device name
Changed device name to xlnx,xps-ethernetlite. This is the exact name of thedevice in the xilinx EDK development tools.
xilinx_axienet: droped the c_ on parameters
Even though the xilinx tools do have C_ on all params by default, drop thisfor consistency with all the other xilinx IP (I.E. param names are the xilinxnames without the C_ prefix)
xilinx_axienet: changed device name
Changed device name to xlnx,axi-ethernet. This is the exact name of thedevice in the xilinx EDK development tools.
xilinx_axidma: changed device name
Changed device name to xlnx,axi-dma. This is the exact name of the device in theXilinx EDK development tools.
xilinx_axi*: Share devices between microblaze and microblazeel
Speeds up the build.
Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
hw/xilinx_*: Share Xilinx devices between ppc and microblaze
xilinx_ethlite uses tswap32() and is thus target-dependent.
qdev: release parent properties on dc->init failure
While looking into hot-plugging bridges, I can create a qemu segfault via:
$ device_add pci-bridge
Bridge chassis not specified. Each bridge is required to be assigned a unique chassis id > 0. **ERROR:qom/object.c:389:object_delete: assertion failed: (obj->ref == 0)...
pci_bridge_dev: fix error path in pci_bridge_dev_initfn()
Currently, we do not properly cleanup, if pci_bridge_dev_initfnfails to initialize properly. Make sure to call pci_bridge_exitfn()in the error path.
Signed-off-by: Jason Baron <jbaron@redhat.com>...
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
Merge remote-tracking branch 'afaerber-or/qom-next-1' into staging
Merge remote-tracking branch 'afaerber-or/qom-cpu-3a' into staging
Merge remote-tracking branch 'sstabellini/for_1.1.1' into staging
Merge remote-tracking branch 'kraxel/usb.52' into staging
kvm: i8254: Fix conversion of in-kernel to userspace state
Due to a offset between the clock used to generate the in-kernelcount_load_time (CLOCK_MONOTONIC) and the clock used for processing thisin userspace (vm_clock), reading back the output of PIT channel 2 via...
qemu/xendisk: set maximum number of grants to be used
Legacy (non-pvops) gntdev drivers may require this to be done when thenumber of grants intended to be used simultaneously exceeds a certaindriver specific default limit.
Signed-off-by: Jan Beulich <jbeulich@suse.com>...
kvm/apic: correct short memset
kvm_put_apic_state's attempt to clear kapic before setting itsbits cleared sizeof(void) bytes (no more than 8) rather than theintended 1024 (KVM_APIC_REG_SIZE) bytes. Spotted by coverity.
Signed-off-by: Jim Meyering <meyering@redhat.com>...
integratorcp: Use cpu_arm_init() to obtain ARMCPU
Needed for arm_load_kernel().
Add missing braces.
Signed-off-by: Andreas Färber <afaerber@suse.de>Acked-by: Peter Maydell <peter.maydell@linaro.org>
musicpal: Use cpu_arm_init() to obtain ARMCPU
versatilepb: Use cpu_arm_init() to obtain ARMCPU
arm_boot: Pass ARMCPU to arm_boot_info::write_secondary_boot()
Adapt exynos4210 and highbank accordingly.The parameter itself is unused.
Signed-off-by: Andreas Färber <afaerber@suse.de>Acked-by: Peter Maydell <peter.maydell@linaro.org>Acked-by: Igor Mitsyanko <i.mitsyanko@samsung.com> (for exynos)
arm_boot: Pass ARMCPU to arm_boot_info::secondary_cpu_reset_hook()
Adapt highbank accordingly.
realview: Use cpu_arm_init() to obtain ARMCPU
Needed for arm_pic_init_cpu().
vexpress: Use cpu_arm_init() to obtain ARMCPU
exynos4210: Use cpu_arm_init() to store ARMCPU
Signed-off-by: Andreas Färber <afaerber@suse.de>Acked-by: Peter Maydell <peter.maydell@linaro.org>Acked-by: Igor Mitsyanko <i.mitsyanko@samsung.com>
pxa2xx: Pass ARMCPU to pxa2xx_pic_init()
Cleans up after storing ARMCPU in PXA2xxState.Prepares for storing ARMCPU in PXA2xxPICState.
pxa2xx_pic: Store ARMCPU in PXA2xxPICState
Prepares for moving halted field to CPUState.
pxa2xx_gpio: Store ARMCPU in PXA2xxGPIOInfo
Prepares for moving halted field into CPUState.
xilinx_zynq: Use cpu_arm_init() to obtain ARMCPU
Signed-off-by: Andreas Färber <afaerber@suse.de>Acked-by: Peter A.G. Crosthwaite <peter.crosthwaite@petalogix.com>
arm_boot: Pass ARMCPU to arm_load_kernel()
In particular this simplifies the &s->mpu->cpu->env expression again.
first_cpu and ->next_cpu are expected to be QOM'ified later.
Signed-off-by: Andreas Färber <afaerber@suse.de>Acked-by: Igor Mitsyanko <i.mitsyanko@samsung.com> (for exynos)...
arm_pic: Pass ARMCPU to arm_pic_init_cpu()
Pass it through to arm_pic_cpu_handler().
xen_machine_pv: Use cpu_x86_init() to obtain X86CPU
Needed for moving halted field to CPUState.
Signed-off-by: Andreas Färber <afaerber@suse.de>Tested-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
s390-virtio: Use cpu_s390x_init() to obtain S390CPU
Needed to store S390CPU in ipi_states[].
Signed-off-by: Andreas Färber <afaerber@suse.de>
s390-virtio: Let s390_cpu_addr2state() return S390CPU
Convert ipi_states to S390CPU**.
Needed for s390_cpu_restart() in handle_sigp().
nseries: Rename n800_s::cpu to mpu
omap_mpu_state_s::env was renamed to cpu while changing its type.With n800_s::cpu of type omap_mpu_state_s* this leads to s->cpu->cpu.
Rename the field to "mpu" to avoid this ugliness.
Signed-off-by: Andreas Färber <afaerber@suse.de>...
omap_sx1: Rename omap_mpu_state_s variable
Avoid cpu->cpu by using "mpu" as variable name.
palm: Rename omap_mpu_state_s variable
mainstone: Rename PXA2xxState variable
spitz: Rename PXA2xxState variable
tosa: Rename PXA2xxState variable
z2: Rename PXA2xxState variable
strongarm: Use cpu_arm_init() to store ARMCPU in StrongARMState
Adapt collie accordingly.
target-ppc: Unbreak kvm_ppc.c build
The file is located in target-ppc/, not hw/.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>Cc: Paolo Bonzini <pbonzini@redhat.com>Cc: Anthony Liguori <anthony@codemonkey.ws>Cc: Blue Swirl <blauwirbel@gmail.com>...
qapi: Add Visitor interfaces for uint*_t and int*_t
This adds visitor interfaces for fixed-width integers types.Implementing these in visitors is optional, otherwise we fall back tovisit_type_int() (int64_t) with some additional bounds checking to avoid...
qdev: Use int32_t container for devfn property
Valid range for devfn is -1 to 255 (-1 for automatic assignment). We donot currently validate this due to devfn being stored as a uint32_t.This can lead to segfaults and other strange behavior.
We could technically just cast it to int32_t to implement the checking,...
qdev: Switch property accessors to fixed-width visitor interfaces
This introduces {get,set}_uint{8,16,32,64}() functions for therespective qdev types.TADDR and VLAN are switched to explicit int64, BLOCKSIZE to uint16.
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>...
qdev: Remove PropertyInfo range checking
Range checking in PropertyInfo is now used only for pci_devfnproperties and some error reporting. Remove all code that implementsit in the various property types, and the now unused fields.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
msi: Use msi/msix_present more consistently
Replace some open-coded msi/msix_present checks.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
msi: Invoke msi/msix_reset from PCI core
There is no point in pushing this burden to the devices, they tend toforget to call them (like intel-hda, ahci, xhci did). Instead, resetfunctions are now called from pci_device_reset. They do nothing ifMSI/MSI-X is not in use....
msi: Guard msi/msix_write_config with msi_present
Terminate msi/msix_write_config early if support is not enabled. Thisallows to remove checks at the caller site if MSI is optional.
msi: Invoke msi/msix_write_config from PCI core
Also this functions is better invoked by the core than by each and everydevice. This allows to drop the config_write callbacks from ich andintel-hda.
CC: Alexander Graf <agraf@suse.de>CC: Gerd Hoffmann <kraxel@redhat.com>...
ahci: Fix reset of MSI function
Call msi_reset on device reset as still required by the core.
CC: Alexander Graf <agraf@suse.de>CC: qemu-stable@nongnu.orgSigned-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
intel-hda: Fix reset of MSI function
CC: Gerd Hoffmann <kraxel@redhat.com>CC: qemu-stable@nongnu.orgSigned-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
ahci: Clean up reset functions
Properly register reset functions via the device class.
CC: Alexander Graf <agraf@suse.de>Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
msi: Guard msi_reset with msi_present
shpc: unparent device before free
Recent core change removed unparentso we need to do this in all callers now.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
rtl8139: honor RxOverflow flag in can_receive method
Some drivers (Linux' 8139too among them) rely on the NICinjecting an interrupt in the event of a receive buffer overflowand, accordingly, set the RxOverflow bit in the interruptmask. Unfortunately rtl8139's can_receive method ignores the...
ehci: update status bits in ehci_set_state
Update the status register in the ehci_set_state function, to make surethe guest-visible register is in sync with our internal schedule state.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ehci: fix halt status handling
When the enable bits for controller / async schedule / periodic schedulechange just make sure we kick the frame timer and letehci_advance_periodic_state and ehci_advance_async_state handle thecontroller state changes.
This will make ehci set USBSTS_HALT when the controller shutdown is...
ehci: remove unused attach_poll_counter
ehci: create ehci_update_frindex
Factor out code from ehci_frame_timer.
ehci: adaptive wakeup rate.
Adapt the frame timer sleeps according to the actual needs. With theperiodic schedule being active we'll have to wakeup 1000 times persecond and go check for work. In case only the async schedule is activewe can be more lazy though. When idle ehci will increate the sleep time...
ehci: rework frame skipping
Move the framecount check out of the loop and use the newehci_update_frindex function to skip frames if needed.