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: 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>...
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
Merge remote-tracking branch 'mst/tags/for_anthony' 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...
pxa27x: Reduce size of keyboard matrix mapping
The row and column values use only a very limited range (-1 ... 7),so a byte value is sufficient.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
pxa27x: Add 'const' attribute to keyboard maps
The mapping is a hardware feature, so it is relatively constant.
qdev: Drop misleading qbus_free() function
Same reasoning as commit 02a5c4c97422b40034f31265e0f139f7846172a8("qdev: Drop misleading qdev_free() function"). The qbus_free()function removes the child from the namespace and decrements thereference count. It does not, however, guarantee to free the child...
apic: QOM'ify APIC
Convert 'init' function to QOM's 'realize' for apic, kvm/apic andxen/xen_apic.
Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
icc_bus: QOM'ify ICC
For consistency, QOM'ify APIC's parent bus.
ioapic: QOM'ify ioapic
Convert 'init' function to QOM's 'realize' for ioapic and kvm-ioapic.Change variable 'ioapic_no' from static to global. Then we can dropthe 'instance_no' function argument.
qdev: Document that pointer properties kill device_add
Ask users of DEFINE_PROP_PTR() to setcannot_instantiate_with_device_add_yet, or explain why it's notneeded.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
qom: Split out object and class caches
The object-cast and class-cast caches cannot be shared because classcaching is conditional on the target type not being an interface andobject caching is unconditional. Leads to a bug when a class castto an interface follows an object cast to the same interface type:...
qom: Do not register interface "types" in the type table and fix names
There should be no need to look up nor enumerate the interface "types",whose "classes" are really just vtables. Just create the types andadd them to the interface list of the parent type....
piix: fix 32bit pci hole
Make the 32bit pci hole start at end of ram, so all possible addressspace is covered.
We used to try and make addresses aligned so they are easier to coverwith MTRRs, but since they are cosmetic on KVM, this is probably notworth worrying about....
pci: do not export pci_bus_reset
qbus_reset_all can be used instead. There is no semantic changebecause pcibus_reset returns 1 and takes care of the devicetree traversal.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
qdev: allow both pre- and post-order vists in qdev walking functions
Resetting should be done in post-order, not pre-order. However,qdev_walk_children and qbus_walk_children do not allow this. Fixit by adding two extra arguments to the functions.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
qdev: switch reset to post-order
Post-order is the only sensible direction for the reset signals.For example, suppose pre-order is used and the parent has some datastructures that cache children state (for example a list of activerequests). When the reset method is invoked on the parent, these caches...
acpi: factor out common pm_update_sci() into acpi core
... and rename it into acpi_update_sci() since it changesSCI on only on PM registers status.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
qdev: Replace no_user by cannot_instantiate_with_device_add_yet
In an ideal world, machines can be built by wiring devices togetherwith configuration, not code. Unfortunately, that's not the world welive in right now. We still have quite a few devices that need to be...
block: Add commit_active_start()
commit_active_start is implemented in block/mirror.c, It will create ajob with "commit" type and designated base in block-commit command. Thiswill be used for committing active layer of device.
Sync mode is removed from MirrorBlockJob because there's no proper type...
dataplane: change vring API to use VirtQueueElement
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
dataplane: replace hostmem with memory_region_find
device_tree: qemu_fdt_setprop: Rename val_array arg
Looking at the implementation, this doesn't really have a lot to dowith arrays. Its just a pointer to a buffer and is passed throughto the wrapped fn (qemu_fdt_setprop) unchanged. So rename to make it...
device_tree: s/qemu_devtree/qemu_fdt globally
The qemu_devtree API is a wrapper around the fdt_ set of APIs.Rename accordingly.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>[agraf: also convert hw/arm/virt.c]Signed-off-by: Alexander Graf <agraf@suse.de>
roms: Flush icache when writing roms to guest memory
We use the rom infrastructure to write firmware and/or initial kernelblobs into guest address space. So we're basically emulating the cacheoff phase on very early system bootup.
That phase is usually responsible for clearing the instruction cache for...
spapr-rtas: replace return code constants with macros
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>Signed-off-by: Alexander Graf <agraf@suse.de>
spapr-rtas: add ibm, (get|set)-system-parameter
This adds very basic handlers for ibm,get-system-parameter andibm,set-system-parameter RTAS calls.
The only parameter handled at the moment is"platform-processor-diagnostics-run-mode" which is always disabled and...
host-utils: add clrsb32/64 - count leading redundant sign bits
this patch introduces wrappers for the clrsb builtins,which count the leading redundant sign bits.
Signed-off-by: Claudio Fontana <claudio.fontana@linaro.org>Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
hw/arm: add very initial support for Canon DIGIC SoC
DIGIC is Canon Inc.'s name for a family of SoCfor digital cameras and camcorders.
There is no publicly available specification forDIGIC chips. All information about DIGIC chipinternals is based on reverse engineering efforts...
hw/arm/digic: add timer support
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Message-id: 1387188908-754-4-git-send-email-antonynpavlov@gmail.comSigned-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm/digic: add UART support
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Message-id: 1387188908-754-5-git-send-email-antonynpavlov@gmail.com...
vmstate: Add support for an array of ptimer_state *
Add support for defining a vmstate field which is an arrayof pointers to structures, and use this to define aVMSTATE_PTIMER_ARRAY() which allows an array of ptimer_state*to be used by devices.
hw/timer: add allwinner a10 timer
Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Message-id: 1387159292-10436-3-git-send-email-lig.fnst@cn.fujitsu.comSigned-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/intc: add allwinner A10 interrupt controller
Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Message-id: 1387159292-10436-4-git-send-email-lig.fnst@cn.fujitsu.com...
hw/arm: add allwinner a10 SoC support
Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Message-id: 1387159292-10436-5-git-send-email-lig.fnst@cn.fujitsu.comSigned-off-by: Peter Maydell <peter.maydell@linaro.org>
include: add missing config-host.h include
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
char: add qemu_chr_fe_event()
Teach the chardev frontend to send event. This is used by the Spice portchardev currently.