pcihp: reduce number of device check events
PIIX created a made-up value for the UP register since it was read byguest 32 times for each interrupt.There's no reason to do this for the new PCIHP: register is only readonce for each interrupt, so clean up code by making read act as an...
pcihp: make pci_read() mmio calback compatible with legacy ACPI hotplug
due to recent change introduced by:"pcihp: reduce number of device check events"
'up' field is cleared right after it's read.This is incompatible with legacy BIOS ACPI codewhere PCNF ACPI method reads this field 32 times....
Merge remote-tracking branch 'remotes/borntraeger/tags/kvm-s390-20140131' into staging
This patch set contains the sclp defines and events for cpu hotplug,the initial sclp defines (without code yet) for standby memory (somesort of memory hotplug) as well as a cleanup of the kvm register...
cris: Remove the CRIS PIC glue
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Merge remote-tracking branch 'qmp-unstable/queue/qmp' into staging
Merge remote-tracking branch 'pmaydell/tags/pull-target-arm-20140131' into staging
target-arm queue: * implementation of first part of the A64 Neon instruction set * v8 AArch32 rounding and 16<->64 fp conversion instructions * fix MIDR value on Zynq boards...
Merge remote-tracking branch 'remotes/awilliam/tags/vfio-pci-for-qemu-20140128.0' into staging
vfio-pci updates include: - Destroy MemoryRegions on device teardown - Print warnings around PCI option ROM failures - Skip bogus mappings from 64bit BAR sizing...
arm_gic: Introduce define for GIC_NR_SGIS
Instead of hardcoding 16 various places in the code, use a define tomake it more clear what is going on.
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>...
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
acpi,pci,pc,virtio fixes and enhancements
This includes new unit-tests for acpi by Marcel,hotplug for pci bridges by myself (piix only so far)and cpu hotplug for q35.And a bunch of fixes all over the place as usual....
Merge remote-tracking branch 'mjt/tags/trivial-patches-2014-01-16' into staging
trivial-patches for 2014-01-16
virtio_rng: replace custom backend API with UserCreatable.complete() callback
in addition fix default backend leak by releasing it if itsinitialization failed.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>...
add optional 2nd stage initialization to -object/object-add commands
Introduces USER_CREATABLE interface that must be implemented byobjects which are designed to created with -object CLI option orobject-add QMP command.
Interface provides an ability to do an optional second stage...
sclp-s390: Define new SCLP codes and structures
Define new SCLP codes and structures that will be needed fors390 memory hotplug.
Signed-off-by: Matthew Rosato <mjrosato@linux.vnet.ibm.com>Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
pc: Save size of RAM below 4GB
The ram_below_4g value will be useful in other places, such as the ACPItable code, and other code that currently requires passingbelow_4g_mem_size around in function arguments.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>...
piix4: add acpi pci hotplug support
Add support for acpi pci hotplug using thenew infrastructure.PIIX4 legacy interface is maintained as is formachine types 1.7 and older.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
acpi: factor out common cpu hotplug code for PIIX4/Q35
.. so it could be used for adding CPU hotplug to Q35 machine
Add an additional header with that will be shared betweenC and ASL code: include/hw/acpi/cpu_hotplug_defs.h
Signed-off-by: Igor Mammedov <imammedo@redhat.com>...
acpi: ich9: add CPU hotplug handling to Q35 machine
.. use IO port 0cd8-0xcf7 range for CPU present bitmap
Signed-off-by: Igor Mammedov <imammedo@redhat.com>Reviewed-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
pc: ACPI: unify source of CPU hotplug IO base/len
use C headers defines as source of IO base/len for respectivevalues in ASL code.
pci: add pci_for_each_bus_depth_first
Useful for ACPI hotplug.
pcihp: generalization of piix4 acpi
Add ACPI based PCI hotplug library with bridge hotplugsupport.Design - each bus gets assigned "bsel" property. - ACPI code writes this number to a new BNUM register, then uses existing UP/DOWN registers to probe slot status;...
Add DSDT node for AppleSMC
AppleSMC (-device isa-applesmc) is required to boot OS X guests.OS X expects a SMC node to be present in the ACPI DSDT. This patchadds a SMC node to the DSDT, and dynamically patches the return valueof SMC._STA to either 0x0B if the chip is present, or otherwise to 0x00,...
Merge remote-tracking branch 'kraxel/tags/pull-usb-2' into staging
usb core+hid: add support for microsoft os descriptors
qemu-iotests: Test pwritev RMW logic
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Max Reitz <mreitz@redhat.com>
block: Make bdrv_pwrite() a bdrv_prwv_co() wrapper
Instead of implementing the alignment adjustment here, use the nowexisting functionality of bdrv_co_do_pwritev().
raw: Probe required direct I/O alignment
Add a bs->request_alignment field that contains the requiredoffset/length alignment for I/O requests and fill it in the raw blockdrivers. Use ioctls if possible, else see what alignment it takes forO_DIRECT to succeed....
block: Switch BdrvTrackedRequest to byte granularity
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Max Reitz <mreitz@redhat.com>Reviewed-by: Benoit Canet <benoit@irqsave.net>
block: Generalise and optimise COR serialisation
Change the API so that specific requests can be marked serialising. Onlythese requests are checked for overlaps then.
This means that during a Copy on Read operation, not all requestsoverlapping other requests are serialised any more, but only those that...
block: Make overlap range for serialisation dynamic
Copy on Read wants to serialise with all requests touching the samecluster, so wait_serialising_requests() rounded to cluster boundaries.Other users like alignment RMW will have different requirements, though...
block: Allow wait_serialising_requests() at any point
We can only have a single wait_serialising_requests() call per requestbecause otherwise we can run into deadlocks where requests are waitingfor each other. The same is true when wait_serialising_requests() is not...
block: Move initialisation of BlockLimits to bdrv_refresh_limits()
This function separates filling the BlockLimits from bdrv_open(), whichallows it to call it from other operations which may change the limits(e.g. modifications to the backing file chain or bdrv_reopen)...
block: Update BlockLimits when they might have changed
When reopening with different flags, or when backing files disappearfrom the chain, the limits may change. Make sure they get updated inthese cases.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>...
block: Don't use guest sector size for qemu_blockalign()
bs->buffer_alignment is set by the device emulation and contains thelogical block size of the guest device. This isn't something that theblock layer should know, and even less something to use for determining...
block: rename buffer_alignment to guest_block_size
The alignment field is now set to the value that is promised to theguest, rather than required by the host. The next patches will makeQEMU aware of the host-provided values, so make this clear.
The alignment is also not about memory buffers, but about the sectors on...
qmp: Add QMP query-named-block-nodes to list the named BlockDriverState nodes.
Signed-off-by: Benoit Canet <benoit@irqsave.net>Reviewed-by: Fam Zheng <famz@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qmp: Allow to change password on named block driver states.
Signed-off-by: Benoit Canet <benoit@irqsave.net>Reviewed-by: Fam Zheng <famz@redhat.com>
There was two candidate ways to implement named node manipulation:
1) { 'command': 'block_passwd', 'data': {'*device': 'str',...
block: Create authorizations mechanism for external snapshot and resize.
Signed-off-by: Benoit Canet <benoit@irqsave.net>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: Add bs->node_name to hold the name of a bs node of the bs graph.
Add the minimum of code to prepare for the following patches.
block: Add bdrv_open_image()
Add a common function for opening images to be used for block driversspecified through BlockdevRefs in an option QDict. The difference frombdrv_file_open() is that this function may invoke bdrv_open() instead,allowing auto-detection of the driver to be used; and second, it...
readline: decouple readline from the monitor
Make the readline.c functionality reusable. Instead of callingmonitor_printf() and monitor_flush() directly, invoke function pointersprovided by the user.
This way readline.c does not know about Monitor and other users will be...
readline: move readline to a generic location
Now that the monitor and readline are decoupled, readline.h no longerbelongs in include/monitor/. Put the header into include/qemu/.
Move the source file into util/ so it can be linked as part oflibqemuutil.a....
osdep: add qemu_set_tty_echo()
Using stdin with readline.c requires disabling echo and line buffering.Add a portable wrapper to set the terminal attributes under Linux andWindows.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-io: add command completion
Autocomplete qemu-io commands at the interactive prompt.
Note this only completes command names and not their options.
qdict: Add qdict_array_split()
This function splits a QDict consisting of entries prefixed byincrementally enumerated indices into a QList of QDicts.
Signed-off-by: Max Reitz <mreitz@redhat.com>Reviewed-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>...
qemu-option: Add qemu_config_parse_qdict()
This function basically parses command-line options given as a QDictreplacing a config file.
For instance, the QDict {"section.opt1": 42, "section.opt2": 23}corresponds to the config file:
[section]opt1 = 42...
block: Allow reference for bdrv_file_open()
Allow specifying a reference to an existing block device (by name) forbdrv_file_open() instead of a filename and/or options.
Signed-off-by: Max Reitz <mreitz@redhat.com>Reviewed-by: Kevin Wolf <kwolf@redhat.com>...
s390-sclp: SCLP Event integration
Add an sclp event for "cpu was hot plugged". This allows Qemu to deliver anSCLP interrupt to the guest stating that the requested cpu hotplug wascompleted.
Signed-off-by: Jason J. Herne <jjherne@us.ibm.com>Reviewed-by: Andreas Färber <afaerber@suse.de>...
s390-sclp: SCLP CPU Info
Implement the CPU data in SCLP "Read SCP Info". And implement "Read CPU Info" SCLP command. This data will be used by the guest to get information about hotplugged cpus.
Signed-off-by: Jason J. Herne <jjherne@us.ibm.com>Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
s390-sclp: Define New SCLP Codes
Define new SCLP codes to improve code readability.
kvm: initialize qemu_host_page_size
There is a HOST_PAGE_ALIGN macro which makes sense for KVM acceleratorbut it uses qemu_host_page_size/qemu_host_page_mask which initializedfor TCG only.
This moves qemu_host_page_size/qemu_host_page_mask initialization from...
usb: add support for microsoft os descriptors
This patch adds support for special usb descriptors used by microsoftwindows. They allow more fine-grained control over driver binding andadding entries to the registry for configuration.
As this is a guest-visible change the "msos-desc" compat property...
Fix typo of tiemr in timer.h
Signed-off-by: Namhyung Kim <namhyung@gmail.com>Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
exec: Exclude non portable function for MinGW
cpu_physical_memory_set_dirty_lebitmap calls getpageaddr and ffsl which areunavailable for MinGW. As the function is unused for MinGW, it can simplybe excluded from compilation.
Signed-off-by: Stefan Weil <sw@weilnetz.de>...
Merge remote branch 'luiz/queue/qmp' into qmpq
memory: move bitmap synchronization to its own function
We want to have all the functions that handle directly the dirtybitmap near. We will change it later.
Signed-off-by: Juan Quintela <quintela@redhat.com>Reviewed-by: Orit Wasserman <owasserm@redhat.com>
memory: syncronize kvm bitmap using bitmaps operations
If bitmaps are aligned properly, use bitmap operations. If they arenot, just use old bit at a time code.
memory: cpu_physical_memory_mask_dirty_range() always clears a single flag
Document it
Signed-off-by: Juan Quintela <quintela@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Reviewed-by: Orit Wasserman <owasserm@redhat.com>
memory: use bit 2 for migration
For historical reasons it was bit 3. Once there, create a constant toknow the number of clients.
memory: make sure that client is always inside range
memory: cpu_physical_memory_clear_dirty_flag() result is never used
bitmap: Add bitmap_zero_extend operation
memory: split dirty bitmap into three
After all the previous patches, spliting the bitmap gets direct.
Note: For some reason, I have to move DIRTY_MEMORY_* definitions tothe beginning of memory.h to make compilation work.
Signed-off-by: Juan Quintela <quintela@redhat.com>...
memory: unfold cpu_physical_memory_clear_dirty_flag() in its only user
memory: unfold cpu_physical_memory_set_dirty() in its only user
memory: unfold cpu_physical_memory_set_dirty_flag()
memory: make cpu_physical_memory_get_dirty() the main function
And make cpu_physical_memory_get_dirty_flag() to use it. It used tobe the other way around.
memory: cpu_physical_memory_get_dirty() is used as returning a bool
memory: s/mask/clear/ cpu_physical_memory_mask_dirty_range
Now all functions use the same wording that bitops/bitmap operations
memory: use find_next_bit() to find dirty bits
This operation is way faster than doing it bit by bit.
memory: cpu_physical_memory_set_dirty_range() now uses bitmap operations
We were setting a range of bits, so use bitmap_set().
Note: xen has always been wrong, and should have used start insteadof addr from the beginning.
memory: cpu_physical_memory_clear_dirty_range() now uses bitmap operations
We were clearing a range of bits, so use bitmap_clear().
memory: s/dirty/clean/ in cpu_physical_memory_is_dirty()
All uses except one really want the other meaning.
memory: make cpu_physical_memory_reset_dirty() take a length parameter
We have an end parameter in all the callers, and this make it coherentwith the rest of cpu_physical_memory_* functions, that also take alength parameter.
Once here, move the start/end calculation to...
memory: split cpu_physical_memory_* functions to its own include
All the functions that use ram_addr_t should be here.
bitmap: use long as index
Move index and size fields from int to long. We need that formigration. long is 64 bits on sane architectures, and 32bits shouldbe enough on all the 32bits architectures.
Signed-off-by: Juan Quintela <quintela@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>...
memory: cpu_physical_memory_set_dirty_flags() result is never used
So return void.
Signed-off-by: Juan Quintela <quintela@redhat.com>Reviewed-by: Orit Wasserman <owasserm@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>
memory: create function to set a single dirty bit
exec: create function to get a single dirty bit
memory: make cpu_physical_memory_is_dirty return bool
memory: all users of cpu_physical_memory_get_dirty used only one flag
So cpu_physical_memory_get_dirty_flags is not needed anymore
memory: set single dirty flags when possible
memory: cpu_physical_memory_set_dirty_range() always dirty all flags
So remove the flag argument and do it directly. After this change,there is nothing else using cpu_physical_memory_set_dirty_flags() soremove it.
qemu-file: Make a few functions non-static
The QEMUFile code will be moved to qemu-file.c. This will require makingthe following functions non-static because they are used by the savevm.ccode:
migration: Move QEMU_VM_* defines to migration/migration.h
The VMState code will be moved to vmstate.c and it uses some of theQEMU_VM_* constants, so move it to a header.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>Reviewed-by: Orit Wasserman <owasserm@redhat.com>...
Merge remote-tracking branch 'stefanha/block' into staging
acpi,pci,pc,fedora,virtio fixes and enhancements
This includes some Preparatory patches for cpu hotplug for q25 and memoryhotplug by Igor, tests and memory mapping changeby Laszlo and pci reset cleanup by Paolo....
Merge remote-tracking branch 'afaerber/tags/qom-devices-for-anthony' into staging
QOM infrastructure fixes and device conversions
Merge remote-tracking branch 'mjt/trivial-patches' into staging
arm_gic: Rename GIC_X_TRIGGER to GIC_X_EDGE_TRIGGER
TRIGGER can really mean mean anything (e.g. was it triggered, is itlevel-triggered, is it edge-triggered, etc.). Rename to EDGE_TRIGGER tomake the code comprehensible without looking up the data structure....
softfloat: Add float to 16bit integer conversions.
ARMv8 requires support for converting 32 and 64bit floating pointvalues to signed and unsigned 16bit integers.
Signed-off-by: Will Newton <will.newton@linaro.org>[PMM: updated not to incorrectly set Inexact for Invalid inputs]...
softfloat: Add 16 bit integer to float conversions
Add the float to 16 bit integer conversion routines. These can betrivially implemented in terms of the int32_to_float* routines, butproviding them makes our API more symmetrical and can simplify callers....
softfloat: Make the int-to-float functions take exact-width types
Currently the int-to-float functions take types which are specifiedas "at least X bits wide", rather than "exactly X bits wide". This isconfusing and unhelpful since it means that the callers have to include...
softfloat: Add float32_to_uint64()
This patch adds the float32_to_uint64() routine, which converts a32-bit floating point number to an unsigned 64 bit number.
This contribution can be licensed under either the softfloat-2a or -2blicense.
Signed-off-by: Tom Musta <tommusta@gmail.com>...
softfloat: Provide complete set of accessors for fp state
Tidy up the get/set accessors for the fp state to add missing onesand make them all inline in softfloat.h rather than some inline andsome not.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
softfloat: Add float16 <=> float64 conversion functions
Add the conversion functions float16_to_float64() andfloat64_to_float16(), which will be needed for the ARMA64 instruction set.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Richard Henderson <rth@twiddle.net>
softfloat: Add support for ties-away rounding
IEEE754-2008 specifies a new rounding mode:
"roundTiesToAway: the floating-point number nearest to the infinitelyprecise result shall be delivered; if the two nearest floating-pointnumbers bracketing an unrepresentable infinitely precise result are...
hw: Remove assert_no_error usages
Replace assert_no_error() usages with the error_abort system.&error_abort is passed into API calls to signal to the Error sub-systemthat any errors are fatal. Removes need for caller assertions.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>...
qemu-option: Remove qemu_opts_create_nofail
This is a boiler-plate _nofail variant of qemu_opts_create. Remove anduse error_abort in call sites.
null/0 arguments needs to be added for the id and fail_if_exists fieldsin affected callsites due to argument inconsistency between the normal and...
qerror: Remove assert_no_error()
This is no longer needed, and is obsoleted by error_abort. Remove.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Reviewed-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
error: Add error_abort
Add a special Error * that can be passed to error handling APIs tosignal that any errors are fatal and should abort QEMU. There are twoadvantages to this:
- allows for brevity when wishing to assert success of Error ** accepting APIs. No need for this pattern:...
monitor: add object-add (QMP) and object_add (HMP) command
Add two commands that are the monitor counterparts of -object. The commandshave the same Visitor-based implementation, but use different kinds ofvisitors so that the HMP command has a DWIM string-based syntax, while...