sim-card
/
qemu
Archived
10
0
Fork 0
Commit Graph

15354 Commits

Author SHA1 Message Date
Blue Swirl ac0275dcfe TCG/x86: use stack for TCG temps
Use stack instead of temp_buf array in CPUState for TCG
temps.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-26 18:25:51 +00:00
Blue Swirl e83c80f718 TCG/x86: use TCG_REG_CALL_STACK instead of TCG_REG_ESP
Except for specific cases where the use of %esp changes the encoding of
the instruction, it's cleaner to use TCG_REG_CALL_STACK instead of
TCG_REG_ESP.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-26 18:25:49 +00:00
Blue Swirl 345649c054 TCG: remove broken stack allocation for call arguments
The code for stack allocation for call arguments is way too simplistic
to actually work on targets with non-trivial stack allocation policies,
e.g. ppc64. We've also already allocated TCG_STATIC_CALL_ARGS_SIZE worth
of stack for calls which should be well more than any helper needs.

Remove broken dynamic stack allocation code and replace it with an assert.
Should dynamic stack allocation ever be needed again, target specific
functions should be added.

Thanks to Richard Henderson for the analysis.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-26 18:25:47 +00:00
Blue Swirl b591dc59bc TCG: fix negative frame offset calculations
size_t is unsigned, so the frame offset calculations can be incorrect for
negative offsets.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-26 18:25:44 +00:00
Blue Swirl 614f104dfd Delegate setup of TCG temporaries to targets
Delegate TCG temp_buf setup to targets, so that they can use a stack
frame later instead.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-26 18:25:43 +00:00
Blue Swirl cea5f9a28f cpu-exec.c: avoid AREG0 use
Make functions take a parameter for CPUState instead of relying
on global env. Pass CPUState pointer to TCG prologue, which moves
it to AREG0.

Thanks to Peter Maydell and Laurent Desnogues for the ARM prologue
change.

Revert the hacks to avoid AREG0 use on Sparc hosts.

Move cpu_has_work() and cpu_pc_from_tb() from exec.h to cpu.h.

Compile the file without HELPER_CFLAGS.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-26 18:25:38 +00:00
Blue Swirl 2b41f10e18 Remove exec-all.h include directives
Most exec-all.h include directives are now useless, remove them.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-26 18:25:35 +00:00
Blue Swirl f081c76ccf Move cpu_has_work and cpu_pc_from_tb to cpu.h
Move functions cpu_has_work() and cpu_pc_from_tb() from exec.h to cpu.h. This is
needed by later patches.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-26 18:25:31 +00:00
Blue Swirl f3e270377a exec.h: fix coding style and change cpu_has_work to return bool
Before the next patch, fix coding style of the areas affected.

Change the type of the return value from cpu_has_work() and
qemu_cpu_has_work() to bool.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-26 18:25:26 +00:00
Blue Swirl d8108fb187 cpu-exec: unify do_interrupt call
Now that all targets use common function signature for do_interrupt(), there is no
need for the #ifdeffery anymore.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-26 18:25:24 +00:00
Blue Swirl 3c688828bc m68k: use caller supplied CPUState for interrupt related stuff
Pass CPUState to do_interrupt(). This is needed by later patches.

It would be cleaner to move the function to helper.c, but there are
a few dependencies between do_interrupt() and other functions.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-26 18:25:21 +00:00
Blue Swirl e694d4e289 x86: use caller supplied CPUState for interrupt related stuff
Several x86 specific functions are called from cpu-exec.c with the
assumption that global env register is valid. This will be changed
later, so make the functions use caller supplied CPUState parameter.

It would be cleaner to move the functions to helper.c, but there are
quite a lot of dependencies between do_interrupt() and other functions.

Add helpers for svm_check_intercept() and cpu_cc_compute_all() instead
of calling the helper (which uses global env, AREG0) directly.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-26 18:25:19 +00:00
Blue Swirl e67768d0f1 sparc: move do_interrupt to helper.c
do_interrupt() was mixing CPUState pointer passed from caller
and global env (AREG0).

Fix by moving the function to helper.c. Introduce a helper for calling
change_pstate() safely from outside of execution context.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-26 18:25:17 +00:00
Blue Swirl fa3c9559db sparc: fix coding style of the area to be moved
Before the next patch, fix coding style of the areas affected.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-26 18:25:15 +00:00
Blue Swirl 1162c041c1 cpu_loop_exit: avoid using AREG0
Make cpu_loop_exit() take a parameter for CPUState instead of relying
on global env.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-26 18:25:13 +00:00
Blue Swirl 4d2c2b77f3 Sparc32: dummy implementation of MXCC MMU breakpoint registers
Add dummy registers for SuperSPARC MXCC MMU counter breakpoints, save
and load all MXCC registers.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-26 18:25:09 +00:00
Jan Kiszka af2be20777 Fix fallouts from Linux header inclusion
This is an all-in-one fix for the smaller and bigger mistakes of the
build system changes for accompanied Linux headers:
 - only enable KVM and vhost on Linux hosts
 - fix powerpc asm header symlink
 - do not use Linux headers on non-Linux hosts
 - fix kvmclock for !CONFIG_KVM
 - fix s390 build on non-Linux hosts

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Tested-by: Andreas Färber <andreas.faerber@web.de>
Tested-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-26 17:35:47 +00:00
Marc-Antoine Perennou 20fa53ece4 qemu-kvm: fix pulseaudio detection in configure
pulse/simple.h does not include stdlib.h
We cannot use NULL since it may not be defined
Use 0 instead

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-24 15:36:14 +01:00
Juan Quintela 4429ab4419 exec: last_first_tb was only used in !ONLY_USER case
Once there, use a better variable name.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-24 15:34:52 +01:00
Stefan Weil 6a33e7b609 w32: Remove redundant definitions of PRI*64
The PRI*64 macros are defined in MinGW's inttypes.h since 2002,
so they are not needed in qemu-common.h (which includes inttypes.h).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-24 11:25:16 +01:00
Jan Kiszka 0ff0fc19cd Do not include compatfd for WIN32
sigset_t, used by that header, is not available in mingw32 environments.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-24 09:13:37 +01:00
Matthew Fernandez 2167f7bc28 Fix comment typos in hw/armv7m.c
Fix a couple of typos in comments.

Signed-off-by: Matthew Fernandez <matthew.fernandez@gmail.com>
Acked-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-24 09:13:37 +01:00
Peter Maydell d6eec7a2bf MAINTAINERS: Fix typo in email address
Fix a typo in one of the copies of Aurelien Jarno's email address.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-24 09:13:37 +01:00
Markus Armbruster e4080f9bec blockdev: Put space after comma in error message
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-24 09:13:37 +01:00
Markus Armbruster dd3d677512 Spell "unkown" correctly in error_report() arguments
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-24 09:13:37 +01:00
Markus Armbruster 9d42e15dc9 qemu-img: Don't prepend qemu-img to error messages twice.
error_report() prepends the location already.  Example:

$ qemu-img convert -6
qemu-img: qemu-img: option -6 is deprecated, please use '-o compat6' instead!

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-24 09:13:37 +01:00
Markus Armbruster 6daf194dde Strip trailing '\n' from error_report()'s first argument
error_report() prepends location, and appends a newline.  The message
constructed from the arguments should not contain a newline.  Fix the
obvious offenders.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-24 09:13:36 +01:00
Markus Armbruster db78ef5b0a sheepdog: qemu_bh_new() can't return null pointer, drop check
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-24 09:13:36 +01:00
Jan Kiszka 1802651cb5 Align dummy display to fixed-size active console
This fixes e.g. '-vga none -monitor vc:120Cx50C'.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-24 09:13:36 +01:00
Peter Maydell f9245e100f configure: Don't create symlinks to nonexistent targets
When we create the symlinks to source tree files, don't create them
if the file is not actually present in the source tree; this will
happen if the file is in a git submodule that wasn't checked out.

This also avoids the odd effect where an in-source-tree configure
will end up creating the missing file as a symlink to itself.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-24 09:13:36 +01:00
Gerd Hoffmann a7fb71d1b2 usb: ignore USB_DT_DEBUG
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23 17:15:55 +02:00
Markus Armbruster c3a90cb120 usb-storage: Turn drive serial into a qdev property usb-storage.serial
It needs to be a qdev property, because it belongs to the drive's
guest part.  Precedence: commit a0fef654 and 6ced55a5.

Bonus: info qtree now shows the serial number.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23 17:09:31 +02:00
Andreas Färber 744d364418 coreaudio: Fix OSStatus format specifier
OSStatus type is defined as SInt32. That's signed int on __LP64__ and
signed long otherwise.
Since it is an explicit 32-bit-width type, cast to corresponsing POSIX type
and use PRId32 format specifier. This avoids a warning on ppc64.

Cc: malc <av1474@comtv.ru>
Signed-off-by: Andreas Faerber <andreas.faerber@web.de>
Signed-off-by: malc <av1474@comtv.ru>
2011-06-23 18:56:58 +04:00
Andreas Färber cbc36cb05d coreaudio: Avoid formatting UInt32 type
coreaudioVoiceOut's audioDevicePropertyBufferFrameSize is defined as UInt32
and is being used by reference for AudioDevice{Get,Set}Property().
UInt32 is unsigned int on __LP64__ but unsigned long otherwise.

Cast to POSIX type and use PRIu32 format specifier to hide the details.
This avoids a warning on ppc64.

Cc: malc <av1474@comtv.ru>
Signed-off-by: Andreas Faerber <andreas.faerber@web.de>
Signed-off-by: malc <av1474@comtv.ru>
2011-06-23 18:56:50 +04:00
Peter Maydell f3dc0051dc hw/usb-ohci.c: Fix handling of remote wakeup corner cases
Correct a number of minor errors in the OHCI wakeup implementation:
 * when the port is suspended but the controller is not, raise RHSC
 * when the controller is suspended but the port is not, raise RD
 * when the controller is suspended, move it to resume state

These fix some edge cases where a USB device might not successfully get
the attention of the guest OS if it tried to do so at the wrong time.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23 11:28:07 +02:00
Hans de Goede bf5547f536 usb-bus: Don't allow speed mismatch while attaching devices
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23 11:28:07 +02:00
Hans de Goede e4b1776765 usb-linux: allow "compatible" high speed devices to connect at fullspeed
Some usb2 highspeed devices, like usb-msd devices, work fine when redirected
to a usb1 virtual controller. Allow this to avoid the new speedhecks causing
regressions for users who do not enable the new experimental ehci code.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23 11:28:06 +02:00
Hans de Goede ba3f9bfba9 usb: Add a speedmask to devices
This is used to indicate at which speed[s] the device can operate,
so that this can be checked to match the ports capabilities when it gets
attached to a bus.

Note that currently all usb1 emulated device claim to be fullspeed, this
seems to not cause any problems, but still seems wrong, because with real
hardware keyboards, mice and tablets usually are lo-speed, so reporting these
as fullspeed devices seems wrong.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23 11:28:06 +02:00
Hans de Goede fa19bf831b usb: Proper error propagation for usb_device_attach errors
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23 11:28:06 +02:00
Hans de Goede ee210d6390 usb-bus: Don't allow attaching a device to a bus with no free ports
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23 11:28:06 +02:00
Gerd Hoffmann adddecb169 ehci: switch to nanoseconds
Make ehci use nanoseconds everywhere.
Simplifies time calculations.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23 11:28:06 +02:00
Gerd Hoffmann 16a2dee6b9 ehci: add freq + maxframes properties
Add properties for the wakeup rate and the max number of frames ehci
will process at once.

The wakeup rate defaults to 1000 which equals the usb frame rate.  This
can be reduced to make qemu wake up less often when ehci is active.

In case the wakeup rate is reduced or the ehci timer is delayed due to
latency issues elsewhere in qemu ehci will process multiple frames at
once.  The maxframes property specifies the upper limit for this.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23 11:28:06 +02:00
Gerd Hoffmann 8288726256 usb-linux: track inflight iso urb count
Track the number of iso urbs which are currently in flight.
Log a message in case the count goes down to zero.  Also
warn in case many urbs are returned at the same time.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23 10:18:37 +02:00
Gerd Hoffmann b81bcd8aa0 usb-linux: make iso urb count contigurable
Add a qdev property for the number of iso urbs which
usb-linux keeps in flight, so it can be configured at
runtime.  Make it default to four (old hardcoded value
used to be three).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23 10:18:37 +02:00
Gerd Hoffmann ca3a36cf2b usb-linux: add get_endp()
Add a helper function to get the endpoint data structure
and put it into use.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23 10:18:37 +02:00
Sebastian Huber 82845826e8 target-arm: Fix BASEPRI, BASEPRI_MAX, and FAULTMASK access
Correct the decode of the register numbers for BASEPRI, BASEPRI_MAX
and FAULTMASK, according to "ARMv7-M Architecture Reference Manual"
issue D section "B5.2.3 MRS" and "B5.2.3 MSR".

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2011-06-22 15:02:42 +00:00
Peter Maydell 74594c9d81 target-arm: Minimal implementation of performance counters
Newer Linux kernels assume the existence of the performance counter
cp15 registers. Provide a minimal implementation of these registers.
We support no events. This should be compliant with the ARM ARM,
except that we don't implement the cycle counter.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2011-06-22 15:02:08 +00:00
Peter Maydell b501b5e461 Revert "Makefile.target: Allow target helpers to be in any *_helper.c file"
Reverts commit 348883d482, so the
global env is no longer available to helper.c files other than
op_helper.c.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2011-06-22 15:01:46 +00:00
Peter Maydell 02da0b2d71 Revert "target-arm: Use global env in neon_helper.c helpers"
This effectively reverts commit 2a3f75b42a
so that we return to passing CPUState to helpers as an explicit parameter.
(There were a number of conflicts in target-arm/translate.c which had
to be resolved by hand so it is not a pure revert.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2011-06-22 15:01:41 +00:00
Peter Maydell aa47cfdd17 target-arm: Pass fp status pointer explicitly to neon fp helpers
Make the Neon helpers for various floating point operations take an
explicit pointer to the float_status they use, so they don't rely on
the global environment pointer any more. This also allows us to drop
the mul/sub/add helpers completely and just use the vfp versions.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2011-06-22 15:01:36 +00:00