qapi: add QMP command registration/lookup functions
Registration/lookup functions for that provide a lookup table fordispatching QMP commands.
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
qapi: add QMP dispatch functions
Given an object recieved via QMP, this code uses the dispatch tableprovided by qmp_registry.c to call the corresponding marshalling/dispatchfunction and format return values/errors for delivery to the QMP.Currently only synchronous QMP functions are supported, but this will...
qapi: add ordereddict.py helper library
We need this to parse dictionaries with schema ordering intact so that Cprototypes can be generated deterministically.
qapi: add qapi.py helper libraries
qapi: add qapi-types.py code generator
This is the code generator for qapi types. It will generation thefollowing files:
$(prefix)qapi-types.h - C types corresponding to types defined in the schema you pass in $(prefix)qapi-types.c - Cleanup functions for the above C types...
qapi: add qapi-visit.py code generator
This is the code generator for qapi visiter functions used tomarshal/unmarshal/dealloc qapi types. It generates the following 2files:
$(prefix)qapi-visit.c: visiter function for a particular c type, used to automagically convert qobjects into the...
qapi: add qapi-commands.py code generator
This is the code generator for qapi command marshaling/dispatch.Currently only generators for synchronous qapi/qmp functions aresupported. This script generates the following files:
$(prefix)qmp-marshal.c: command marshal/dispatch functions for each...
qapi: test schema used for unit tests
This is how QMP commands/parameters/types would be defined. We use asubset of that functionality here to implement functions/types for unittesting.
qapi: add test-visitor, tests for gen. visitor code
Introduce compiler.h header file
This moves compiler related macros from qemu-common.h to compiler.h.
The reason for this change is that there are simple header files thatdepend only on the compiler macros, so including qemu-common.h is overkill.
Besides, qemu-common.h is bloated and will benefit from some splitting....
Error: Fix build when qemu-common.h is not included
Commit e4ea5e2d0e0e4c5188ab45b66f3195062ae059dc added the use ofthe macro GCC_FMT_ATTR to error.h, however compiler.h is notincluded by error.h
This will cause a build error when files including error.h...
Add hard build dependency on glib
GLib is an extremely common library that has a portable thread implementationalong with tons of other goodies.
GLib and GObject have a fantastic amount of infrastructure we can leverage inQEMU including an object oriented programming infrastructure....
qlist: add qlist_first()/qlist_next()
qapi: add module init types for qapi
qapi: add QAPI visitor core
Base definitions/includes for Visiter interface used by generatedvisiter/marshalling code.
Includes a GenericList type. Our lists require an embedded element.Since these types are generated, if you want to use them in a different...
qapi: add QMP input visitor
A type of Visiter class that is used to walk a qobject'sstructure and assign each entry to the corresponding native C type.Command marshaling function will use this to pull out QMP commandparameters recieved over the wire and pass them as native arguments...
qapi: add QMP output visitor
Type of Visiter class that serves as the inverse of the input visitor:it takes a series of native C types and uses their values to construct acorresponding QObject. The command marshaling/dispatcher functions willuse this to convert the output of QMP functions into a QObject that can...
qapi: add QAPI dealloc visitor
Type of Visitor class that can be passed into a qapi-generated Ctype's visitor function to free() any heap-allocated data types.
QMP: add snapshot-blkdev-sync command
Add QMP bits for snapshot_blkdev command. This is the same assnapshot_blkdev in the human monitor. The command is synchronous.
In the future async commands and or a break down of the functionalityinto multiple commands might be added....
Update OpenBIOS images for Sparc32 and Sparc64
Update Sparc32 and Sparc64 OpenBIOS images to SVN revision 1045.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Fix unassigned memory access handling
cea5f9a28faa528b6b1b117c9ab2d8828f473fef exposed bugs in unassigned memoryaccess handling. Fix them by always passing CPUState to the handlers.
Reported-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Avoid CPU endian memory accesses in devices
Don't compile virtio.c in hwlib, it depends on memory accessesperformed in CPU endianness.
Make loads and stores in CPU endianness unavailable to devicesand poison them to avoid further bugs.
Acked-by: Alexander Graf <agraf@suse.de>...
SPARC64: treat UA2007 ASI_BLK_* as translating ASIs.
UA2007 ASI_BLK_* should be added in is_translating_asi().
Signed-off-by: Tsuneo Saito <tsnsaito@gmail.com>Acked-by: Artyom Tarasenko <atar4qemu@gmail.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
checkpatch: Fix bracing false positives on #if
789f88d0b21fedfd4251d56bb7a9fbfbda7a4ac7 only fixed #else,fix also #if.
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
tcg/mips: Fix regression caused by typo (copy + paste bug)
cppcheck reports an error:qemu/tcg/mips/tcg-target.c:1487: error: Invalid number of character (()
The unpatched code won't compile on mips hosts starting with commitcea5f9a28faa528b6b1b117c9ab2d8828f473fef....
ds1225y: convert to qdev device, and use it in MIPS Jazz emulation
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
ds1225y: use trace framework
ds1225y: Remove protection stuff, which doesn't belong to this device
SPARC64: add missing break on fmovdcc
"break" is missing on V9 fmovdcc (%icc).
Signed-off-by: Tsuneo Saito <tsnsaito@gmail.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
SPARC64: fix VIS1 SIMD signed compare instructions
The destination registers of SIMD signed compare instructions(fcmp*<16|32>) are not FP registers but general purpose r registers.Comparisons should be freg_rs1 CMP freg_rs2, that were reversed.
Signed-off-by: Tsuneo Saito <tsnsaito@gmail.com>...
Merge branch 'for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm
Merge remote-tracking branch 'agraf/xen-next' into staging
Merge remote-tracking branch 'kraxel/usb.19' into staging
Merge remote-tracking branch 'spice/spice.v38' into staging
Merge remote-tracking branch 'mst/for_anthony' into staging
Merge remote-tracking branch 'riku/linux-user-for-upstream' into staging
virtio-serial-bus: Fix trailing \n in error_report string
Markus fixed offenders in the file but one instance sneaked in viaanother patch. Fix it.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
virtio-console: Prevent abort()s in case of host chardev close
A host chardev could close just before the guest sends some data to bewritten. This will cause an -EPIPE error. This shouldn't be propagatedto virtio-serial-bus.
Ideally we should close the port once -EPIPE is received, but since the...
virtio-serial-bus: Add trace events
Add some trace events for messages passed between the guest and host.
virtio-console: Add some trace events
Add some trace events for messages passed between the char layer and thevirtio-serial bus.
pci_ids: tweak names to match linux/pci_ids.h
Sync xen names to ones used by linux. Addxen platform device id as well.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/piix_pci.c: Fix PIIX3-xen to initialize ids
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
xen: move to new pci initializers
move ids to pci info structure
virtio: fix indirect descriptor buffer overflow
We were previously allowing arbitrarily-long indirect descriptors, whichcould lead to a buffer overflow in qemu-kvm process.
CVE-2011-2212
vhost: fix double free on device stop
vhost dev stop failed to clear the log field.Typically not an issue as dev start overwrites this field,but if logging gets disabled before the following start,it doesn't so this causes a double free.
xen_console: fix memory leak
con_init leaks the string "type", fix it.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>Signed-off-by: Alexander Graf <agraf@suse.de>
xen: add vkbd support for PV on HVM guests
Register the vkbd backend even when running as device emulator for HVMguests: it is useful because it doesn't need a frequent timer like usb.
Check whether the XenInput DisplayState has been set in the initialise...
xen_disk: cope with missing xenstore "params" node
When disk is a cdrom and the drive is empty the "params" node inxenstore might be missing completely: cope with it instead ofsegfaulting.
Updated in v2:
- actually removed the strchr(blkdev->params, ':') that caused the...
qemu_ram_ptr_length: take ram_addr_t as arguments
qemu_ram_ptr_length should take ram_addr_t as argument rather thantarget_phys_addr_t because is doing comparisons with RAMBlock addresses.
cpu_physical_memory_map should create a ram_addr_t address to pass to...
xen_disk: treat "aio" as "raw"
Sometimes the toolstack uses "aio" without an additional formatidentifier, in such cases use "raw".
- fix code style.
checkpatch: don't error out on },{ lines
When having code like this:
static PCIDeviceInfo piix_ide_info[] = { { .qdev.name = "piix3-ide", .qdev.size = sizeof(PCIIDEState), .qdev.no_user = 1, .no_hotplug = 1,...
xen_console: support the new extended xenstore protocol
Since CS 21994 on xen-unstable.hg and CS466608f3a32e1f9808acdf832a5843af37e5fcec on qemu-xen-unstable.git, fewchanges have been introduced to the PV console xenstore protocol, asdescribed by the document docs/misc/console.txt under xen-unstable.hg....
xen_console: fall back to qemu serial device
The new xen_console protocol changed the default xen_console output devicefrom whatever Qemu chose to whatever xenstore choses and "pty" as fallback.
This is not how Qemu works. It has its own serial redirection semantics. So...
xen: Clean up build system
Introduce CONFIG_XEN_BACKEND so that this new config solely controls thetarget-independent backend build and CONFIG_XEN can focus on per-targetbuilding.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Alexander Graf <agraf@suse.de>
xen: Clean up map cache API naming
The map cache is a Xen thing, so its API should make this clear.
xen: Fold CONFIG_XEN_MAPCACHE into CONFIG_XEN
Xen won't be enabled if there is no backend support available for thehost. And that also means the map cache will work. So drop the separateconfig switch and move the required stubs over to xen-stub.c.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
xen: enable console and disk backend in HVM mode
Initialize the Xen console backend and the Xen disk backend even whenrunning in HVM mode so that PV on HVM drivers can connect to them.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>...
Fix signal handling of SIG_IPI when io-thread is enabled
Both the signal thread (via sigwait()) and the cpu thread (viaa normal signal handler) were attempting to catch SIG_IPI.
This resulted in random freezes under Darwin.
This patch separates SIG_IPI from the rest of the signals handled...
Fix signal handling when io-thread is disabled
Changes since v1:- take pthread_sigmask() out of the ifdef as it is now commonto both parts.
This fix effectively blocks, in the main thread, the signals handledby signalfd or the compatibility signal thread....
tcg/README: Expand advice on number of TCG ops per target insn
Expand the note on the number of TCG ops generated per target insn,to be clearer about the range of applicability of the 20 op ruleof thumb. Also add a note about the hard MAX_OP_PER_INSTR limit....
set ELF_HWCAP for SPARC and SPARC64
setting ELF_HWCAP fixes dynamic library loading for Linux/sparc64This patch allows loading busybox from Debian 6 initrd
Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Sparc: fix FPU and AM enable checks for translation
Translation used incorrectly CPUState fields directly to checkfor FPU enable state and 32 bit address masking on Sparc64.
Fix by using TB flags instead.
SPARC64: C99 comment fix for block-transfer ASIs
Fixed C99 comments on block-tranfer ASIs.
SPARC64: Add JPS1 ASI_BLK_AIU[PS]L ASIs for ldfa and stfa
Support JPS1 little endian block transfer ASIs.
SPARC64: Add UA2007 ASI_BLK_AIU[PS]L? ASIs for stfa
Support UA2007 block store ASIs for stfa instructions.
SPARC64: Add UA2007 ASI_BLK_AIU[PS]L? ASIs for ldfa
Support UA2007 block load ASIs for ldfa instructions.
SPARC64: fp_disabled checks on stfa/stdfa/stqfa
stfa/stdfa/stqfa instructions should raise fp_disabled exceptionsif %pstate.PEF==0 or %fprs.FEF==0.
SPARC64: Implement stfa/stdfa/stqfa instrcutions properly
This patch implements sparcv9 stfa/stdfa/stqfa instructionswith non block-store ASIs.
SPARC64: fp_disabled checks on ldfa/lddfa/ldqfa
ldfa/lddfa/ldqfa instructions should raise fp_disabled exceptionsif %pstate.PEF==0 or %fprs.FEF==0.
SPARC64: Implement ldfa/lddfa/ldqfa instructions properly
This patch implements sparcv9 ldfa/lddfa/ldqfa instructionswith non block-load ASIs.
linux-user/signal.c: Rename s390 target_ucontext fields to fix ia64
The ia64 sys/ucontext.h defines macros 'uc_link', 'uc_sigmask' and'uc_stack'. Rename the s390 target_ucontext struct members to tuc_*,bringing them into line with the other targets and fixing a compile...
linux-user: make MIPS and ARM eabi use same argument reordering
MIPS uses similar calling convention than ARM eabi, where when using64-bit values some registers are skipped. This patch makes MIPS and ARMeabi share the argument reordering code.
This affects ftruncate64, creating insane sized fails (or just failing)....
linux-user: correct syscall 123 on sh4
As reported by Cédric VINCENT:
The syscall #123 on SH4 should be "TARGET_NR_cacheflush" instead of"TARGET_NR_modify_ldt" [1]. The only consequence of this misnaming isthat many "Unsupported syscall" warnings are issued when emulating JIT...
os-posix: set groups properly for -runas
Andrew Griffiths reports that -runas does not set supplementary groupIDs. This means that gid 0 (root) is not dropped when switching to anunprivileged user.
Add an initgroups(3) call to use the -runas user's /etc/groups...
esp: cancel current request only if some request is in flight
This bug was introduced in 94d3f98a3f3caddd7875f9a11776daeb84962a7b:scsi_cancel_io was checking if some request was pending before tryingto cancel it, while scsi_req_cancel always cancels the request....
target-alpha, target-ppc: Remove unnecessary setjmp.h include
Remove the include of setjmp.h from the cpu.h of target-alphaand target-ppc. This is unnecessary because cpu-defs.h alreadyincludes this header; this change brings these two targetsinto line with all the rest....
Remove unneeded setjmp.h (fix compilation on Debian "lenny")
Some versions of png.h cannot be included after setjmp.h,even when PNG_SKIP_SETJMP_CHECK was defined.
setjmp.h was included from qemu-common.h and is not needed there.Removing the include statement fixes compilation of ui/vnc-enc-tight.c...
tcg: Reload local variables after return from longjmp
Recent compilers look deep into cpu_exec, find longjmp as a noreturnfunction and decide to smash some stack variables as they won't be usedagain. This may lead to env becoming invalid after return from setjmp,...
exec-all.h: Make MAX_OP_PER_INSTR large enough for target-arm's uses
The target-arm frontend's worst-case TCG ops per instr is 194 (and ingeneral many of the "load multiple registers" ARM instructions generatemore than 100 TCG ops). Raise MAX_OP_PER_INSTR accordingly to avoid...
exec.c: Fix calculation of code_gen_buffer_max_size
When calculating the point at which we should not try to put anotherTB into the code gen buffer, we have to allow not just for OPC_MAX_SIZEbut OPC_BUF_SIZE. This is because the target translate.c will only...
spapr: use specific endian ld/st_phys
Signed-off-by: Alexander Graf <agraf@suse.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
s390-virtio: use specific endian ld/st_phys
ppc405_uc: use specific endian ld/st_phys
pl080: use specific endian ld/st_phys
msix: use specific endian ld/st_phys
msi: use specific endian ld/st_phys
intel-hda: use specific endian ld/st_phys
hpet: use specific endian ld/st_phys
exec: add endian specific phys ld/st functions
Device code some times needs to access physical memory and does thatthrough the ld./st._phys functions. However, these are the exact samefunctions that the CPU uses to access memory, which means they willbe endianness swapped depending on the target CPU....
mips: rlimit codes are not the same
The codes for get/setrlimit differ between linux target platforms.This patch adds conversion.This is important else programs (rsyslog, python, ...) can go into anear infinite loop trying to close all the file descriptors from 0 to...
mips: rlimit incorrectly converts values
Byte swap was applied in the wrong order with testing forRLIM_INFINITY. On mips bigendian from an amd64 system this results ininfinity being misinterpretted as 2^31-1.
This is a serious bug because it causes setrlimit stack size to kill...
mips: null pointer deref should segfault
Dereferencing a null pointer causes an exception 0xC (EXCP_AdEL)instead of EXCP_TLBL. This should also trigger a segfault.
Signed-off-by: Wesley W. Terpstra <terpstra@debian.org>Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
mips: missing syscall returns wrong errno
Return -TARGET_ENOSYS instead of -ENOSYS from linux-user/main.c * Caused strange 'Level 2 synchronization messages' instead ofcorrectly reporting the syscall was missing. * Made glibc simply fail instead of using older syscalls...
mips: sigaltstack args
The syscall sigaltstack takes two parameters, not zero. This patchshould have no impact as only values above 4 influence the runtimebehaviour. Nevertheless, it is wrong.
linux-user/syscall.c: Enforce pselect6 sigset size restrictions
Enforce the same restriction on the size of the sigset passed topselect6 as the Linux kernel does. This is both correct and silencesa gcc 4.6 warning about a write-only variable.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
linux-user: Implement prlimit64 syscall
Implement the prlimit64 syscall.
Slightly modified to apply upstream -Riku
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
linux-user: Add syscall numbers from kernel 2.6.39.2
Add syscall numbers for new syscall numbers; this brings usinto line with Linux 2.6.39.2.
linux-user: Add support for even more FB ioctls
This patch was validated with programs from DirectFB-1.0 andWebKit/DirectFB.
Signed-off-by: Cédric VINCENT <cedric.vincent@st.com>Cc: Riku Voipio <riku.voipio@iki.fi>Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
linux-user: Add support for more VT ioctls
DirectFB-1.0 uses at least two of the four added ioctls, and the twoothers were added for completeness. This patch was validated with theprogram "vlock -all/-new".
Signed-off-by: Cédric VINCENT <cedric.vincent@st.com>...
linux-user: Add support for KD...LED ioctls
DirectFB-1.0 uses at least one of the four added ioctls, and the threeothers were added for completeness. This patch was validated with theprogram "setleds" and the following Makefile:
SETLEDS_INIT = setleds -v -num -caps -scroll...