libcacard: rewrite Makefile in non-recursive style
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
libcacard: link vscclient to dynamic library
There is no reason for vscclient to duplicate the code. rules.maktakes care of invoking libtool to do the link.
libcacard: use per-target variable definitions
This lets the libcacard Makefile use more rules.mak magic.
libcacard: add list of exported symbols
Do not export internal QEMU symbols.
build: remove CONFIG_SMARTCARD
The passthru smartcard does not have the shared library dependency, buildit unconditionally.
libcacard: fix missing symbol in libcacard.so
Before patch:$ make libcacard.la$ nm ./libcacard/.libs/libcacard.so.0.0.0 | grep " U " | \ egrep -v "(g_)|(GLIBC)|(SECMOD)|(PK11)|(CERT)|(NSS)|(PORT)|(PR)" U error_set
Signed-off-by: Alon Levy <alevy@redhat.com>...
libcacard: require libtool to build it
Do not fail at build time, instead just disable the library if libtoolis not present.
libcacard: prepare to use -y trick in the Makefile
Rename variables to follow the conventions of the rest of the buildsystems.
build: support linking with libtool objects/libraries
This patch moves the complication of using libtool to the genericrules.mak file.
build: move dtrace rules to rules.mak
stubs: fully replace qemu-tool.c and qemu-user.c
build: make libtool verbose when making with V=1
qemu-option: move standard option definitions out of qemu-config.c
Merge branch 'target-arm.next' of git://git.linaro.org/people/pmaydell/qemu-arm
Merge branch 'ppc-for-upstream' of git://repo.or.cz/qemu/agraf
Merge branch 's390-reorg' of git://repo.or.cz/qemu/rth
hw/pc.c: add ULL suffix in ioport80_read and ioportF0_read return value
The commit c02e1eac887b1b0aee7361b1fcf889e7d47fed9d broke the compilationfor i386. ULL need to be specify for uint64_t value.
Signed-off-by: Julien Grall <julien.grall@citrix.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
tcg-i386: use LEA for 3-operand 64-bit addition
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
pixman: fix warning
Cc: afaerber@suse.deCc: agraf@suse.deSigned-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
gcc: rename CONFIG_PRAGMA_DISABLE_UNUSED_BUT_SET to CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
optionrom: build with discrete CPP and AS steps
Build option ROM .S files with separate preprocessor andassembler steps because the C compiler could be unsuitable.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
slirp: remove unused field tt
user: Consider symbolic links as possible directories
Commit 2296f194dfde4c0a54f249d3fdb8c8ca21dc611b reduced the numberof syscalls performed during user emulation startup, but failed toconsider the use of symbolic links in creating directory structures....
alpha-linux-user: Fix sigaction
Unconditional bswap replaced by _get_user/_put_user.
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
linux-user: Rewrite _get_user/_put_user with __builtin_choose_expr
The previous formuation with multiple assignments to __typeof(*hptr) fallsdown when hptr is qualified const. E.g. with const struct S *p, p->f isalso qualified const.
With this formulation, there's no assignment to any local variable....
bswap: Rewrite cpu_to_<endian><type>u with {ld,st}<type>_<endian>_p
We've now optimized the ld/st versions; reuse that for the "legacy" versions. Always use inlines so that we get the type checking thatwe expect.
Signed-off-by: Richard Henderson <rth@twiddle.net>...
bswap: Rewrite all ld<type>_<endian>_p functions
Use the new host endian unaligned access functions instead ofopen coding byte-by-byte references. Remove assembly specialcases for i386 and ppc -- we've now exposed the operation tothe compiler sufficiently for these to be optimized automatically....
bswap: Add host endian unaligned access functions
bswap: Tidy base definitions of bswapN
Move the bswap_N -> bswapN wrappers inside CONFIG_BYTESWAP_H.
Change the ultimate fallback defintions from macros to inline functions.The proper types recieved by the function arguments means we can removeunnecessary casts, making the code more readable....
fdt: Use bswapN instead of bswap_N
Fixes the libfdt enabled build for hosts that have <machine/bswap.h>.
The code at the beginning of qemu/bswap.h is attempting to standardizeon bswapN. In the case of CONFIG_MACHINE_BSWAP_H, this is all we get.In the case of CONFIG_BYTESWAP_H, we get bswap_N from the system header...
target-arm: use type_register() instead of type_register_static()
The type_register_static() interface is documented as:
type_register_static: @info: The #TypeInfo of the new type.
@info and all of the strings it points to should exist for the life...
target-arm: Fix SWI (SVC) instruction in M profile.
When do_interrupt_v7m is called with EXCP_SWI, the PC alreadypoints to the next instruction. Don't modify it here.
Signed-off-by: Alex Rozenman <Alex_Rozenman@mentor.com>Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Merge remote-tracking branch 'kraxel/q35.1' into staging
Conflicts:...
Merge remote-tracking branch 'afaerber-or/prep-up' into staging
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/pc.c: Fix converting of ioport_register* to MemoryRegion
The commit 258711 introduced MemoryRegion to replace ioport_region*for ioport 80h and F0h.A MemoryRegion needs to have both read and write callback otherwise a segfaultwill occur when an access is made....
Replace remaining gmtime, localtime by gmtime_r, localtime_r
This allows removing of MinGW specific code and improvesreentrancy for POSIX hosts.
[Removed unused ret variable in qemu_get_timedate() to fix warning:vl.c: In function ‘qemu_get_timedate’:vl.c:451:16: error: variable ‘ret’ set but not used [-Werror=unused-but-set-variable]...
savevm: Remove MinGW specific code which is no longer needed
QEMU provides a portable function qemu_gettimeofday instead ofgettimeofday and also an implementation of localtime_r for MinGW.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
qga/channel-posix.c: Explicitly include string.h
Explicitly include string.h to avoid warnings under MacOS X/clangabout implicit declarations of strerror() and strlen().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Stefan Weil <sw@weilnetz.de>...
configure: Fix comment (copy+paste bug)
q35: add ich9 intel hda controller
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
q35: document chipset devices
pc: rename machine types
Starting with release 1.4 we have a fully functional q35 machine type,i.e. "qemu -M q35" JustWorks[tm]. Update machine type names to reflectthat:
The pc-1.3 (+older) names are maintained for compatibility reasons....
Makefile: install the "acpi-dsdt.aml" and "q35-acpi-dsdt.aml" blobs too
The WARNING message from commit f7e4dd6c made me notice.
Signed-off-by: Laszlo Ersek <lersek@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
qdev: add qbus_reset_all
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-scsi: abort in-flight I/O when the device is reset
When the device is reset, the SCSI bus should also be reset sothat in-flight I/O is cancelled.
Make all static TypeInfos const
Since 39bffca2030950ef6efe57c2fac8327a45ae1015 (qdev: register alltypes natively through QEMU Object Model), TypeInfo as used inthe common, non-iterative pattern is no longer amended with informationand should therefore be const....
Merge branch 'master' of git://git.qemu.org/qemu into prep-up
Conflicts: hw/Makefile.objs hw/ppc_prep.c
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Merge remote-tracking branch 'kraxel/build.1' into staging
Merge remote-tracking branch 'awilliam/tags/qemu-1.4-vfio-20130109.0' into staging
vfio-pci: Fixes for qemu 1.4 & stable
rtc-test: skip year-2038 overflow check in case time_t is 32bit only
m48t59-test: don't touch watchdog
Check return values from g_poll and select
The current implementation of os_host_main_loop_wait() on Windows,returns 1 only when a g_poll() event occurs because the return value ofselect() is overridden. This is wrong as we may skip a socket event, asshown in this example:...
Merge remote-tracking branch 'mdroth/qga-pull-1-8-2013' into staging
qemu-ga: bios_supports_mode(): improve error reporting
Most errors are QERR_UNDEFINED_ERROR today.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
qemu-ga: guest_suspend(): improve error reporting
qemu-ga: execute hook to quiesce the guest on fsfreeze-freeze/thaw
To use the online disk snapshot for online-backup, application-levelconsistency of the snapshot image is required. However, currently theguest agent can provide only filesystem-level consistency, and the...
qemu-ga: sample fsfreeze hooks
Adds sample hook scripts for --fsfreeze-hook option of qemu-ga. - fsfreeze-hook : execute scripts in fsfreeze-hook.d/ - fsfreeze-hook.d/mysql-flush.sh.sample : quiesce MySQL before snapshot
Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama.qu@hitachi.com>...
qemu-ga: qmp_guest_file_*: improve error reporting
Use error_setg_errno() when possible with an improved error description.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
qemu-ga: qmp_guest_shutdown(): improve error reporting
Most errors are QERR_UNDEFINED_ERROR. Also, adds ga_wait_child() asa future commit will use it too.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>...
qemu-ga: build_fs_mount_list(): take an Error argument
qemu-ga: qmp_guest_fsfreeze_*(): get rid of sprintf() + error_set()
Convert them to error_setg_errno().
qemu-ga: qmp_guest_fstrim(): get rid of sprintf() + error_set()
qemu-ga: qmp_guest_network_get_interfaces(): get rid of snprintf() + error_set()
qemu-ga: guest_file_handle_find(): take an Error argument
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
*Fixed missing space character in error message
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
qemu-ga: qmp_guest_file_close(): fix fclose() error check
fclose() returns EOF on error.
Merge remote-tracking branch 'afaerber/qom-cpu' into staging
vfio-pci: Loosen sanity checks to allow future features
VFIO_PCI_NUM_REGIONS and VFIO_PCI_NUM_IRQS should never have beenused in this manner as it locks a specific kernel implementation.Future features may introduce new regions or interrupt entries(VGA may add legacy ranges, AER might add an IRQ for error...
vfio-pci: Make host MSI-X enable track guest
Guests typically enable MSI-X with all of the vectors in the MSI-Xvector table masked. Only when the vector is enabled does the vectorget unmasked, resulting in a vector_use callback. These two points,enable and unmask, correspond to pci_enable_msix() and request_irq()...
cpu: Change parent type to Device
This finally makes the CPU class a subclass of the Device class,allowing us to start using DeviceState properties on CPU subclasses.
It has no_user=1, as creating CPUs using -device doesn't work yet.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>...
target-i386: kvm: -cpu host: Use GET_SUPPORTED_CPUID for SVM features
The existing -cpu host code simply sets every bit inside svm_features(initializing it to -1), and that makes it impossible to make theenforce/check options work properly when the user asks for SVM features...
target-i386: kvm: Enable all supported KVM features for -cpu host
When using -cpu host, we don't need to use the kvm_default_featuresvariable, as the user is explicitly asking QEMU to enable all featuresupported by the host.
This changes the kvm_cpu_fill_host() code to use GET_SUPPORTED_CPUID to...
target-i386: check/enforce: Fix CPUID leaf numbers on error messages
The -cpu check/enforce warnings are printing incorrect information about themissing flags. There are no feature flags on CPUID leaves 0 and 0x80000000, butthere were references to 0 and 0x80000000 in the table at...
target-i386: check/enforce: Do not ignore "hypervisor" flag
We don't need any hack to ignore CPUID_EXT_HYPERVISOR anymore, becausekvm_arch_get_supported_cpuid() now sets CPUID_EXT_HYPERVISOR properly.So, this shouldn't introduce any behavior change, but it makes the code...
target-i386: check/enforce: Check all CPUID.80000001H.EDX bits
I have no idea why PPRO_FEATURES was being ignored on the check of theCPUID.80000001H.EDX bits. I believe it was a mistake, and it wassupposed to be ~(PPRO_FEATURES & CPUID_EXT2_AMD_ALIASES) or just...
target-i386: check/enforce: Check SVM flag support as well
When nested SVM is supported, the kernel returns the SVM flag onGET_SUPPORTED_CPUID1, so we can check the SVM flag safely inkvm_check_features_against_host().
I don't know why the original code ignored the SVM flag. Maybe it was...
target-i386: check/enforce: Eliminate check_feat field
Now that all entries have check_feat=~0 inkvm_check_features_against_host(), we can eliminate check_feat entirelyand make the code check all bits.
This patch shouldn't introduce any behavior change, as check_feat is set...
qemu-common.h: Make qemu_init_vcpu() stub static inline
Turn the *-user macro into a no-op inline function to avoidunused-variable warnings and band-aiding #ifdef'ery.
This allows to drop an #ifdef for alpha and avoids more for unicore32and other upcoming trivial realizefn implementations....
target-i386: Filter out unsupported features at realize time
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>Signed-off-by: Igor Mammedov <imammedo@redhat.com>Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
target-i386: Sanitize AMD's ext2_features at realize time
When CPU properties are implemented, ext2_features may changebetween object_new(CPU) and cpu_realize_fn(). Sanitizingext2_features for AMD based CPU at realize() time will keepcurrent behavior after CPU features are converted to properties....
target-i386: Explicitly set vendor for each built-in cpudef
Since cpudef config is not supported anymore and all remaining sourcesnow always set x86_def_t.vendor123 fields, remove setting defaultvendor to simplify future re-factoring.
libqemustub: Add qemu_[un]register_reset() stubs
This will be useful for code that don't call qemu_devices_reset() (e.g.*-user). If qemu_devices_reset() is never called, it means we don't needto keep track of the reset handler list.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>...
libqemustub: vmstate register/unregister stubs
Add vmstate stub functions, so that qdev.o can be used without savevm.owhen vmstate support is not necessary (i.e. by *-user).
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
libqemustub: sysbus_get_default() stub
The stub will be used on cases where sysbus.c is not compiled in (e.g.*-user).
Note that code that uses NULL as the bus with qdev{_try,}_create()implicitly uses sysbus_get_default() as the bus, and will still require...
qdev: Include qdev code into *-user, too
The code depends on some functions from qemu-option.o, so addqemu-option.o to universal-obj-y to make sure it's included.
qdev: Don't assume existence of parent bus on unparenting
Commit 667d22d1ae59da46b4c1fbd094ca61145f19b8c3 (qdev: move bus removalto object_unparent) made the assumption that at unparenting timeparent_bus is not NULL. This assumption is unjustified since...
Merge remote-tracking branch 'kraxel/usb.75' into staging
Merge remote-tracking branch 'stefanha/net' into staging
target-mips: Fix helper and tests for dot/cross-dot product instructions
Helper function for dpa_w_ph, dpax_w_ph, dps_w_ph and dpsx_w_ph incorrectlydefines halfword vector elements as unsigned values. This results in wrongoutput which is not triggered in the tests as they also follow this logic....
target-mips: Replace macros by inline functions
The macros RESTORE_ROUNDING_MODE and RESTORE_FLUSH_MODE silently usedvariable env from their callers. Using inline functions with env passedas a function argument is more transparent.
This modification was proposed by Peter Maydell....
target-mips: Allow DSP access to be disabled once enabled.
Clear the DSP hflags at the start of compute_hflags. Otherwise accessis not properly disabled once enabled.
Signed-off-by: Eric Johnson <ericj@mips.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
linux-user: fix mips 32-on-64 prealloc case
MIPS only supports 31 bits of virtual address space for user space, so let'smake sure we stay within that limit with our preallocated memory block.
This fixes the MIPS user space targets when executed without command line...
usbredir: Add support for buffered bulk input (v2)
Buffered bulk mode is intended for bulk input endpoints, where the data isof a streaming nature (not part of a command-response protocol). Theseendpoints' input buffer may overflow if data is not read quickly enough....
uhci: stop using portio lists
readline: avoid memcpy() of overlapping regions
memcpy() for overlapping regions is undefined behavior; use memmove()instead in readline_hist_add().
[Keep tab characters since surrounding code still uses them -- Stefan]
Signed-off-by: Nickolai Zeldovich <nickolai@csail.mit.edu>...
PPC: KVM: set has-idle in guest device tree
On e500mc, the platform doesn't provide a way for the CPU to go idle.
To still not uselessly burn CPU time, expose an idle hypercall to the guestif kvm supports it.
Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>...
PPC: Bring EPR support closer to reality
We already used to support the external proxy facility of FSL MPICs,but only implemented it halfway correctly.
This patch adds support for
target-ppc: Slim conversion of model definitions to QOM subclasses
Since the model list is highly macrofied, keep ppc_def_t for now andsave a pointer to it in PowerPCCPUClass. This results in a flat list ofsubclasses including aliases, to be refined later....
target-ppc: Error out for -cpu host on unknown PVR
Previously we silently exited, with subclasses we got an opcode warning.Instead, explicitly tell the user what's wrong.
An indication for this is -cpu ? showing "host" with an all-zero PVR.
Signed-off-by: Andreas Färber <afaerber@suse.de>...
PPC: linux-user: Calculate context pointer explicitly
Peter Maydell recommended the change to be more proper. The result was testedand shows coming up with the same proper value.
Signed-off-by: Samuel Seay <LightningTH@GMail.com>[agraf: change subject]...