The ABI-specific types used by linux_binprm and image_info
are different after forcing TARGET_ABI32 on. Which means
that the parameters that load_elf_binary_multi sees are not
those that loader_exec passed. This is inherently broken
and is more trouble than it's worth fixing.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Using $pkgconfig instead of pkg-config will use
${cross_prefix}pkg-config if that is available.
This fix is needed for cross compilations without
modified PATH. Without the fix, PATH must be modified
to find the cross pkg-config before the native
pkg-config.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Delete inline functions from tcg-target.h that don't need to be there,
move the others to tcg-target.c. Add 'Z', 'I', 'J' constraints for
0, signed 11-bit, and signed 5-bit respectively. Add GUEST_BASE support
similar to ppc64, with the value stored in a register. Add missing
registers to reg_alloc_order. Add support for 12-bit branch relocations.
Add functions for synthetic operations: addi, mtctl, dep, shd, vshd, ori,
andi, shifts, rotates, multiply, branches, setcond. Split out TLB reads
from qemu_ld and qemu_st; fix argument loading for tlb external calls.
Generate the prologue.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Historically the qemu tlb "addend" field was used for both RAM and IO accesses,
so needed to be able to hold both host addresses (unsigned long) and guest
physical addresses (target_phys_addr_t). However since the introduction of
the iotlb field it has only been used for RAM accesses.
This means we can change the type of addend to unsigned long, and remove
associated hacks in the big-endian TCG backends.
We can also remove the host dependence from target_phys_addr_t.
Signed-off-by: Paul Brook <paul@codesourcery.com>
A few words about design choices:
* On IA64, instructions should be grouped by bundle, and dependencies
between instructions declared. A first version of this code tried to
schedule instructions automatically, but was very complex and too
invasive for the current common TCG code (ops not ending at
instruction boundaries, code retranslation breaking already generated
code, etc.) It was also not very efficient, as dependencies between
TCG ops is not available.
Instead the option taken by the current implementation does not try
to fill the bundle by scheduling instructions, but by providing ops
not available as an ia64 instruction, and by offering 22-bit constant
loading for most of the instructions. With both options the bundle are
filled at approximately the same level.
* Up to 128 registers can be affected to a function on IA64, but TCG
limits this number to 64, which is actually more than enough. The
register affectation is the following:
- r0: used to map a constant argument with value 0
- r1: global pointer
- r2, r3: internal use
- r4 to r6: not used to avoid saving them
- r7: env structure
- r8 to r11: free for TCG (call clobbered)
- r12: stack pointer
- r13: thread pointer
- r14 to r31: free for TCG (call clobbered)
- r32: reserved (return address)
- r33: reserved (PFS)
- r33 to r63: free for TCG
* The IA64 architecture has only 64-bit registers and no 32-bit
instructions (the only exception being cmp4). Therefore 64-bit
registers and instructions are used for 32-bit ops. The adopted
strategy is the same as the ABI, that is the higher 32 bits are
undefined. Most ops (and, or, add, shl, etc.) can directly use
the 64-bit registers, while some others have to sign-extend (sar,
div, etc.) or zero-extend (shr, divu, etc.) the register first.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This adds vhost net device support in qemu. Will be tied to tap device
and virtio by following patches. Raw backend is currently missing,
will be worked on/submitted separately.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Use kinfo_getvmmap(3) on FeeBSD >= 7.x and /compat/linux/proc on older
FreeBSD. (kinfo_getvmmap is preferred since /compat/linux/proc is
usually only mounted on hosts also using the Linuxolator.)
This patch is a bit hacky because the includes needed for kinfo_getvmmap
conflict with other definitions in exec.c by default so I had to `trick
around' a little, but I built the result in FreeBSD 6.4-stable and
7.2-stable tbs and on 8-stable on the host so the hacks at least
should be stable. (If this is a problem maybe we could also move the
kinfo_getvmmap invocations into a seperate source file but that would
be more work...)
Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
New syscall which gets actively used when you have a
fresh kernel.
Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
--sysconfdir requires a parameter (the path), this should be reflected
in the case pattern.
Reported-by: Frank Arnold <frank.arnold@amd.com>
Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
These files are created by configure and grow
unnecessarily at each new call of configure:
roms/seabios/config.mak
roms/vgabios/config.mak
libhw32/config.mak
libhw64/config.mak
libhw32/config.mak and libhw64/config.mak set
compiler options, and the wrong old code results
in very long command lines.
The new code always writes a new config.mak
instead of appending to an existing one.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
To create html output from texi input, texi2html was used.
Output from makeinfo looks cleaner, so replace the old rule
and use makeinfo now.
For those who want to use their own variant of html output,
the macros MAKEINFO and MAKEINFOFLAGS allow customisation.
Option "-I ." is not needed (the current directory is
searched by default), so remove it.
Please note that the build requirements changed, too:
makeinfo is required for doc builds.
texi2html is no longer used.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Starting with mingw32-runtime 3.15, C99/POSIX
format strings (%zu, %lld, ...) are supported
by defining __USE_MINGW_ANSI_STDIO=1.
As QEMU uses such format strings, unconditionally
define this macro. It won't hurt on older revisions
of mingw32-runtime.
Tested with manually installed mingw32-runtime 3.15
on debian (cross compiled + wine).
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Add configure options (--enable-debug-mon and --disable-debug-mon)
plus the MON_DEBUG() macro.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
The static compilation for sdl is broken after
7942769317.
Signed-off-by: TeLeMan <geleman@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This patch adds the documentation-related options "--enable-docs" and
"--disable-docs" to the help message of "configure".
Signed-off-by: Dirk Ullrich <dirk.ullrich@googlemail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Add -static to LDFLAGS earlier as to run the compile_prog() tests with
this flags, this will avoid turning on features for which a shared
library is available but not a static one.
Signed-off-by: Loïc Minier <lool@dooz.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Commit a0f291fc10 has enabled
-fstack-protector-all on all targets, as the configure test is bogus.
GCC only emits a warning and not an error if this option is not
supported, so the configure scripts doesn't detect the problem.
This patch changes the configure script to try the various flags
with -Werror in addition to catch the possible warnings.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Add has() and path_of() funcs and use them across configure; has()
will test whether a command or builtin is available; path_of() will
search the PATH for executables and return the full pathname if found.
Signed-off-by: Loïc Minier <lool@dooz.org
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Check whether sdl-config is available before calling it, otherwise
./configure triggers a warning:
./configure: 957: sdl-config: not found
If neither the .pc file not sdl-config are present, disable SDL support.
Signed-off-by: Loïc Minier <lool@dooz.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
_FORTIFY_SOURCE is a Glibc feature which adds memory and string function
protection.
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
The default value is ${prefix}/etc/qemu. --sysconfdir can be used to override
the default to an absolute path. The expectation is that when installed to
/usr, --sysconfdir=/etc/qemu will be used.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Together with the first patch this enables using the prefixed
pkg-config, thus picking up the correct flags for SDL.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
After the next commit, pkg-config could be used for the shared library
configuration case and sdl-config for static libraries. So I prepare
the test here by doing two changes:
at the same time I remove useless backslashes from the invocation of
grep;
1) fixing a typo ($sd_cflags). The typo has been there since commit
1ac88f2 (remove sdl_static. Just do the right thing if static is yes,
2009-07-27).
2) fixing an erroneous "test `... | grep > /dev/null`" idiom that would
never succeed since grep's output would be empty;
3) checking the status code after executing sdl-config --static --libs;
this is needed for the next patch only.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Since pkgconfig can give different output for different targets,
it should be tried with the cross-compilation prefix first.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Will be required for upcoming KVM cpuid leaf. Host kernels >= 2.6.32 as
well as future kvm-kmod releases (more recent than kvm-kmod-2.6.32.3)
do/will provide them.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Since kvm-kmod-2.6.32.2 we have an alternative source for recent KVM
kernel headers. Use it when available and not overruled by --kerneldir.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This adds a few more vpath suffixes and points the remaining two paths
explicitly to $(SRC_PATH) in order to eliminate the VPATH assignment
from config-host.mak.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Juan has contributed a cool Makefile infrastructure that enables us to drop
static libraries completely:
Move shared obj-y definitions to Makefile.objs, prefixed {common-,hw-,user-},
and link those object files directly into the executables.
Replace HWLIB by HWDIR, specifying only the directory.
Drop --whole-archive and ARLIBS in Makefiles and configure.
Drop GENERATED_HEADERS dependency in rules.mak, since this rebuilds all
common objects after generating a target-specific header; add dependency
rules to Makefile and Makefile.target instead.
v2:
- Don't try to include /config.mak for user emulators
- Changes to user object paths ("Quickfix for libuser.a drop") were obsoleted
by "user_only: compile everything with -fpie" (Kirill A. Shutemov)
v3:
- Fix dependency modelling for tools
- Remove comment on GENERATED_HEADERS obsoleted by this patch
Signed-off-by: Andreas Färber <afaerber@opensolaris.org>
Cc: Blue Swirl <blauwirbel@gmail.com>
Cc: Palle Lyckegaard <palle@lyckegaard.dk>
Cc: Ben Taylor <bentaylor.solx86@gmail.com>
Cc: Juan Quintela <quintela@trasno.org>
Cc: Kirill A. Shutemov <kirill@shutemov.name>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
basename() needs #include <libgen.h>.
No prototype for daemon() is available on Solaris, but link
succeeds.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
We really need compile _all_ sources for user target with -fpie when
use --enable-user-pie.
It's regression introduced by commit add16157d7.
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
qemu_malloc() does not allow size=0 to be passed in and aborts on this behavior.
Unfortunately, there is good reason to believe that within qemu, there are a
number of, so far, undetected places that assume size=0 can be safely passed.
Since we do not want to abort unnecessarily in production builds, return
qemu_malloc(1) whenever the version file indicates that this is a production
build.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
S390x was one of the first platforms that received support for KVM back in the
day. Unfortunately until now there hasn't been a qemu implementation that would
enable users to actually run guests.
So let's include support for KVM S390x in qemu!
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This patch makes configure aware of S390 hosts and guests. When not explicitly
defined using --target-list= no S390 targets will be built though.
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
To avoid the build failing with:
gcc -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-
builtin -I/export/home/andreas/QEMU/qemu -Wall -Wstrict-prototypes -
Werror -fomit-frame-pointer -fno-builtin -I/export/home/andreas/QEMU/
qemu -c -o multiboot.o multiboot.S
/var/tmp//ccd3aWyk.s: Assembler messages:
/var/tmp//ccd3aWyk.s:15: Error: value of 512 too large for field of 1
bytes at 0000000000000002
gmake[1]: *** [multiboot.o] Error 1
disable recursion into pc-bios/optionrom, as done for Darwin already.
Signed-off-by: Andreas Faerber <andreas.faerber@web.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
We're leaking file descriptors to child processes. Set FD_CLOEXEC on file
descriptors that don't need to be passed to children to stop this misbehaviour.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
linux-user build on fedora 11 breaks because fallocate
is broken on that system if -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
are specified, which is what QEMU uses.
We do have a configure check to catch this and disable fallocate,
however, it turns out that default QEMU_CFLAGS/LDFLAGS were assigned in
script *after* all compiler checks: so during checks we were not running
compiler with same flags that we used for build later.
Fix this by moving QEMU_CFLAGS to before compiler checks, and using
comple_prog when checking for fallocate. This also fixes the fact that
we do some compiler checks while assigning the flags, right below a
comment that says "no cc tests beyond this point".
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Based on a patch from Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>
A few words about design choices:
* Two registers, at and t0, are reserved for TCG internal use. They are
useful for bswap and 64-bit ops.
* Most ops supports a constant argument with value 0, which is actually
mapped to the zero register.
* While the at register is available for constant loading, ops only
support a limited range of constants. TCG does a better job doing the
register allocation and constant loading by itself. There are plenty of
registers available anyway.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Add makefile dependencies for target specific device configs.
These will copy the default config if none exists, obsoleting the old
configure time code. If a config already exists but is older than the
default then print a warning.
Also remove config-devices.h. Code does not and should not care which
devices are being built.
Signed-off-by: Paul Brook <paul@codesourcery.com>