make: Remove duplicate use of GLIB_CFLAGS
Makefile, Makefile.hw, Makefile.target and libcacard/Makefileadded GLIB_CFLAGS to QEMU_CFLAGS.
Makefile.objs does this, too, and is included by all otherMakefiles, so GLIB_CFLAGS were added twice (reported by malc)....
ARM devboards: Set arm_sysctl properties before init, not after
The ARM devboard models (vexpress-a9, realview, versatilepb, etc)were accidentally trying to set one of the arm_sysctl propertiesafter device init. This has now become a fatal error; set the property...
Merge remote-tracking branch 'bonzini/qdev-props-for-anthony' into staging
Merge remote-tracking branch 'aneesh/for-upstream' into staging
Merge remote-tracking branch 'sweil/w32' into staging
Restore consistent formatting
Signed-off-by: malc <av1474@comtv.ru>
w32: Build windows and console executables
System emulation executables with SDL are typically windowsexecutables. Sometimes console executables are more useful,so create both variants if linker option -mwindows was detected.
v2:This version uses QEMU_PROGW / QEMU_PROG instead of QEMU_PROG / QEMU_PROGC....
w32: Initialise critical section before starting thread (fix #922131)
This patch was contributed by Bogdan Harjoc. I added some assertions.
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Stefan Weil <sw@weilnetz.de>
qdev: let QOM free properties
Drop the special free callback. Instead, register a "regular" release method in the non-legacy property.
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
qdev: fix off-by-one
Integer properties did not work.
qdev: access properties via QOM
Do not poke anymore in the struct when accessing qdev properties.Instead, ask the object to set the right value.
qdev: inline qdev_prop_set into qdev_prop_set_ptr
qdev_prop_set is not needed anymore except for hacks, simplify it andinline it.
qdev: initialize properties via QOM
Similarly, use the object properties also to set the defaultvalues of the qdev properties. This requires reorderingregistration and initialization.
qdev: remove unused fields from PropertyInfo
qom: fix off-by-one
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
qom: add object_resolve_path_type
qom: use object_resolve_path_type for links
This allows to restrict partial matches to objects of the expectedtype. It will let people use bare names to reference driveseven though their name might be the same as a device's (e.g.-drive id=hd0,if=none,... -device ...,drive=hd0,id=hd0)....
qom: fix canonical paths vs. interfaces
qom: add property get/set wrappers for links
These can set a link to any object, as long as it is included inthe composition tree.
qdev: remove direct calls to print/parse
There's no need to call into ->parse and ->print manually. TheQOM legacy properties do that for us.
Furthermore, in some cases legacy and static properties have exactlythe same behavior, and we could drop the legacy properties right away....
qdev: allow reusing get/set for legacy property
In some cases, a legacy property does need a special print methodbut not a special parse method. In this case, we can reuse the get/setfrom the static (non-legacy) property.
If neither parse nor print is needed, though, do not register the...
qdev: remove parse method for string properties
We need the print method to put double quotes, but parsing is not special.
qdev: remove print/parse methods from LostTickPolicy properties
Also generalize the code so that we can have more enum propertiesin the future.
qdev: remove parse/print methods for mac properties
qdev: make the non-legacy pci address property accept an integer
PCI addresses are set with qdev_prop_uint32. Thus we make the QOMproperty accept a device and function encoded in an 8-bit integer,instead of the magic dd.f hex string.
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>...
qdev: remove parse/print methods for pointer properties
Pointer properties (except for PROP_PTR of course) should not need alegacy counterpart. In the future, relative paths will ensure thatQEMU will support the same syntax as now for drives etc..
qom: do not include qdev header file
qom: add QObject-based property get/set wrappers
Move the creation of QmpInputVisitor and QmpOutputVisitor from qmp.cto qom/object.c, since it's the only practical way to access objectproperties.
Keep this isolated such that it's easy to remove. At some point, we need...
qom: add property get/set wrappers for C types
Add wrappers that let you get/set properties using normal C data types.
Reviewed-by: Anthony Liguori <anthony@aliguori@us.ibm.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
qom: avoid useless conversions from string to type
qom: clean up/optimize object_dynamic_cast
The interface loop can be performed only on the parent object. Itdoes not need to be done on each interface. Similarly, we cansimplify the code by switching early from the implementationobject to the parent object....
qom: more documentation on subclassing
qom: clean up cast macros
s390x: fix qom-ification fall-out
Tested-by: Andreas Faerber <afaerber@suse.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
KVM: Fix breakages of QOM conversion
KVM APIC and PIC require instance sizes.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
usb-redir: convert to QOM
This was missed due to the fact that it's in the top level and it uses'struct DeviceInfo' instead of 'DeviceInfo' for some strange reason.
Tested-by: Benoît Canet <benoit.canet@gmail.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Fix previous commit
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
usb-bsd: convert to QOM
Simple enough.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
memory: change dirty getting API to take a size
Instead of each device knowing or guessing the guest page size,just pass the desired size of dirtied memory area.
vga: move Cirrus VGA template to its own file
Standard VGA does not use vga_draw_cursor_line_* functions.Move the template to cirrus_vga_template.h.
Add vga.h unmodified from Linux
vga.h: remove unused stuff and reformat
vga: use constants from vga.h
vga: improve documentation
Add links to chipset docs and FreeVGA site.
Merge branch 'linux-user-for-upstream' of git://git.linaro.org/people/rikuvoipio/qemu
w32: Fix build with new net bridge code
Commit a7c36ee4920ea3acc227a0248dd161693f207357 added code for a netbridge and explicitly said that "this is very Linux centric".
Indeed, compilation failed for w32, so the bridge code is nowconditional. Hosts which don't support it can simply remove the...
Merge branch 'for-upstream' of git://repo.or.cz/qemu/agraf
Fix build breakage from last commit.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
s390x: fix -drive in the absence of aliases
qdev: split out common init to instance_init
This gets us closer to being able to object_new() a qdev type and have afunctioning object verses having to call qdev_create().
qdev: refactor away qdev_create_from_info
Note that the FIXME gets fixed in series 4/4. We need to convert BusState toQOM before we can make parent_bus a link.
qdev: split out UI portions into a new function
qdev-monitor.c deals with the -device, device_add, and info qdm/qtreeinterfaces.
qdev: nuke qdev_init_chardev()
I'm sure the intentions were good here, but there's no reason this should be inqdev. Move it to qemu-char where it belongs.
qom: move properties from qdev to object
This is mostly code movement although not entirely. This makes properties partof the Object base class which means that we can now start using Object in ameaningful way outside of qdev.
qom: accept any compatible type when setting a link property
Links had limited utility before as they only allowed a concrete type to bespecified. Now we can support abstract types and interfaces which means it'snow possible to have a link<PCIDevice>....
qdev: implement cleanup logic in finalize
info qdm: do not require a parent_bus to be set
object: sure up reference counting
Now we have the following behavior:
1) object_new() returns an object with ref = 12) object_initialize() does not increase the reference count (ref may be 0).3) object_deref() will finalize the object when ref = 0. it does not free the...
container: make a decendent of Object
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>---v1 -> v2 - Add license (Paolo)
qdev: remove baked in notion of aliases (v2)
Limit them to the device_add functionality. Device aliases were a hack basedon the fact that virtio was modeled the wrong way. The mechanism for aliasingis very limited in that only one alias can exist for any device....
qom: add new command to search for types
This adds a command that allows searching for types that implement a property.This allows you to do things like search for all available PCIDevices. In thefuture, we'll also have a standard interface for things with a BlockDriverState...
qdev: kill off DeviceInfo list
Teach the various bits of code that need to walk through available devices todo so via QOM.
Signed-off-by: Anthony Liguori
qdev: register all types natively through QEMU Object Model
This was done in a mostly automated fashion. I did it in three steps and thenrebased it into a single step which avoids repeatedly touching every file inthe tree.
The first step was a sed-based addition of the parent type to the subclass...
qdev: kill off DeviceInfo
It is no longer used in the tree since everything is done natively throughQEMU Object Model.
qdev: remove info from class
Now DeviceInfo is no longer used after object construction. All of therelevant members have been moved to DeviceClass.
qdev: allow classes to overload qdev functions
This allows us to drop per-Device registration functions by allowing theclass_init functions to overload qdev methods.
qdev: refactor device creation to allow bus_info to be set only in class
As we use class_init to set class members, DeviceInfo no longer holds thisinformation.
qom: allow object_class_foreach to take additional parameters to refine search
qdev: make DeviceInfo private
Introduce accessors and remove any code that directly accesses DeviceInfomembers.
usb-hid: simplify class initialization a bit
We can probably model USBHidDevice as a base class to get even better codesharing but for now, just use a common function to initialize the common classmembers.
usb: separate out legacy usb registration from type registration
Type registeration is going to get turned into a QOM call so decouple thelegacy support.
linux-user: Define TARGET_QEMU_ESIGRETURN for mips64
Copied from mips/syscall.h.
Signed-off-by: Khansa Butt <khansa@kics.edu.pk>Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
linux-user: Fix sa_flags byte swaps for mips
sa_flags is uint32_t for mips{,n32,64}, so don't use tswapal().
edited by Riku Voipio: likewise on alpha
Reported-by: Khansa Butt <khansa@kics.edu.pk>Suggested-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Andreas Färber <afaerber@suse.de>...
linux-user: fake /proc/self/maps
glibc's pthread_attr_getstack tries to find the stack range from/proc/self/maps. Unfortunately, /proc is usually the host's /procwhich means linux-user guests see qemu's stack there.
Fake the file with a constructed maps entry that exposes the guest's...
linux-user: fake /proc/self/stat
The boehm gc finds the program's stack starting pointer bychecking /proc/self/stat. Unfortunately, so far it readsqemu's stack pointer which clearly is wrong.
So let's instead fake the file so the guest program sees the...
linux-user: fake /proc/self/auxv
Gtk tries to read /proc/self/auxv to find its auxv table instead oftaking it from its own program memory space.
However, when running with linux-user, we see the host's auxv whichclearly exposes wrong information. so let's instead expose the guest...
linux-user/main.c: Add option to user-mode emulation so that user can specify log file name
QEMU linux user-mode's default log file name is "/tmp/qemu.log". In order tochange the log file name, user need to modify the source code then recompileQEMU. This patch allow user use "-D logfile" option to specify the log file...
linux-user: add SO_PEERCRED support for getsockopt
Signed-off-by: Akos PASZTORY <akos.pasztory@gmail.com>Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
linux-user: fix QEMU_STRACE=1 segfault
While debugging some issues with QEMU_STRACE I stumbled over segmentationfaults that were pretty reproducible. Turns out we tried to treat anormal return value as errno, resulting in an access over array boundaries...
linux-user/strace.c: Correct errno printing for mmap etc
Correct the printing of errnos for syscalls which are handledvia print_syscall_ret_addr (mmap, mmap2, brk, shmat): errnosare returned as negative returned values at this level, notvia the host 'errno' variable....
linux-user: fix wait* syscall status returns
When calling wait4 or waitpid with a status pointer and WNOHANG, thesyscall can potentially not modify the status pointer input. Now if wehave guest code like:
int status = 0; waitpid(pid, &status, WNOHANG);...
linux-user: Allow NULL value pointer in setxattr and getxattr
It's valid to pass a NULL value pointer to setxattr, so don'tfail this case EFAULT.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
linux-user/syscall.c: Implement f and l versions of set/get/removexattr
Implement the f and l versions (operate on fd, don't follow links)of the setxattr, getxattr and removexattr syscalls.
linux-user: Implement *listxattr syscalls
Implement listxattr, flistxattr and llistxattr syscalls.
linux-user: Add default-configs for mipsn32[el]
Prepares for mipsn32[el]-linux-user targets.
Signed-off-by: Ulricht Hecht <uli@suse.de>Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
linux-user: Add default configs for mips64[el]
Prepares for mips64[el]-linux-user targets.
linux-user: Define TARGET_QEMU_ESIGRETURN for mipsn32
Signed-off-by: Ulrich Hecht <uli@suse.de>Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
linux-user: save auxv length
We create our own AUXV segment on stack and save a pointer to it.However we don't save the length of it, so any code that wants todo anything useful with it later on has to walk it again.
Instead, let's remember the length of our AUXV segment. This...
linux-user: add open() hijack infrastructure
There are a number of files in /proc that expose host informationto the guest program. This patch adds infrastructure to overridethe open() syscall for guest programs to enable us to on the flygenerate guest sensible files....
linux-user: stack_base is now mandatory on all targets
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
PPC: E500: Populate L1CFG0 SPR
When running Linux on e500 with powersave-nap enabled, Linux tries toread out the L1CFG0 register and calculates some things from it. Passing0 there ends up in a division by 0, resulting in -1, resulting in badness.
So let's populate the L1CFG0 register with reasonable defaults. That way...
PPC: E500: Add doorbell defines
We're going to introduce doorbell instructions (called processorcontrol in the spec) soon. Add some defines for easier patchreadability later.
Signed-off-by: Alexander Graf <agraf@suse.de>
PPC: Add CPU feature for processor control
We're soon going to implement processor control features. Add thefeature flag, so we're well prepared.
PPC: Enable doorbell excp handlers
We already had all the code available to have doorbell exceptionsbe handled properly. It was just disabled.
Enable it, so we can rely on it.
PPC: E500: Implement msgclr
This patch implements the msgclr instruction. It is part of theEmbedded.Processor Control specification and clears pending doorbellinterrupts on the current CPU.
PPC: E500: Implement msgsnd
This patch implements the msgsnd instruction. It is part of theEmbedded.Processor Control specification and allows one CPU toIPI another CPU without going through an interrupt controller.
PPC: e500mc: Enable processor control
The e500mc implements Embedded.Processor Control, so enable it andthus enable guests to IPI each other. This makes -smp work with -cpue500mc.
PPC: booke206: move avail check to tlbwe
We can have TLBs that only support a single page size. This is definedby the absence of the AVAIL flag in TLBnCFG. If this is the case, wecurrently write invalid size info into the TLB, but override it oninternal fault....
KVM: Fix compilation on non-x86
Commit 84b058d broke compilation for KVM on non-x86 targets, whichdon't have KVM_CAP_IRQ_ROUTING defined.
Fix by not using the unavailable constant when it's not around.
PPC: E500: Add some more excp vectors
Our EXCP list is getting outdated. By now, 3 new exception vectors havebeen introduced. Update the list so we have everything at one place.