sdk/emulator/qemu.git
14 years agoMerge remote branch 'qmp/for-anthony' into staging
Anthony Liguori [Tue, 6 Jul 2010 13:31:17 +0000 (08:31 -0500)]
Merge remote branch 'qmp/for-anthony' into staging

14 years agocris: Avoid debug clobbering for both I & D MMU state.
Edgar E. Iglesias [Mon, 5 Jul 2010 09:39:04 +0000 (11:39 +0200)]
cris: Avoid debug clobbering for both I & D MMU state.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@axis.com>
14 years agocris: Dont clobber the MMU state across calls to cpu_get_phys_page_debug.
Edgar E. Iglesias [Mon, 5 Jul 2010 08:24:56 +0000 (10:24 +0200)]
cris: Dont clobber the MMU state across calls to cpu_get_phys_page_debug.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
14 years agocris: Break out rand LFSR update into a separate func.
Edgar E. Iglesias [Mon, 5 Jul 2010 08:15:10 +0000 (10:15 +0200)]
cris: Break out rand LFSR update into a separate func.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@axis.com>
14 years agopiix4: compile only once
Blue Swirl [Sat, 3 Jul 2010 06:49:47 +0000 (06:49 +0000)]
piix4: compile only once

Compile piix4 in hwlib. Two compilations less for the full build.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoremove exec-all.h inclusion from cpu.h
Paolo Bonzini [Tue, 29 Jun 2010 07:58:51 +0000 (09:58 +0200)]
remove exec-all.h inclusion from cpu.h

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agomove cpu_pc_from_tb to target-*/exec.h
Paolo Bonzini [Tue, 29 Jun 2010 07:58:50 +0000 (09:58 +0200)]
move cpu_pc_from_tb to target-*/exec.h

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoremove unused stuff from */exec.h
Paolo Bonzini [Tue, 29 Jun 2010 07:58:49 +0000 (09:58 +0200)]
remove unused stuff from */exec.h

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoDon't declare XSAVE as supported
Andi Kleen [Sat, 26 Jun 2010 20:54:21 +0000 (22:54 +0200)]
Don't declare XSAVE as supported

i386 cpuid.c currently claims XSAVE is supported in the CPUID filter,
but that's not true: Only FXSAVE is supported. Remove that bit
from the filter.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoAdd more boundary checking to sse3/4 parsing
Andi Kleen [Sat, 26 Jun 2010 22:06:11 +0000 (00:06 +0200)]
Add more boundary checking to sse3/4 parsing

ssse3 uses tables with only two entries per op, but it is indexed
with b1 which can contain variables upto 3. This happens when ssse3
or sse4 are used with REP* prefixes.

Add boundary checking for this case.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-arm : fix parallel saturated subtraction implementation
Chih-Min Chao [Mon, 28 Jun 2010 15:54:06 +0000 (23:54 +0800)]
target-arm : fix parallel saturated subtraction implementation

Signed-off-by: Chih-Min Chao <cmchao@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-arm : fix thumb2 parallel add/sub opcode decoding
Chih-Min Chao [Mon, 28 Jun 2010 15:54:05 +0000 (23:54 +0800)]
target-arm : fix thumb2 parallel add/sub opcode decoding

Signed-off-by: Chih-Min Chao <cmchao@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-arm: fix addsub/subadd implementation
Chih-Min Chao [Mon, 28 Jun 2010 15:54:04 +0000 (23:54 +0800)]
target-arm: fix addsub/subadd implementation

Signed-off-by: Chih-Min Chao <cmchao@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoMakefile: add qemu-options.def to distclean
Hidetoshi Seto [Thu, 1 Jul 2010 03:32:32 +0000 (12:32 +0900)]
Makefile: add qemu-options.def to distclean

Remove generated qemu-options.def at "make distclean".

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoAdd QMP/qmp-commands.txt to .gitignore
Hidetoshi Seto [Thu, 1 Jul 2010 03:30:23 +0000 (12:30 +0900)]
Add QMP/qmp-commands.txt to .gitignore

QMP/qmp-commands.txt is a generated file.

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-i386: fix xchg rax,r8
Richard Henderson [Thu, 1 Jul 2010 16:42:21 +0000 (09:42 -0700)]
target-i386: fix xchg rax,r8

We were ignoring REX_B while special-casing NOP, i.e. xchg eax,eax.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-mips: add Loongson support prefetch
Aurelien Jarno [Thu, 1 Jul 2010 21:43:34 +0000 (23:43 +0200)]
target-mips: add Loongson support prefetch

Loongson CPU uses a load to zero register for prefetch.
Emulate it as a NOP.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agomonitor: Allow to exclude commands from QMP
Jan Kiszka [Mon, 28 Jun 2010 16:27:47 +0000 (18:27 +0200)]
monitor: Allow to exclude commands from QMP

Ported commands that are marked 'user_only' will not be considered for
QMP monitor sessions. This allows to implement new commands that do not
(yet) provide a sufficiently stable interface for QMP use.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agoQMP: handle_qmp_command(): Small cleanup
Luiz Capitulino [Thu, 24 Jun 2010 20:58:20 +0000 (17:58 -0300)]
QMP: handle_qmp_command(): Small cleanup

Drop a unneeded label and QDECREF() call.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agoQMP: Drop old input object checking
Luiz Capitulino [Mon, 31 May 2010 20:32:50 +0000 (17:32 -0300)]
QMP: Drop old input object checking

Previous commit added qmp_check_input_obj(), it does all the
checking we need.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agoQMP: Introduce qmp_check_input_obj()
Luiz Capitulino [Mon, 31 May 2010 20:28:01 +0000 (17:28 -0300)]
QMP: Introduce qmp_check_input_obj()

This is similar to qmp_check_client_args(), but it checks if
the input object follows the specification (QMP/qmp-spec.txt
section 2.3).

As we're limited to three keys, the work here is quite simple:
we iterate over the input object, checking each time if the
current argument complies to the specification.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agoQError: Introduce QERR_QMP_EXTRA_MEMBER
Luiz Capitulino [Tue, 1 Jun 2010 19:15:23 +0000 (16:15 -0300)]
QError: Introduce QERR_QMP_EXTRA_MEMBER

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agoQMP: Drop old client argument checker
Luiz Capitulino [Fri, 28 May 2010 20:24:49 +0000 (17:24 -0300)]
QMP: Drop old client argument checker

Previous two commits added qmp_check_client_args(), which
fully replaces this code and is way better.

It's important to note that the new checker doesn't support
the '/' arg type. As we don't have any of those handlers
converted to QMP, this is just dead code.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agoQMP: New argument checker (second part)
Luiz Capitulino [Tue, 22 Jun 2010 14:44:05 +0000 (11:44 -0300)]
QMP: New argument checker (second part)

This commit introduces the second (and last) part of QMP's new
argument checker.

The job is done by check_client_args_type(), it iterates over
the client's argument qdict and for for each argument it checks
if it exists and if its type is valid.

It's important to observe the following changes from the existing
argument checker:

  - If the handler accepts an O-type argument, unknown arguments
    are passed down to it. It's up to O-type handlers to validate
    their arguments

  - Boolean types (eg. 'b' and '-') don't accept integers anymore,
    only json-bool

  - Argument types '/' and '.' are currently unsupported under QMP,
    thus they're not handled

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agoQMP: New argument checker (first part)
Luiz Capitulino [Wed, 26 May 2010 19:13:09 +0000 (16:13 -0300)]
QMP: New argument checker (first part)

Current QMP's argument checker is more complex than it should be
and has (at least) one serious bug: it ignores unknown arguments.

To solve both problems we introduce a new argument checker. It's
added on top of the existing one, so that there are no regressions
during the transition.

This commit introduces the first part of the new checker, which
is run by qmp_check_client_args() and does the following:

  1. Check if all mandatory arguments were provided
  2. Set flags for argument validation

In order to do that, we transform the args_type string (from
qemu-montor.hx) into a qdict and iterate over it.

Next commit adds the new checker's second part: type checking and
invalid argument detection.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agoMonitor: handle optional '-' arg as a bool
Luiz Capitulino [Fri, 28 May 2010 18:25:24 +0000 (15:25 -0300)]
Monitor: handle optional '-' arg as a bool

Historically, user monitor arguments beginning with '-' (eg. '-f')
were passed as integers down to handlers.

I've maintained this behavior in the new monitor because we didn't
have a boolean type at the very beginning of QMP. Today we have it
and this behavior is causing trouble to QMP's argument checker.

This commit fixes the problem by doing the following changes:

1. User Monitor

   Before: the optional arg was represented as a QInt, we'd pass 1
           down to handlers if the user specified the argument or
           0 otherwise

   This commit: the optional arg is represented as a QBool, we pass
                true down to handlers if the user specified the
                argument, otherwise _nothing_ is passed

2. QMP

   Before: the client was required to pass the arg as QBool, but we'd
           convert it to QInt internally. If the argument wasn't passed,
           we'd pass 0 down

   This commit: still require a QBool, but doesn't do any conversion and
                doesn't pass any default value

3. Convert existing handlers (do_eject()/do_migrate()) to the new way

   Before: Both handlers would expect a QInt value, either 0 or 1

   This commit: Change the handlers to accept a QBool, they handle the
                following cases:

                   A) true is passed: the option is enabled
                   B) false is passed: the option is disabled
                   C) nothing is passed: option not specified, use
                                         default behavior

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agoQDict: Introduce qdict_get_try_bool()
Luiz Capitulino [Mon, 7 Jun 2010 20:25:04 +0000 (17:25 -0300)]
QDict: Introduce qdict_get_try_bool()

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agocheck-qdict: Introduce test for the new iteration API
Luiz Capitulino [Mon, 7 Jun 2010 18:29:58 +0000 (15:29 -0300)]
check-qdict: Introduce test for the new iteration API

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agoQDict: Introduce new iteration API
Luiz Capitulino [Mon, 7 Jun 2010 19:07:29 +0000 (16:07 -0300)]
QDict: Introduce new iteration API

It's composed of functions qdict_first() and qdict_next(), plus
functions to access QDictEntry values.

This API was suggested by Markus Armbruster <armbru@redhat.com> and
it offers full control over the iteration process.

The usage is simple, the following example prints all keys in 'qdict'
(it's hopefully better than any English description):

   QDict *qdict;
   const QDictEntry *ent;

   [...]

   for (ent = qdict_first(qdict); ent; ent = qdict_next(qdict, ent)) {
        printf("%s ", qdict_entry_key(ent));
    }

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agoQDict: Introduce functions to retrieve QDictEntry values
Luiz Capitulino [Mon, 7 Jun 2010 19:53:51 +0000 (16:53 -0300)]
QDict: Introduce functions to retrieve QDictEntry values

Next commit will introduce a new QDict iteration API which
returns QDictEntry entries, but we don't want users to directly
access its members since QDictEntry should be private to QDict.

In the near future this kind of data type will be turned into a
forward reference.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agoQDict: Small terminology change
Luiz Capitulino [Mon, 7 Jun 2010 18:45:22 +0000 (15:45 -0300)]
QDict: Small terminology change

Let's call a 'hash' only what is returned by our hash function,
anything else is a 'bucket'.

This helps avoiding confusion with regard to how we traverse
our table.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agoQDict: Rename 'err_value'
Luiz Capitulino [Fri, 4 Jun 2010 22:20:54 +0000 (19:20 -0300)]
QDict: Rename 'err_value'

A missing key is not an error.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agoQError: Enhance QERR_DEVICE_NOT_ACTIVE's user desc
Luiz Capitulino [Wed, 23 Jun 2010 15:37:47 +0000 (12:37 -0300)]
QError: Enhance QERR_DEVICE_NOT_ACTIVE's user desc

The 'by the guest' part is misleading, it could be disabled by
the host too.

We will likely need more surgery if we care for the distinction,
just dropping the problematic part is good enough for now.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agoQMP: Fix error reporting in the async API
Luiz Capitulino [Tue, 22 Jun 2010 22:10:46 +0000 (19:10 -0300)]
QMP: Fix error reporting in the async API

The current asynchronous command API doesn't return a QMP response
when the async command fails.

This is easy to reproduce with the balloon command (the sole async
command we have so far): run qemu w/o the '-balloon virtio' option
and try to issue the balloon command via QMP: no response will be
sent to the client.

This commit fixes the problem by making qmp_async_cmd_handler()
return the handler's error code and then calling
monitor_protocol_emitter() if the handler has returned an error.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agonet: delete QemuOpts when net_client_init() fails.
Yoshiaki Tamura [Mon, 21 Jun 2010 01:41:36 +0000 (10:41 +0900)]
net: delete QemuOpts when net_client_init() fails.

This fixes the following scenario using QMP.

First, put a bogus argument "foo" to "type", which results in an error.
{"execute": "netdev_add", "arguments": { "type": "foo", "id": "netdev1" } }
Then, call it again with correct argument "user".
{"execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } }
This results in "DuplicatedId" error.

Because the first command was invalid, it should be able to reuse the
same "id", and the second command should work.

Reported-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agoQMP: Fix python helper /wrt long return strings
Jan Kiszka [Tue, 15 Jun 2010 22:38:46 +0000 (00:38 +0200)]
QMP: Fix python helper /wrt long return strings

Remove the arbitrary limitation of 1024 characters per return string and
read complete lines instead. Required for device_show.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agoQMP: Teach basic capability negotiation to python example
Jan Kiszka [Tue, 15 Jun 2010 22:38:45 +0000 (00:38 +0200)]
QMP: Teach basic capability negotiation to python example

As sending "qmp_capabilities" on session start became mandatory, both
python examples were broken.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agomonitor: Establish cmd flags and convert the async tag
Jan Kiszka [Tue, 15 Jun 2010 22:38:39 +0000 (00:38 +0200)]
monitor: Establish cmd flags and convert the async tag

As we want to add more flags to monitor commands, convert the only so
far existing one accordingly.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agomonitor: Fix command completion vs. boolean switches
Jan Kiszka [Tue, 15 Jun 2010 22:38:34 +0000 (00:38 +0200)]
monitor: Fix command completion vs. boolean switches

We now have to move forward to the next argument type via next_arg_type.
This patch fixes completion for 'eject' and maybe also other commands.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agomonitor: Fix leakage during completion processing
Jan Kiszka [Tue, 15 Jun 2010 22:38:33 +0000 (00:38 +0200)]
monitor: Fix leakage during completion processing

Given too many arguments or an invalid command, we were leaking the
duplicated argument strings.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agotarget-mips: split load and store
Aurelien Jarno [Thu, 1 Jul 2010 05:47:00 +0000 (07:47 +0200)]
target-mips: split load and store

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoqdev-properties: Fix (u)intXX parsers
Kevin Wolf [Fri, 18 Jun 2010 16:27:03 +0000 (18:27 +0200)]
qdev-properties: Fix (u)intXX parsers

scanf calls must not use PRI constants, they have probably the wrong size and
corrupt memory. We could replace them by SCN ones, but strtol is simpler than
scanf here anyway. While at it, also fix the parsers to reject garbage after
the number ("4096xyz" was accepted before).

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Richard Henderson <rth@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoReturn usb device to host on exit
Shahar Havivi [Wed, 16 Jun 2010 12:16:11 +0000 (15:16 +0300)]
Return usb device to host on exit

Signed-off-by: Shahar Havivi <shaharh@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoReturn usb device to host on usb_del command
Shahar Havivi [Wed, 16 Jun 2010 12:15:37 +0000 (15:15 +0300)]
Return usb device to host on usb_del command

Signed-off-by: Shahar Havivi <shaharh@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agonet: Fix VM start with '-net none'
Amit Shah [Tue, 15 Jun 2010 08:00:39 +0000 (13:30 +0530)]
net: Fix VM start with '-net none'

Commit 50e32ea8f31035877decc10f1075aa0e619e09cb changed the behaviour
for the return type of net_client_init() when a nic type with no init
method was specified. 'none' is one such nic type. Instead of returning
0, which gets interpreted as an index into the nd_table[] array, we
switched to returning -1, which signifies an error as well.

That broke VM start with '-net none'. Testing was only done with the
monitor command 'pci_add', which doesn't fail.

The correct fix would still be to return 0+ values from
net_client_init() only when the return value can be used as an index to
refer to an entry in nd_table[]. With the current code, callers can
erroneously poke into nd_table[0] when -net nic is used, which can lead
to badness.

However, this commit just returns to the previous behaviour before the
offending commit.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agox86: svm: Always clear event_inj on vmexit
Jan Kiszka [Wed, 2 Jun 2010 06:49:14 +0000 (08:49 +0200)]
x86: svm: Always clear event_inj on vmexit

We currently only clear SVM_EVTINJ_VALID after successful interrupt
delivery. This apparently does not match real hardware which clears the
whole event_inj field on every vmexit, including unsuccessful interrupt
delivery.

Reported-by: Erik van der Kouwe <vdkouwe@cs.vu.nl>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agousb-uhci: fix commit 8e65b7c04965c8355e4ce43211582b6b83054e3d for vmstate
TeLeMan [Tue, 1 Jun 2010 04:26:20 +0000 (12:26 +0800)]
usb-uhci: fix commit 8e65b7c04965c8355e4ce43211582b6b83054e3d for vmstate

The commit 8e65b7c04965c8355e4ce43211582b6b83054e3d introduced
expire_time of UHCIState. But expire_time is not in vmstate, the
second uhci_frame_timer will not be fired immediately after loadvm.

Signed-off-by: TeLeMan <geleman@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agohw/omap : make local function static and remove declaration from header
cmchao [Mon, 31 May 2010 15:54:24 +0000 (23:54 +0800)]
hw/omap : make local function static and remove declaration from header

Signed-off-by: cmchao <cmchao@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agohw/omap1.c : separate uart module
cmchao [Mon, 31 May 2010 15:54:23 +0000 (23:54 +0800)]
hw/omap1.c : separate uart module

Signed-off-by: cmchao <cmchao@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agohw/omwp2.c : separate l4 interconnect module
cmchao [Mon, 31 May 2010 15:54:22 +0000 (23:54 +0800)]
hw/omwp2.c : separate l4 interconnect module

Signed-off-by: cmchao <cmchao@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agohw/omap2.c : separate tap module(Test-Chip-level)
cmchao [Mon, 31 May 2010 15:54:21 +0000 (23:54 +0800)]
hw/omap2.c : separate tap module(Test-Chip-level)

Signed-off-by: cmchao <cmchao@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agohw/omap2.c : separate spi module
cmchao [Mon, 31 May 2010 15:54:20 +0000 (23:54 +0800)]
hw/omap2.c : separate spi module

Signed-off-by: cmchao <cmchao@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agohw/omap1.c : separate interrupt controller module
cmchao [Mon, 31 May 2010 15:54:19 +0000 (23:54 +0800)]
hw/omap1.c : separate interrupt controller module

Signed-off-by: cmchao <cmchao@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agohw/omap2.c : separate sdrc (sdram controller)
cmchao [Mon, 31 May 2010 15:54:18 +0000 (23:54 +0800)]
hw/omap2.c : separate sdrc (sdram controller)

Signed-off-by: cmchao <cmchao@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agohw/omap2.c : separate gpmc(general purpose memory controller)
cmchao [Mon, 31 May 2010 15:54:17 +0000 (23:54 +0800)]
hw/omap2.c : separate gpmc(general purpose memory controller)

Signed-off-by: cmchao <cmchao@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agohw/omap2.c : separate synctimer module
cmchao [Mon, 31 May 2010 15:54:16 +0000 (23:54 +0800)]
hw/omap2.c : separate synctimer module

Signed-off-by: cmchao <cmchao@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agohw/omap2.c : separate gptimer module
cmchao [Mon, 31 May 2010 15:54:15 +0000 (23:54 +0800)]
hw/omap2.c : separate gptimer module

Signed-off-by: cmchao <cmchao@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agohw/omap2.c : separate gpio module
cmchao [Mon, 31 May 2010 15:54:14 +0000 (23:54 +0800)]
hw/omap2.c : separate gpio module

Signed-off-by: cmchao <cmchao@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agohw/omap1.c : separate gpio module
cmchao [Mon, 31 May 2010 15:54:13 +0000 (23:54 +0800)]
hw/omap1.c : separate gpio module

Signed-off-by: cmchao <cmchao@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agovirtio-serial: Simplify virtio_serial_load()
Markus Armbruster [Mon, 31 May 2010 14:19:43 +0000 (16:19 +0200)]
virtio-serial: Simplify virtio_serial_load()

For all i, ports_map[i] is used in and only in the i-th iteration.
Replace the dynamic array by a scalar variable.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agousb-serial: Fail instead of crash when chardev is missing
Markus Armbruster [Fri, 28 May 2010 15:03:22 +0000 (17:03 +0200)]
usb-serial: Fail instead of crash when chardev is missing

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoA bit optimization for tlb_set_page()
Jun Koi [Thu, 6 May 2010 05:36:59 +0000 (14:36 +0900)]
A bit optimization for tlb_set_page()

This patch avoids handling write watchpoints on read-only memory access.
It also breaks the searching loop for watchpoint once the setup for
handling watchpoint later is done.

Signed-off-by: Jun Koi <junkoi2004@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-mips: fix DINSU instruction
Aurelien Jarno [Wed, 30 Jun 2010 18:00:31 +0000 (20:00 +0200)]
target-mips: fix DINSU instruction

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoMIPS: fix fulong bios loading
Aurelien Jarno [Wed, 30 Jun 2010 17:39:45 +0000 (19:39 +0200)]
MIPS: fix fulong bios loading

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-mips: enable movn/movz on loongson 2E & 2F
Aurelien Jarno [Sat, 19 Jun 2010 09:11:10 +0000 (11:11 +0200)]
target-mips: enable movn/movz on loongson 2E & 2F

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agomips-dis: add support for Godson integer instructions
Aurelien Jarno [Mon, 21 Jun 2010 10:01:39 +0000 (12:01 +0200)]
mips-dis: add support for Godson integer instructions

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agor2d: fix pflash mapping
Aurelien Jarno [Thu, 17 Jun 2010 20:19:53 +0000 (22:19 +0200)]
r2d: fix pflash mapping

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agolsi53c895a: fix Phase Mismatch Jump
Paolo Bonzini [Mon, 14 Jun 2010 17:11:54 +0000 (19:11 +0200)]
lsi53c895a: fix Phase Mismatch Jump

lsi_bad_phase has a bug in the choice of pmjad1/pmjad2.  This does
not matter with Linux guests because it uses just one routine for
both, but it breaks Windows 64-bit guests.  This is the text
from the spec:

   "[The PMJCTL] bit controls which decision mechanism is used
   when jumping on phase mismatch. When this bit is cleared the
   LSI53C895A will use Phase Mismatch Jump Address 1 (PMJAD1) when
   the WSR bit is cleared and Phase Mismatch Jump Address 2 (PMJAD2)
   when the WSR bit is set.  When this bit is set the LSI53C895A will
   use jump address one (PMJAD1) on data out (data out, command,
   message out) transfers and jump address two (PMJAD2) on data in
   (data in, status, message in) transfers."

Which means:

    CCNTL0.PMJCTL
        0              SCNTL2.WSR = 0             PMJAD1
        0              SCNTL2.WSR = 1             PMJAD2
        1                    out                  PMJAD1
        1                    in                   PMJAD2

In qemu, what you get instead is:

    CCNTL0.PMJCTL
        0                    out                  PMJAD1
        0                    in                   PMJAD2    <<<<<
        1                    out                  PMJAD1
        1                    in                   PMJAD1    <<<<<

Considering that qemu always has SCNTL2.WSR cleared, the two marked cases
(corresponding to phase mismatch on input) are always jumping to the
wrong PMJAD register.  The patch implements the correct semantics.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoMIPS: Initial support of fulong mini pc (machine construction)
Huacai Chen [Tue, 29 Jun 2010 02:50:43 +0000 (10:50 +0800)]
MIPS: Initial support of fulong mini pc (machine construction)

Signed-off-by: Huacai Chen <zltjiangshi@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoMIPS: Initial support of fulong mini pc (CPU definition)
Huacai Chen [Tue, 29 Jun 2010 02:50:27 +0000 (10:50 +0800)]
MIPS: Initial support of fulong mini pc (CPU definition)

Signed-off-by: Huacai Chen <zltjiangshi@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoMIPS: Initial support of VIA USB controller used by fulong mini pc
Huacai Chen [Tue, 29 Jun 2010 02:50:09 +0000 (10:50 +0800)]
MIPS: Initial support of VIA USB controller used by fulong mini pc

Signed-off-by: Huacai Chen <zltjiangshi@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoMIPS: Initial support of VIA IDE controller used by fulong mini pc
Huacai Chen [Tue, 29 Jun 2010 02:49:50 +0000 (10:49 +0800)]
MIPS: Initial support of VIA IDE controller used by fulong mini pc

Signed-off-by: Huacai Chen <zltjiangshi@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoInitial support of vt82686b south bridge used by fulong mini pc
Huacai Chen [Tue, 29 Jun 2010 02:49:29 +0000 (10:49 +0800)]
Initial support of vt82686b south bridge used by fulong mini pc

Signed-off-by: Huacai Chen <zltjiangshi@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoMIPS: Initial support of bonito north bridge used by fulong mini pc
Huacai Chen [Tue, 29 Jun 2010 02:48:55 +0000 (10:48 +0800)]
MIPS: Initial support of bonito north bridge used by fulong mini pc

Signed-off-by: Huacai Chen <zltjiangshi@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-s390: new TCG Target
Richard Henderson [Tue, 29 Jun 2010 02:15:37 +0000 (19:15 -0700)]
tcg-s390: new TCG Target

Original patch from Ulrich Hecht, further work from Alexander Graf
and Richard Henderson.

Cc: Ulrich Hecht <uli@suse.de>
Cc: Alexander Graf <agraf@suse.de>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-ppc: Conditionally reserve TCG_GUEST_BASE_REG.
Richard Henderson [Thu, 6 May 2010 05:50:45 +0000 (05:50 +0000)]
tcg-ppc: Conditionally reserve TCG_GUEST_BASE_REG.

We need not reserve the register unless we're going to use it.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: malc <av1474@comtv.ru>
14 years agokvm: Fix cpu_is_bsp() compilation warning
Sheng Yang [Thu, 17 Jun 2010 06:17:33 +0000 (14:17 +0800)]
kvm: Fix cpu_is_bsp() compilation warning

Signed-off-by: Sheng Yang <sheng@linux.intel.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
14 years agokvm: init mp_state
Marcelo Tosatti [Tue, 23 Mar 2010 16:37:14 +0000 (13:37 -0300)]
kvm: init mp_state

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
14 years agokvm: Enable XSAVE live migration support
Sheng Yang [Thu, 17 Jun 2010 09:53:07 +0000 (17:53 +0800)]
kvm: Enable XSAVE live migration support

Signed-off-by: Sheng Yang <sheng@linux.intel.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
14 years agoEnable XSAVE related CPUID
Sheng Yang [Thu, 17 Jun 2010 07:18:14 +0000 (15:18 +0800)]
Enable XSAVE related CPUID

We can support it in KVM now. The 0xd leaf is queried from KVM.

Signed-off-by: Sheng Yang <sheng@linux.intel.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
14 years agokvm: Extend kvm_arch_get_supported_cpuid() to support index
Sheng Yang [Thu, 17 Jun 2010 07:18:13 +0000 (15:18 +0800)]
kvm: Extend kvm_arch_get_supported_cpuid() to support index

Would use it later for XSAVE related CPUID.

Signed-off-by: Sheng Yang <sheng@linux.intel.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
14 years agofix CPUID vendor override
Andre Przywara [Wed, 2 Jun 2010 09:57:47 +0000 (11:57 +0200)]
fix CPUID vendor override

the meaning of vendor_override is actually the opposite of how it
is currently used :-(
Fix it to allow KVM to export the non-native CPUID vendor if
explicitly requested by the user.

The intended behavior is:
With TCG:
  - always inject the configured vendor (either hard-coded, in config
    files or via ",vendor=" commandline)
With KVM:
  - by default inject the host's vendor
  - if the user specifies ",vendor=" on the commandline, use this
    instead of the host's vendor
  - all pre-configured vendors (hard-coded, config file) are ignored

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
14 years agokvm: Switch kvm_update_guest_debug to run_on_cpu
Jan Kiszka [Wed, 19 May 2010 22:28:45 +0000 (00:28 +0200)]
kvm: Switch kvm_update_guest_debug to run_on_cpu

Guest debugging under KVM is currently broken once io-threads are
enabled. Easily fixable by switching the fake on_vcpu to the real
run_on_cpu implementation.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
14 years agowin32: Add missing function ffs
Stefan Weil [Sat, 12 Jun 2010 14:07:12 +0000 (16:07 +0200)]
win32: Add missing function ffs

mingw32 does not include function ffs.

Commit c6d29ad6e24533cc3762e1d654275607e1d03058 added a
declaration for ffs, but an implementation was missing.

For compilations with optimization, the compiler creates
inline code, so the implementation is not always needed.

Without optimization, linking fails without this patch.

v2: Use __builtin_ffs as suggested by Richard Henderson

Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agowin32: Add define for missing EPROTONOSUPPORT
Stefan Weil [Thu, 24 Jun 2010 20:41:33 +0000 (22:41 +0200)]
win32: Add define for missing EPROTONOSUPPORT

mingw32 does not define EPROTONOSUPPORT (which is used by
migration.c and maybe future patches), so add a
definition which uses a supported errno value.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years ago.gitignore: Ignore libdis*, qemu-options.def
Stefan Weil [Thu, 24 Jun 2010 20:31:06 +0000 (22:31 +0200)]
.gitignore: Ignore libdis*, qemu-options.def

libdis, libdis-user and qemu-options.def are generated
directories / files and should be ignored by git.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agox86: Clean up CPU reset
Jan Kiszka [Wed, 23 Jun 2010 06:20:54 +0000 (08:20 +0200)]
x86: Clean up CPU reset

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agox86: Fix INIT processing
Jan Kiszka [Wed, 23 Jun 2010 06:19:39 +0000 (08:19 +0200)]
x86: Fix INIT processing

This fixes a regression of 0e26b7b892: Reset halted also on INIT.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agomask all interrupts when MASTER_DISABLE is set
Artyom Tarasenko [Mon, 21 Jun 2010 18:23:21 +0000 (20:23 +0200)]
mask all interrupts when MASTER_DISABLE is set

The MASTER_DISABLE bit (aka mask-all) masks all the interrupts.

According to Sun-4M System Architecture
"The level–15 interrupt sources [...] are maskable with the Interrupt Target
Mask Register. While these interrupts are considered ’non–maskable’ within
the SPARC IU, a mask capability is provided to allow the boot firmware
to establish a basic environment before receiving any level–15 interrupts,
which are non–maskable within SPARC. A mask–all bit is provided to allow
disabling of all external interrupts during change of the CIT."

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agofw_cfg: convert to qdev
Blue Swirl [Sun, 27 Jun 2010 16:04:55 +0000 (16:04 +0000)]
fw_cfg: convert to qdev

Convert fw_cfg to qdev.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoRemove useless device dependency of HAS_AUDIO
Blue Swirl [Sun, 27 Jun 2010 16:04:31 +0000 (16:04 +0000)]
Remove useless device dependency of HAS_AUDIO

System architecture dictates whether HAS_AUDIO is defined. It's then
useless to check for HAS_AUDIO in files which are only used on those
architectures which always have audio.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agovirtio-pci: fix bus master bug setting on load
Alex Williamson [Thu, 17 Jun 2010 15:15:02 +0000 (09:15 -0600)]
virtio-pci: fix bus master bug setting on load

The comment suggests we're checking for the driver in the ready
state and bus master disabled, but the code is checking that it's
not in the ready state.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Found-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoFactorize common migration incoming code
Juan Quintela [Wed, 9 Jun 2010 12:10:55 +0000 (14:10 +0200)]
Factorize common migration incoming code

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoExit if incoming migration fails
Juan Quintela [Wed, 9 Jun 2010 12:10:54 +0000 (14:10 +0200)]
Exit if incoming migration fails

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovirtio-9p: Implement Security model for mksock using mknod.
Venkateswararao Jujjuri (JV) [Mon, 14 Jun 2010 20:34:49 +0000 (13:34 -0700)]
virtio-9p: Implement Security model for mksock using mknod.

This patch uses mknod to create socket.

On Host/Fileserver:
-rw-------. 1 virfsuid virtfsgid 0 2010-05-11 09:57 asocket1

On Guest/Client:
srwxr-xr-x 1 guestuser guestuser 0 2010-05-11 12:57 asocket1

Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovirtio-9p: Implement Security model for mknod
Venkateswararao Jujjuri (JV) [Mon, 14 Jun 2010 20:34:48 +0000 (13:34 -0700)]
virtio-9p: Implement Security model for mknod

Mapped mode stores extended attributes in the user space of the extended
attributes. Given that the user space extended attributes are available
to regular files only, special files are created as regular files on the
fileserver and appropriate mode bits are added to the extended attributes.
This method presents all special files and symlinks as regular files on the
fileserver while they are represented as special files on the guest mount.

On Host/Fileserver:
-rw-------. 1 virfsuid virtfsgid 0 2010-05-11 09:36 afifo
-rw-------. 1 virfsuid virtfsgid 0 2010-05-11 09:32 blkdev
-rw-------. 1 virfsuid virtfsgid 0 2010-05-11 09:33 chardev

On Guest/Client:
prw-r--r-- 1 guestuser guestuser 0 2010-05-11 12:36 afifo
brw-r--r-- 1 guestuser guestuser 0, 0 2010-05-11 12:32 blkdev
crw-r--r-- 1 guestuser guestuser 4, 5 2010-05-11 12:33 chardev

In the passthrough securit model, specifal files are directly created
on the fileserver. But the user credential

Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovirtio-9p: Security model for symlink and readlink
Venkateswararao Jujjuri (JV) [Mon, 14 Jun 2010 20:34:47 +0000 (13:34 -0700)]
virtio-9p: Security model for symlink and readlink

Mapped mode stores extended attributes in the user space of the extended
attributes. Given that the user space extended attributes are available
to regular files only, special files are created as regular files on the
fileserver and appropriate mode bits are added to the extended attributes.
This method presents all special files and symlinks as regular files on the
fileserver while they are represented as special files on the guest mount.

Implemntation of symlink in mapped security model:

A regular file is created and the link target is written to it.
readlink() reads it back from the file.

On Guest/Client:
lrwxrwxrwx 1 root root 6 2010-05-11 12:20 asymlink -> afile

On Host/Fileserver:
-rw-------. 1 root root 6 2010-05-11 09:20 asymlink
afile

Under passthrough model, it just calls underlying symlink() readlink()
system calls are used.

Under both security models, client user credentials are changed
after the filesystem objec creation.

Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovirtio-9p: Security model for mkdir
Venkateswararao Jujjuri (JV) [Mon, 14 Jun 2010 20:34:46 +0000 (13:34 -0700)]
virtio-9p: Security model for mkdir

Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovirtio-9p: Security model for create/open2
Venkateswararao Jujjuri (JV) [Mon, 14 Jun 2010 20:34:45 +0000 (13:34 -0700)]
virtio-9p: Security model for create/open2

In the mapped security model, VirtFS server intercepts and maps
the file object create and get/set attribute requests. Files on the fileserver
will be created with VirtFS servers (QEMU) user credentials and the
client-users credentials are stored in extended attributes. On the request
to get attributes, server extracts the client-users credentials
from extended attributes and sends them to the client.

On Host/Fileserver:
-rw-------. 2 virfsuid virtfsgid 0 2010-05-11 09:19 afile

On Guest/Client:
-rw-r--r-- 2 guestuser guestuser 0 2010-05-11 12:19 afile

Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovirtio-9p: Implemented Security model for lstat and fstat
Venkateswararao Jujjuri (JV) [Mon, 14 Jun 2010 20:34:44 +0000 (13:34 -0700)]
virtio-9p: Implemented Security model for lstat and fstat

Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>