OSDN Git Service

qmiga/qemu.git
10 years agoerror: error_is_set() is finally unused; remove
Markus Armbruster [Mon, 19 May 2014 16:57:38 +0000 (18:57 +0200)]
error: error_is_set() is finally unused; remove

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agochar: Explain qmp_chardev_add()'s unusual error handling
Markus Armbruster [Mon, 19 May 2014 16:57:36 +0000 (18:57 +0200)]
char: Explain qmp_chardev_add()'s unusual error handling

Character backend open hasn't been fully converted to the Error API.
Some opens fail without setting an error.  qmp_chardev_add() needs to
detect when that happens, and set a generic error.  Explain that in a
comment, and inline error_is_set() for clarity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agochar: Clean up fragile use of error_is_set()
Markus Armbruster [Mon, 19 May 2014 16:57:35 +0000 (18:57 +0200)]
char: Clean up fragile use of error_is_set()

Using error_is_set(ERRP) to find out whether a function failed is
either wrong, fragile, or unnecessarily opaque.  It's wrong when ERRP
may be null, because errors go undetected when it is.  It's fragile
when proving ERRP non-null involves a non-local argument.  Else, it's
unnecessarily opaque (see commit 84d18f0).

The error_is_set(errp) in qemu_chr_new_from_opts() is merely fragile,
because the callers never pass a null errp argument.

Make the code more robust and more obviously correct: receive the
error in a local variable, then propagate it through the parameter.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agochar: Use return values instead of error_is_set(errp)
Markus Armbruster [Mon, 19 May 2014 16:57:34 +0000 (18:57 +0200)]
char: Use return values instead of error_is_set(errp)

Using error_is_set(errp) to check whether a function call failed is
fragile: it breaks when errp is null.  Check perfectly suitable return
values instead when possible.  As far as I can tell, errp can't be
null there, but this is more robust and more obviously correct

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoqemu-socket: Clean up inet_connect_opts()
Markus Armbruster [Mon, 19 May 2014 16:57:37 +0000 (18:57 +0200)]
qemu-socket: Clean up inet_connect_opts()

Separate the search for a working addrinfo from the code that does
something with it.  Makes for a clearer search loop.

Use a local Error * to simplify resetting the error in the search
loop.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoMerge remote-tracking branch 'remotes/qmp-unstable/queue/qmp' into staging
Peter Maydell [Mon, 19 May 2014 13:10:00 +0000 (14:10 +0100)]
Merge remote-tracking branch 'remotes/qmp-unstable/queue/qmp' into staging

* remotes/qmp-unstable/queue/qmp:
  qapi: skip redundant includes
  monitor: Add netdev_del id argument completion.
  monitor: Add netdev_add type argument completion.
  monitor: Add set_link arguments completion.
  monitor: Add chardev-add backend argument completion.
  monitor: Add chardev-remove command completion.
  monitor: Convert sendkey to use command_completion.
  qapi: Show qapi-commands.py invocation in qapi-code-gen.txt
  qapi: Replace uncommon use of the error API by the common one
  tests: Don't call visit_end_struct() after visit_start_struct() fails
  hw: Don't call visit_end_struct() after visit_start_struct() fails
  hmp: Call visit_end_struct() after visit_start_struct() succeeds
  qapi: Un-inline visit of implicit struct
  qapi-visit.py: Clean up a sloppy use of field prefix
  qapi: Clean up shadowing of parameters and locals in inner scopes
  qapi-visit.py: Clean up confusing push_indent() / pop_indent() use
  qapi: Replace start_optional()/end_optional() by optional()
  qapi: Remove unused Visitor callbacks start_handle(), end_handle()
  qapi: Normalize marshalling's visitor initialization and cleanup
  qapi: Update qapi-code-gen.txt example to match current code

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/kraxel/tags/pull-input-8' into staging
Peter Maydell [Mon, 19 May 2014 11:53:07 +0000 (12:53 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/pull-input-8' into staging

Input code update:
 - add keycode mapping helpers to core.
 - start switching devices to new input api.
 - misc bugfixes.

# gpg: Signature made Fri 16 May 2014 07:43:45 BST using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-input-8:
  input: sparc32 kbd: claim en-us layout
  input: sparc32 kbd: fix some key mappings
  input: remove sparc keymap hack
  input: switch sparc32 kbd to new input api
  input: switch ps/2 mouse to new input api
  input: switch ps/2 kbd to new input api
  input: use KeyValue directly in sendkey monitor command
  input: add qemu_input_handler_deactivate
  input: key mapping helpers
  ps2: set ps/2 output buffer size as the same as kernel

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/bonzini/scsi-next' into staging
Peter Maydell [Mon, 19 May 2014 11:30:06 +0000 (12:30 +0100)]
Merge remote-tracking branch 'remotes/bonzini/scsi-next' into staging

* remotes/bonzini/scsi-next:
  [PATCH] block/iscsi: bump year in copyright notice
  block/iscsi: allow cluster_size of 4K and greater
  block/iscsi: clarify the meaning of ISCSI_CHECKALLOC_THRES
  block/iscsi: speed up read for unallocated sectors
  block/iscsi: allow fall back to WRITE SAME without UNMAP
  MAINTAINERS: mark megasas as maintained
  megasas: Add MSI support
  megasas: Enable MSI-X support
  megasas: Implement LD_LIST_QUERY
  scsi: Improve error messages more
  scsi-disk: Improve error messager if can't get version number

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoqapi: skip redundant includes
Benoît Canet [Fri, 16 May 2014 10:51:56 +0000 (12:51 +0200)]
qapi: skip redundant includes

The purpose of this change is to help create a json file containing
common definitions; each bit of generated C code must be emitted
only one time.

A second history global to all QAPISchema instances has been added
to detect when a file is included more than one time and skip these
includes.
It does not act as a stack and the changes made to it by the
__init__ function are propagated back to the caller so it's really
a global state.

Signed-off-by: Benoit Canet <benoit@irqsave.net>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
10 years agoinput: sparc32 kbd: claim en-us layout
Gerd Hoffmann [Tue, 6 May 2014 12:11:16 +0000 (14:11 +0200)]
input: sparc32 kbd: claim en-us layout

Reported-by: Olivier Danet <odanet@caramail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoinput: sparc32 kbd: fix some key mappings
Gerd Hoffmann [Tue, 29 Apr 2014 11:19:32 +0000 (13:19 +0200)]
input: sparc32 kbd: fix some key mappings

Reported-by: Olivier Danet <odanet@caramail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoinput: remove sparc keymap hack
Gerd Hoffmann [Fri, 28 Mar 2014 07:56:15 +0000 (08:56 +0100)]
input: remove sparc keymap hack

With sparc keyboard going directly from QKeyValue to sparc keycodes
this should not be needed any more.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoinput: switch sparc32 kbd to new input api
Gerd Hoffmann [Tue, 25 Mar 2014 12:16:21 +0000 (13:16 +0100)]
input: switch sparc32 kbd to new input api

Nasty 0xe0 logic is gone.  We map through QKeyCode now, giving us a
nice, readable mapping table.

Quick smoke test in OpenFirmware looks ok.  Careful check from arch
maintainers would be very nice, especially on the capslock and numlock
logic.  I'm not fully sure whenever I got it translated correctly and
also what it is supposed to do in the first place ...

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoinput: switch ps/2 mouse to new input api
Gerd Hoffmann [Thu, 13 Mar 2014 11:58:29 +0000 (12:58 +0100)]
input: switch ps/2 mouse to new input api

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoinput: switch ps/2 kbd to new input api
Gerd Hoffmann [Thu, 13 Mar 2014 11:39:38 +0000 (12:39 +0100)]
input: switch ps/2 kbd to new input api

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoinput: use KeyValue directly in sendkey monitor command
Gerd Hoffmann [Tue, 29 Apr 2014 11:17:43 +0000 (13:17 +0200)]
input: use KeyValue directly in sendkey monitor command

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoinput: add qemu_input_handler_deactivate
Gerd Hoffmann [Sat, 15 Mar 2014 23:38:45 +0000 (00:38 +0100)]
input: add qemu_input_handler_deactivate

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoinput: key mapping helpers
Gerd Hoffmann [Tue, 11 Mar 2014 11:15:39 +0000 (12:15 +0100)]
input: key mapping helpers

Add helper functions to translate KeyValue (qapi key representation)
into other representations: traditional qemu key numbers, qapi key
codes (Q_KEY_CODE_*) and scancode sequences.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agops2: set ps/2 output buffer size as the same as kernel
Gonglei [Thu, 24 Apr 2014 12:06:19 +0000 (20:06 +0800)]
ps2: set ps/2 output buffer size as the same as kernel

According to the PS/2 Mouse/Keyboard Protocol, the keyboard outupt buffer size
is 16 bytes. And the PS2_QUEUE_SIZE 256 was introduced in Qemu from the very
beginning.

When I started a  redhat5.6 32bit guest, meanwhile tapped the keyboard as quickly as
possible, the screen would show me "i8042.c: No controller found". As a result,
I couldn't use the keyboard in the VNC client.

Previous discussion about the issue in maillist:
http://thread.gmane.org/gmane.comp.emulators.qemu/43294/focus=47180

This patch has been tested on redhat5.6 32-bit/suse11sp3 64-bit guests.
More easy meathod to reproduce:
1.boot a guest with libvirt.
2.connect to VNC client.
3.as you see the BIOS, bootloader, Linux booting, run the follow simply shell script:
for((i=0;i<10000000;i++)) do virsh send-key redhat5.6 KEY_A; done

Actual results:
dmesg show "i8042.c: No controller found." And the keyboard is out of work.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agomonitor: Add netdev_del id argument completion.
Hani Benhabiles [Wed, 7 May 2014 22:41:32 +0000 (23:41 +0100)]
monitor: Add netdev_del id argument completion.

Signed-off-by: Hani Benhabiles <hani@linux.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
10 years agomonitor: Add netdev_add type argument completion.
Hani Benhabiles [Wed, 7 May 2014 22:41:31 +0000 (23:41 +0100)]
monitor: Add netdev_add type argument completion.

Also update the command's documentation.

Signed-off-by: Hani Benhabiles <hani@linux.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
10 years agomonitor: Add set_link arguments completion.
Hani Benhabiles [Wed, 7 May 2014 22:41:30 +0000 (23:41 +0100)]
monitor: Add set_link arguments completion.

Make it possible to query all net clients without specifying an ID when calling
qemu_find_net_clients_except().

This also adds the add_completion_option() function which is to be used for
other commands completions as well.

Signed-off-by: Hani Benhabiles <hani@linux.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
10 years agomonitor: Add chardev-add backend argument completion.
Hani Benhabiles [Wed, 7 May 2014 22:41:29 +0000 (23:41 +0100)]
monitor: Add chardev-add backend argument completion.

Signed-off-by: Hani Benhabiles <hani@linux.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
10 years agomonitor: Add chardev-remove command completion.
Hani Benhabiles [Wed, 7 May 2014 22:41:28 +0000 (23:41 +0100)]
monitor: Add chardev-remove command completion.

Signed-off-by: Hani Benhabiles <hani@linux.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
10 years agomonitor: Convert sendkey to use command_completion.
Hani Benhabiles [Wed, 7 May 2014 22:41:27 +0000 (23:41 +0100)]
monitor: Convert sendkey to use command_completion.

Signed-off-by: Hani Benhabiles <hani@linux.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
10 years agoqapi: Show qapi-commands.py invocation in qapi-code-gen.txt
Markus Armbruster [Wed, 14 May 2014 15:27:23 +0000 (17:27 +0200)]
qapi: Show qapi-commands.py invocation in qapi-code-gen.txt

While there, pare down the shell prompts.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
10 years agoqapi: Replace uncommon use of the error API by the common one
Markus Armbruster [Wed, 7 May 2014 07:53:54 +0000 (09:53 +0200)]
qapi: Replace uncommon use of the error API by the common one

We commonly use the error API like this:

    err = NULL;
    foo(..., &err);
    if (err) {
        goto out;
    }
    bar(..., &err);

Every error source is checked separately.  The second function is only
called when the first one succeeds.  Both functions are free to pass
their argument to error_set().  Because error_set() asserts no error
has been set, this effectively means they must not be called with an
error set.

The qapi-generated code uses the error API differently:

    // *errp was initialized to NULL somewhere up the call chain
    frob(..., errp);
    gnat(..., errp);

Errors accumulate in *errp: first error wins, subsequent errors get
dropped.  To make this work, the second function does nothing when
called with an error set.  Requires non-null errp, or else the second
function can't see the first one fail.

This usage has also bled into visitor tests, and two device model
object property getters rtc_get_date() and balloon_stats_get_all().

With the "accumulate" technique, you need fewer error checks in
callers, and buy that with an error check in every callee.  Can be
nice.

However, mixing the two techniques is confusing.  You can't use the
"accumulate" technique with functions designed for the "check
separately" technique.  You can use the "check separately" technique
with functions designed for the "accumulate" technique, but then
error_set() can't catch you setting an error more than once.

Standardize on the "check separately" technique for now, because it's
overwhelmingly prevalent.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
10 years agotests: Don't call visit_end_struct() after visit_start_struct() fails
Markus Armbruster [Wed, 7 May 2014 07:53:53 +0000 (09:53 +0200)]
tests: Don't call visit_end_struct() after visit_start_struct() fails

When visit_start_struct() fails, visit_end_struct() must not be
called.  Three out of four visit_type_TestStruct() call it anyway.  As
far as I can tell, visit_start_struct() doesn't actually fail there.
Fix them anyway.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
10 years agohw: Don't call visit_end_struct() after visit_start_struct() fails
Markus Armbruster [Wed, 7 May 2014 07:53:52 +0000 (09:53 +0200)]
hw: Don't call visit_end_struct() after visit_start_struct() fails

When visit_start_struct() fails, visit_end_struct() must not be
called.  rtc_get_date() and balloon_stats_all() call it anyway.  As
far as I can tell, they're only used with the string output visitor,
which doesn't care.  Fix them anyway.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
10 years agohmp: Call visit_end_struct() after visit_start_struct() succeeds
Markus Armbruster [Wed, 7 May 2014 07:53:51 +0000 (09:53 +0200)]
hmp: Call visit_end_struct() after visit_start_struct() succeeds

When visit_start_struct() succeeds, visit_end_struct() must be called.
hmp_object_add() doesn't when a member visit fails.  As far as I can
tell, the opts visitor copes okay with the misuse.  Fix it anyway.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
10 years agoqapi: Un-inline visit of implicit struct
Markus Armbruster [Wed, 7 May 2014 07:53:50 +0000 (09:53 +0200)]
qapi: Un-inline visit of implicit struct

In preparation of error handling changes.  Bonus: generates less
duplicated code.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
10 years agoqapi-visit.py: Clean up a sloppy use of field prefix
Markus Armbruster [Wed, 7 May 2014 07:53:49 +0000 (09:53 +0200)]
qapi-visit.py: Clean up a sloppy use of field prefix

generate_visit_struct_fields() generates the base type's struct member
name both with and without the field prefix.  Harmless, because the
field prefix is always empty there: only unboxed complex members have
a prefix, and those can't have a base type.

Clean it up anyway.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
10 years agoqapi: Clean up shadowing of parameters and locals in inner scopes
Markus Armbruster [Wed, 7 May 2014 07:53:48 +0000 (09:53 +0200)]
qapi: Clean up shadowing of parameters and locals in inner scopes

By un-inlining the visit of nested complex types.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
10 years agoqapi-visit.py: Clean up confusing push_indent() / pop_indent() use
Markus Armbruster [Wed, 7 May 2014 07:53:47 +0000 (09:53 +0200)]
qapi-visit.py: Clean up confusing push_indent() / pop_indent() use

Changing implicit indentation in the middle of generating a block
makes following the code being generated unnecessarily hard.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
10 years agoqapi: Replace start_optional()/end_optional() by optional()
Markus Armbruster [Wed, 7 May 2014 07:53:46 +0000 (09:53 +0200)]
qapi: Replace start_optional()/end_optional() by optional()

Semantics of end_optional() differ subtly from the other end_FOO()
callbacks: when start_FOO() succeeds, the matching end_FOO() gets
called regardless of what happens in between.  end_optional() gets
called only when everything in between succeeds as well.  Entirely
undocumented, like all of the visitor API.

The only user of Visitor Callback end_optional() never did anything,
and was removed in commit 9f9ab46.

I'm about to clean up error handling in the generated visitor code,
and end_optional() is in my way.  No users mean no test cases, and
making non-trivial cleanup transformations without test cases doesn't
strike me as a good idea.

Drop end_optional(), and rename start_optional() to optional().  We
can always go back to a pair of callbacks when we have an actual need.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
10 years agoqapi: Remove unused Visitor callbacks start_handle(), end_handle()
Markus Armbruster [Wed, 7 May 2014 07:53:45 +0000 (09:53 +0200)]
qapi: Remove unused Visitor callbacks start_handle(), end_handle()

These have never been called or implemented by anything, and their
intended use is undocumented, like all of the visitor API.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
10 years agoqapi: Normalize marshalling's visitor initialization and cleanup
Markus Armbruster [Wed, 7 May 2014 07:53:44 +0000 (09:53 +0200)]
qapi: Normalize marshalling's visitor initialization and cleanup

Input and output marshalling functions do it differently.  Change them
to work the same: initialize the I/O visitor, use it, clean it up,
initialize the dealloc visitor, use it, clean it up.

This delays dealloc visitor initialization in output marshalling
functions, and input visitor cleanup in input marshalling functions.
No functional change, but the latter will be convenient when I change
the error handling.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
10 years agoqapi: Update qapi-code-gen.txt example to match current code
Markus Armbruster [Wed, 7 May 2014 07:53:43 +0000 (09:53 +0200)]
qapi: Update qapi-code-gen.txt example to match current code

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
10 years agoMerge remote-tracking branch 'remotes/rth/tags/pull-tcg-s390-20140515' into staging
Peter Maydell [Thu, 15 May 2014 17:56:07 +0000 (18:56 +0100)]
Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-s390-20140515' into staging

tcg/s390 updates

# gpg: Signature made Thu 15 May 2014 17:24:40 BST using RSA key ID 4DD0279B
# gpg: Can't check signature: public key not found

* remotes/rth/tags/pull-tcg-s390-20140515:
  tcg-s390: Implement direct chaining of TBs
  tcg-s390: Don't force -march=z990
  tcg-s390: Improve setcond
  tcg-s390: Allow immediate operands to add2 and sub2
  tcg-s390: Implement tcg_register_jit
  tcg-s390: Use more risbg in the tlb sequence
  tcg-s390: Move ldst helpers out of line
  tcg-s390: Convert to new ldst opcodes
  tcg-s390: Integrate endianness into TCGMemOp
  tcg-s390: Convert to TCGMemOp
  tcg-s390: Fix off-by-one in wraparound andi

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/kraxel/tags/pull-roms-2' into staging
Peter Maydell [Thu, 15 May 2014 17:32:16 +0000 (18:32 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/pull-roms-2' into staging

seabios: update to 1.7.5-rc1
ipxe: update to current git

# gpg: Signature made Thu 15 May 2014 13:29:37 BST using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-roms-2:
  ipxe: update to current git
  seabios: update to 1.7.5-rc1

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
Peter Maydell [Thu, 15 May 2014 17:01:46 +0000 (18:01 +0100)]
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

virtio update

looks like a quiet week
minor bugfix in virtio by myself

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
# gpg: Signature made Tue 13 May 2014 14:37:23 BST using RSA key ID D28D5469
# gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>"
# gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>"

* remotes/mst/tags/for_upstream:
  virtio: allow mapping up to max queue size

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/juanquintela/tags/migration/20140515' into...
Peter Maydell [Thu, 15 May 2014 16:29:03 +0000 (17:29 +0100)]
Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20140515' into staging

migration/next for 20140515

# gpg: Signature made Thu 15 May 2014 02:32:25 BST using RSA key ID 5872D723
# gpg: Can't check signature: public key not found

* remotes/juanquintela/tags/migration/20140515:
  usb: fix up post load checks
  migration: show average throughput when migration finishes
  savevm: Remove all the unneeded version_minimum_id_old (rest)
  savevm: Remove all the unneeded version_minimum_id_old (usb)
  Split ram_save_block
  arch_init: Simplify code for load_xbzrle()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotcg-s390: Implement direct chaining of TBs
Richard Henderson [Wed, 14 May 2014 21:14:51 +0000 (17:14 -0400)]
tcg-s390: Implement direct chaining of TBs

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-s390: Don't force -march=z990
Richard Henderson [Mon, 31 Mar 2014 17:40:49 +0000 (13:40 -0400)]
tcg-s390: Don't force -march=z990

While we still require the LONG DISPLACEMENT facility, defaults
have moved on since then.  Don't override the system compiler,
whose default may be set to z9-109 or later.

Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agoMerge remote-tracking branch 'remotes/rth/fix-mov' into staging
Peter Maydell [Thu, 15 May 2014 16:05:20 +0000 (17:05 +0100)]
Merge remote-tracking branch 'remotes/rth/fix-mov' into staging

* remotes/rth/fix-mov:
  tcg: Fix tcg_reg_alloc_mov vs no-op truncation

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20140513' into...
Peter Maydell [Thu, 15 May 2014 15:24:12 +0000 (16:24 +0100)]
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20140513' into staging

target-arm queue:
 * update libvixl to 1.4
 * remove version_minimum_id_old from ARM devices
 * stellaris_enet tx/rx/migration overhaul
 * various minor fixes for coverity issues

# gpg: Signature made Tue 13 May 2014 16:25:12 BST using RSA key ID 14360CDE
# gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>"

* remotes/pmaydell/tags/pull-target-arm-20140513:
  hw/arm/omap_gpmc: Avoid buffer overrun filling prefetch FIFO
  hw/arm/stellaris: Correct handling of GPTM TAR register
  hw/timer/exynos4210_mct: Avoid overflow in exynos4210_ltick_recalc_count
  hw/dma/omap_dma: Add (uint32_t) casts when shifting uint16_t by 16
  hw/arm/omap1: Avoid unintended sign extension writing omap_rtc YEARS_REG
  hw/net/cadence_gem: Remove dead code
  hw/intc/allwinner-a10-pic: Add missing 'break'
  target-arm/helper.c: Don't flush the TLB if SCTLR is rewritten unchanged
  hw/net/stellaris_enet: Convert to vmstate
  hw/net/stellaris_enet: Get rid of rx_fifo pointer
  hw/net/stellaris_enet: Fix debug format strings
  hw/net/stellaris_enet: Correctly implement the TR and THR registers
  hw/net/stellaris_enet: Rewrite tx fifo handling code
  hw/net/stellaris_enet: Correct handling of packet padding
  hw/net/stellaris_enet: Restructure tx_fifo code to avoid buffer overrun
  savevm: Remove all the unneeded version_minimum_id_old (arm)
  disas/libvixl: Update to libvixl 1.4

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/kvm/uq/master' into staging
Peter Maydell [Thu, 15 May 2014 14:38:39 +0000 (15:38 +0100)]
Merge remote-tracking branch 'remotes/kvm/uq/master' into staging

* remotes/kvm/uq/master:
  pc: port 92 reset requires a low->high transition
  cpu: make CPU_INTERRUPT_RESET available on all targets
  apic: do not accept SIPI on the bootstrap processor
  target-i386: preserve FPU and MSR state on INIT
  target-i386: fix set of registers zeroed on reset
  kvm: forward INIT signals coming from the chipset
  kvm: reset state from the CPU's reset method
  target-i386: the x86 CPL is stored in CS.selector - auto update hflags accordingly.
  target-i386: set eflags prior to calling cpu_x86_load_seg_cache() in seg_helper.c
  target-i386: set eflags and cr0 prior to calling cpu_x86_load_seg_cache() in smm_helper.c
  target-i386: set eflags prior to calling svm_load_seg_cache() in svm_helper.c
  pci-assign: limit # of msix vectors
  pci-assign: Fix a bug when map MSI-X table memory failed
  kvm: make one_reg helpers available for everyone
  target-i386: Remove unused data from local array

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/rth/tags/pull-tgt-i386-20140512' into staging
Peter Maydell [Thu, 15 May 2014 13:38:53 +0000 (14:38 +0100)]
Merge remote-tracking branch 'remotes/rth/tags/pull-tgt-i386-20140512' into staging

Fix BT zero flag for new Intel manuals

# gpg: Signature made Mon 12 May 2014 22:26:01 BST using RSA key ID 4DD0279B
# gpg: Can't check signature: public key not found

* remotes/rth/tags/pull-tgt-i386-20140512:
  target-i386: Preserve the Z bit for bt/bts/btr/btc

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoRevert "iotests: Use configured python"
Peter Maydell [Thu, 15 May 2014 11:34:36 +0000 (12:34 +0100)]
Revert "iotests: Use configured python"

This reverts commit f915db07ef9c368ea6db6430256de064fdd1525f.

This commit is broken because it does not account for the
build tree and the source tree being different, and can cause
build failures for out-of-tree builds. Revert it until we can
identify a better solution to the problem.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1400153676-30180-1-git-send-email-peter.maydell@linaro.org
Acked-by: Kevin Wolf <kwolf@redhat.com>
10 years agoipxe: update to current git
Gerd Hoffmann [Thu, 15 May 2014 12:23:59 +0000 (14:23 +0200)]
ipxe: update to current git

Now that ipxe has separate settings for load / boot banner timeouts
re-enable the boot banner while keeping the load banner turned off,
so we don't add a delay to non-pxe boots.

git shortlog:

Adrian Jamróz (2):
      [rhine] Rewrite VIA Rhine driver
      [velocity] Rewrite VIA Velocity driver

Alex Williamson (4):
      [romprefix] Allow ROM banner timeout to be configured independently
      [autoboot] Enable infrastructure to specify an autoboot device location
      [prefix] Allow prefix to specify a PCI autoboot device location
      [romprefix] Store boot bus:dev.fn address as autoboot device location

Alexander Chernyakhovsky (1):
      [ocsp] Handle OCSP responses that don't provide certificates

Bo Yang (1):
      [build] Avoid strict-aliasing warning for gcc 4.3

Brandon Penglase (1):
      [build] Add vmware build target

Christian Hesse (2):
      [build] Update build system for Syslinux 6.x
      [build] Fix LABEL name for .liso images

Daniel P. Berrange (1):
      [zbin] Fix size used for memset in alloc_output_file

Frediano Ziglio (1):
      [romprefix] Fix incorrect pointer offset in undiloader.S

Kevin Tran (1):
      [tg3] Fix various tg3 issues

Marin Hannache (8):
      [linux] Add missing #include <stddef.h>
      [legal] Add FILE_LICENCE for valgrind headers
      [legal] Add FILE_LICENCE for core/errno.c
      [legal] Add FILE_LICENCE for ath9k driver headers
      [legal] Add missing FILE_LICENCE declarations
      [cmdline] Add "poweroff" command
      [nfs] Add support for NFS protocol
      [nfs] Fix an issue with the selection of a local port

Michael Brown (363):
      [netdevice] Separate VLAN support from presence of VLAN-supporting drivers
      [undi] Work around specific devices with known broken interrupt behaviour
      [menu] Prevent character code zero from acting as a shortcut key
      [menu] Prevent separators with shortcut keys from being selected
      [tftp] Allow TFTP block size to be controlled via the PXE TFTP API
      [pcbios] Add extra debugging messages when unhiding iPXE from memory
      [nbiprefix] Set up real-mode stack before jumping to .text16
      [prefix] Use %cs as implicit parameter to uninstall()
      [pcbios] Inhibit all calls to INT 15,e820 and INT 15,e801 during POST
      [romprefix] Display only one "Ctrl-B" prompt per PCI device during POST
      [efi] Update to latest EDK2 headers
      [autoboot] Split main control flow out of main() into a new function ipxe()
      [efi] Add last_opened_snpdev()
      [efi] Expose downloaded images via EFI_SIMPLE_FILE_SYSTEM_PROTOCOL
      [efi] Add our own EFI_LOAD_FILE_PROTOCOL implementation
      [efi] Fix building with newer binutils
      [lkrnprefix] Allow relocation when no initrd is present
      [efi] Fix minor typos in efi_image.c
      [efi] Add EFI-specific debugging macros
      [int13] Split out ISO9660 and El Torito definitions to separate header files
      [smbios] Provide SMBIOS version number via smbios_version()
      [smbios] Mangle UUIDs for SMBIOS version 2.6 and newer
      [dhcp] Use PXE byte ordering for UUID in DHCP option 97
      [uuid] Abstract UUID mangling code out to a separate uuid_mangle() function
      [efi] Provide efi_guid_ntoa() for printing EFI GUIDs
      [efi] Add "reboot" command for EFI
      [cmdline] Add ability to perform a warm reboot
      [efi] Enable "cpuid" command by default for EFI
      [cs89x0] Remove conflicting macro definitions
      [igbvf] Remove conflicting macro definitions
      [prism2] Use standard type names
      [efi] Fetch device path for loaded image during initialisation
      [settings] Expose build architecture and platform via settings
      [bios] Fix screen clearing on buggy BIOSes
      [intel] Remove hardcoded offsets for descriptor ring registers
      [intel] Expose functionality to be shared with intelx driver
      [intel] Add intelx driver for Intel 10 Gigabit Ethernet NICs
      [efi] Remove obsolete EFI I/O implementation using EFI_CPU_IO_PROTOCOL
      [libc] Use __einfo() tuple as first argument to EUNIQ()
      [libc] Redefine low 8 bits of error code as "platform error code"
      [efi] Perform meaningful error code conversions
      [efi] Add sample platform-generated error disambiguations
      [netdevice] Use link-layer address as part of RNG seed
      [build] Allow sparse to find compiler.h
      [build] Define __WINT_TYPE__ if necessary
      [build] Allow sparse to be invoked via "make C=1"
      [build] Avoid sparse undeclared symbol warning for PROVIDE_SYMBOL()
      [process] Mark process descriptor as static in PERMANENT_PROCESS
      [realtek] Print bad MAC address in debug message when inferring no EEPROM
      [build] Use -Wno-decl when running sparse
      [build] Fix uses of literal 0 as a NULL pointer
      [build] Fix dubious uses of bitwise operators
      [build] Default to short wchar_t in stddef.h
      [realtek] Use ID word to detect EEPROM presence
      [errdb] Strip platform error code for non-platform-generated errors
      [pxe] Convert external PXE API errors into iPXE platform-generated errors
      [realtek] Allow reaction time between writing RTL_CAPR and reading RTL_CR
      [romprefix] Report failure cause when unable to open payload
      [realtek] Ensure EEPROM writes reach chip before starting udelay()
      [dhcp] Remove obsolete bootp.h header
      [netdevice] Add netdev_tx_defer() to allow drivers to defer transmissions
      [realtek] Defer packets when no transmit descriptors are available
      [settings] Eliminate settings "tag magic"
      [smbios] Allow access to unreferenced SMBIOS strings
      [smbios] Allow access to multiple instances of SMBIOS structures
      [crypto] Report meaningful error when certificate chain validation fails
      [build] Use $(eval) if available
      [build] Provide "allXXXs" targets for all media on all platforms
      [build] Add efidrv.cab target for UEFI Secure Boot signing
      [netdevice] Add "chip" setting
      [netdevice] Reset MAC address when asked to clear the "mac" setting
      [realtek] Fix reopening of legacy-mode 8139 NIC
      [crypto] Accept OCSP responses containing multiple certificates
      [bzimage] Align initrd images to page boundary
      [bzimage] Fix spurious uninitialised-variable warning on some gcc versions
      [build] Work around bug in gcc >= 4.8
      [autoboot] Use next-server from filename's settings block
      [tcp] Do not send RST for unrecognised connections
      [tcp] Fix comment to match code behaviour
      [test] Add self-tests for base16
      [base16] Generalise base16_decode() to hex_decode()
      [settings] Use hex_decode() to parse hex settings
      [settings] Add "hexraw" setting type
      [netdevice] Add "bustype" and "busloc" settings
      [settings] Add "busdevfn" setting type
      [linux] Add support for accessing PCI configuration space via /proc/bus/pci
      [settings] Add config/settings.h
      [settings] Expose PCI configuration space via settings mechanism
      [settings] Make "netX" settings block function as a symbolic link
      [cmdline] Accept "netX" in iPXE commands
      [lotest] Include sequence number within loopback test packets
      [intel] Incorporate ring producer and consumer counters in diagnostics
      [base16] Ensure base16_encode() always terminates its result string
      [realtek] Report RX error detail in debug messages
      [script] Allow for backslash continuation of script lines
      [settings] Add support for navigation keys in "config" user interface
      [realtek] Allow extra space in RX buffers
      [ifmgmt] Avoid relying on global variable within ifcommon_exec()
      [script] Avoid trying to read final character of a zero-length string
      [legal] Add missing FILE_LICENCE declarations
      [build] Fix %.licence build target
      [settings] Clarify usage of the term "named setting"
      [settings] Avoid potentially large stack allocations
      [settings] Remove temporary name buffer parameter from parse_setting_name()
      [settings] Remove default_type parameter from parse_setting_name()
      [settings] Expose parse_setting_name()
      [settings] Change "not-found" semantics of fetch_setting_copy()
      [settings] Add fetchf_setting_copy()
      [settings] Eliminate call to fetchf_named_setting() in expand_settings()
      [settings] Eliminate call to store_named_setting() in nslookup.c
      [settings] Remove now-unused store_named_setting()
      [parseopt] Allow parsed option to be modified
      [parseopt] Move parse_settings() to parseopt.c
      [parseopt] Add parse_setting()
      [settings] Eliminate call to storef_named_setting() in choose_exec()
      [settings] Eliminate calls to {fetch,store}f_named_setting() in NVO commands
      [settings] Remove now-unused fetchf_named_setting() and storef_named_setting()
      [script] Allow initial whitespace on lines containing labels
      [script] Allow commands following a script label
      [settings] Introduce the generalised concept of a numeric setting
      [cmdline] Add "inc" command
      [pci] Add pci_find_next() to iterate over existent PCI devices
      [cmdline] Add "pciscan" command to allow iteration over PCI devices
      [udp] Move high-frequency debug messages to DBGLVL_EXTRA
      [ipv6] Rename sin_{family,port} to sin6_{family,port} in struct sockaddr_in6
      [tcpip] Allow binding to unspecified privileged ports (below 1024)
      [settings] Expose CPUID instruction via settings mechanism
      [test] Add self-tests for snprintf()
      [settings] Allow numeric_setting_value() to handle long setting values
      [settings] Expose memory map via settings mechanism
      [params] Add support for the general concept of a form parameter list
      [cmdline] Add "params" and "param" commands to manage form parameter lists
      [uri] Allow URIs to incorporate a parameter list
      [http] Add support for HTTP POST
      [settings] Make built-in settings a linker table
      [linux] Give tap devices a name and bus type
      [ipv4] Generalise fragment reassembly mechanism
      [netdevice] Increase maximum network-layer address length
      [netdevice] Add concept of a network device index
      [netdevice] Add method for generating EUI-64 address from link-layer address
      [ethernet] Add support for generating multicast hash for IPv6 addresses
      [linux] Apply MAC address prior to registering network device
      [tcpip] Pass through network device to transport layer protocols
      [neighbour] Generalise concept of neighbour discovery
      [ipv4] Abstract out protocol-specific portions of "route" command
      [ipv6] Replace IPv6 stack
      [ipv6] Fix uninitialised-variable warning
      [tcp] Reduce path MTU to 1280 bytes
      [ipv6] Add inet6_aton()
      [build] Work around bug in gcc >= 4.8
      [neighbour] Add nstat() function to print out neighbour table
      [cmdline] Add "nstat" command
      [tcp] Add AF_INET6 socket opener
      [udp] Add AF_INET6 socket opener
      [netdevice] Add find_netdev_by_index()
      [socket] Add concept of a generalised socket address converter
      [ipv4] Add IPv4 socket address converter
      [ipv6] Add IPv6 socket address converter
      [resolv] Use sock_aton() to allow parsing of arbitrary numeric addresses
      [icmp] Add support for sending ICMP echo requests
      [ping] Add concept of a ping socket
      [ping] Add generic ping mechanism
      [ping] Add top-level ping() function to ping a host
      [cmdline] Add "ping" command
      [ipv6] Handle IPv6 option length correctly
      [ipv6] Extract link layer addresses from router advertisements
      [ipv6] Support stateless address autoconfiguration (SLAAC)
      [ipv6] Treat sin6_scope_id consistently
      [ipv6] Automatically choose source for link-local and multicast destinations
      [pxe] Always retrieve cached DHCPACK and apply to relevant network device
      [ipv6] Add ndp_tx_router_solicitation() to send router solicitations
      [parseopt] Add parse_timeout()
      [netdevice] Make all net_driver methods optional
      [interface] Default to calling intf_restart() in response to intf_close()
      [job] Allow job_progress() to return an ongoing job status code, if known
      [monojob] Add timeout parameter to monojob_wait()
      [monojob] Report ongoing job status as overall return status on timeout
      [cmdline] Rewrite "sync" command to use monojob_wait()
      [autoboot] Fix shell banner timeout
      [ifmgmt] Rewrite iflinkwait() to use monojob_wait()
      [cmdline] Allow "if<xxx>" commands to take options
      [netdevice] Add generic concept of a network device configurator
      [dhcp] Add DHCP network device configurator
      [parseopt] Add parse_netdev_configurator()
      [ifmgmt] Add ifconf() to carry out network device configuration
      [autoboot] Use ifconf() to configure network device
      [cmdline] Add "ifconf" command
      [cmdline] Make "dhcp" command a synonym for "ifconf"
      [dhcp] Remove obsolete dhcp() function
      [ipv6] Add IPv6 network device configurator
      [cmdline] Generate command option help text automatically
      [pxe] Ensure cached DHCPACK is retrieved prior to network device creation
      [base16] Fix comparison of signed and unsigned integers
      [settings] Move user-class setting from dhcp.c to settings.c
      [ipv6] Use given source address only if it is not the unspecified address
      [ipv6] Add "ipv6" setting type
      [dhcpv6] Add basic support for stateful and stateless DHCPv6
      [ipv6] Separate the concepts of prefix and address creation
      [dhcpv6] Allow stateful DHCPv6 to apply obtained IPv6 addresses
      [test] Include failing code within failed test result output
      [main] Defer "initialising devices" message until initialising devices
      [console] Pass escape sequence context to ANSI escape sequence handlers
      [pixbuf] Add generic concept of a pixel buffer
      [image] Allow for non-executable image formats
      [image] Add image_pixbuf() to create pixel buffer from image
      [pnm] Add support for PNM images
      [mucurses] Use "<ESC>[2J" ANSI escape sequence to clear screen
      [console] Allow console input and output to be disabled independently
      [console] Add concept of generic console configuration
      [cmdline] Add "console" command to configure console
      [fbcon] Add generic concept of a frame buffer console
      [vesafb] Add VESA frame buffer console
      [vesafb] Include raw status value within VBE error messages
      [vesafb] Skip modes for which we cannot get mode information
      [vesafb] Return meaningful error when no suitable mode is found
      [vesafb] Select an optimal mode, rather than the first acceptable mode
      [build] Fix building on OpenBSD 5.4
      [console] Allow '?' as an intermediate byte in ANSI escape sequences
      [mucurses] Implement curs_set() to control cursor visibility
      [settings] Hide cursor when not actively editing a setting
      [menu] Hide cursor when displaying menu
      [fbcon] Add support for displaying a cursor
      [settings] Explicitly separate the concept of a completed fetched setting
      [settings] Allow for IPv6 setting types in non-IPv6 builds
      [settings] Add fetch_ipv6_setting()
      [dns] Add support for resolving IPv6 addresses via AAAA records
      [socket] Ensure socket address structure sizes are fixed
      [syslog] Add support for IPv6 syslog server
      [ipv6] Add support for resolving IPv6 addresses via the "nslookup" command
      [linux] Provide access to SMBIOS via /dev/mem
      [dhcpv6] Use DUID-UUID form of client DUID
      [settings] Force settings into alphabetical order within sections
      [settings] Allow for multiple definitions of each predefined setting
      [settings] Merge SETTING_IPv4 and SETTING_IPv6
      [dhcpv6] Add DHCPv6 "filename" setting
      [ipv6] Expose NDP-provided settings (including the DNS server)
      [vesafb] Work around data corruption bug in bochs/qemu VBE implementation
      [settings] Adapt user interface to fit display size
      [login] Adapt user interface to fit display size
      [menu] Adapt user interface to fit display size
      [console] Allow consoles to update the recorded console size
      [fbcon] Update the console width and height after changing mode
      [lkrnprefix] Include iPXE version string in image header
      [fbcon] Always draw cursor using current foreground and background colours
      [console] Add centralised concept of colours and colour pairs
      [mucurses] Use centralised concept of colour pairs
      [cmdline] Add the "colour" and "cpair" commands
      [console] Add concept of a "magic" colour
      [vesafb] Set "magic" colour to transparent when a background picture is used
      [build] Remove obsolete check for GNU as version 2.9.1
      [ipv6] Fix compilation under FreeBSD
      [build] Build ROMs used by qemu and VMware as part of "make all"
      [libc] Add isprint()
      [test] Add okx() macro taking an explicit file name and line number
      [deflate] Add support for DEFLATE decompression
      [deflate] Fix literal data length calculation
      [libc] Add abs()
      [uaccess] Add memcmp_user()
      [test] Rewrite pnm_ok() using okx()
      [test] Generalise pnm_ok() to pixbuf_ok()
      [png] Add support for PNG images
      [vesafb] Handle failures from fbcon_init()
      [fbcon] Centre background picture on console
      [fbcon] Allow for an arbitrary margin around the text area
      [vesafb] Allow for an arbitrary margin around the text area
      [cmdline] Rename "console" command's --bpp option to --depth
      [cmdline] Add margin options to the "console" command
      [fbcon] Allow ANSI CUP with missing arguments
      [cmdline] Always clear screen after reconfiguring console
      [intel] Add some missing PCI IDs
      [dns] Support DNS search lists
      [dns] Update end-of-name pointer after processing CNAME record
      [dhcp] Copy exactly the required length when resizing DHCP options
      [settings] Remove "uristring" setting type
      [params] Use reference counters for form parameter lists
      [uri] Refactor URI parsing and formatting
      [image] Ensure every image has a fully resolved URI
      [tcpip] Add IP statistics collection as per RFC 4293
      [cmdline] Add the "ipstat" command
      [prefix] Ignore PCI autoboot device location if set to 00:00.0
      [tcpip] Provide tcpip_netdev() to determine the transmitting network device
      [tcpip] Provide tcpip_mtu() to determine the maximum transmission unit
      [tcp] Calculate correct MSS from peer address
      [bzimage] Report exact initrd length via bzImage header
      [realtek] Include link status register details in debug messages
      [romprefix] Do not clobber stack segment when returning to BIOS
      [netdevice] Mark devices as open before calling open() method
      [tcp] Update window even if ACK does not acknowledge new data
      [linux] Avoid starting currticks() from zero every time
      [http] Use a retry timer to trigger retried requests
      [http] Automatically retry request on a 503 Service Unavailable
      [mii] Add mii_dump() to dump all MII registers
      [realtek] Dump all MII register contents when link status changes
      [monojob] Reset timeout when progress is made
      [image] Add "--timeout" parameter to image downloading commands
      [efi] Allow for 64-bit EFI_STATUS codes
      [efi] Allow driver to be unloaded
      [efi] Connect driver to devices as part of installation
      [console] Fix display of characters with top bit set
      [lotest] Allow loopback testing on shared networks
      [netdevice] Notify upper-layer drivers when RX processing is (un)frozen
      [efi] Avoid accidentally calling main() twice
      [efi] Unload our own image before exiting UEFI application
      [efi] Disable SNP devices when running iPXE as the application
      [realtek] Add ability to dump all internal registers
      [realtek] Clear bit 24 of RCR
      [bios] Fix screen clearing on even more buggy BIOSes
      [http] Accept Content-Length header with trailing whitespace
      [crypto] Remove dynamically-allocated storage for certificate name
      [crypto] Remove dynamically-allocated storage for certificate OCSP URI
      [build] Remove long-obsolete mechanism for wrapping embedded images
      [build] Disable ccache for all relevant build targets
      [build] Add dependency of generated files upon Makefile
      [crypto] Add pubkey_match() to check for matching public/private key pairs
      [crypto] Generalise X.509 cache to a full certificate store
      [crypto] Use fingerprint when no common name is available for debug messages
      [crypto] Allow signed timestamp error margin to be configured at build time
      [test] Rewrite X.509 tests using okx()
      [test] Rewrite CMS tests using okx()
      [test] Add tests for x509_check_name()
      [test] Add subject alternative names to X.509 server test certificate
      [crypto] Add support for subjectAltName and wildcard certificates
      [crypto] Allow wildcard matches on commonName as well as subjectAltName
      [intel] Avoid completely filling the TX descriptor ring
      [test] Rewrite TCP/IP tests using okx()
      [test] Add self-tests for flsl()
      [libc] Add inline assembly implementation of flsl() using BSR instruction
      [test] Add tests for 64-bit division
      [build] Fix __libgcc attribute for recent gcc versions
      [test] Check for correct -mrtd assumption on libgcc arithmetic functions
      [libc] Add isqrt() function to find integer square roots
      [libc] Add flsll()
      [profile] Add generic profiling infrastructure
      [cmdline] Add "profstat" command to display profiling statistics
      [netdevice] Profile common operations
      [intel] Profile common virtual machine operations
      [intel] Push new RX descriptors in batches
      [librm] Use genuine real mode to accelerate operation in virtual machines
      [ipv4] Profile transmit and receive datapaths
      [tcp] Profile transmit and receive datapaths
      [http] Profile receive datapath
      [downloader] Profile receive datapath
      [build] Allow for a debug level of zero
      [librm] Allow interrupts in protected mode
      [comboot] Use built-in interrupt reflector
      [pcbios] Do not switch to real mode to check for timer interrupt
      [pcbios] Do not switch to real mode to sleep the CPU
      [test] Print out profiling statistics after a successful test run
      [librm] Add a profiling self-test for measuring mode transition times
      [librm] Add meaningful labels at section changes
      [librm] Speed up protected-to-real mode transition under KVM
      [librm] Speed up real-to-protected mode transition under KVM
      [librm] Speed up protected-mode calls under KVM
      [profile] Provide methods for profiling individual stages of operations
      [librm] Add profiling self-tests for complete real_call and prot_call cycles
      [pxe] Profile all PXE API calls
      [pxe] Profile UNDI transmit datapath
      [pxe] Work around missing PXENV_UNDI_OPEN only when necessary
      [undi] Profile all PXE API calls
      [undi] Profile transmit and receive datapaths
      [undi] Report any PXENV_UNDI_ISR errors via netdev_rx_err()
      [undi] Do not switch to real mode to check for NIC interrupt
      [undi] Place an upper limit on the number of PXENV_UNDI_ISR calls per poll

Peter Pickford (1):
      [serial] Enable UART FIFOs

Robin Smidsrød (2):
      [settings] Add "version" builtin setting
      [build] Include ipxe.pxe in default build

Stefan Hajnoczi (2):
      [netdevice] Add vlan_tag() to get the VLAN tag of a network device
      [iscsi] Include 802.1Q VLAN identifier in iBFT

Thomas Miletich (3):
      [3c90x] Stall upload engine before setting RX ring address
      [3c90x] Don't round up transmit packet length
      [3c90x] Fix High-MTU packet reception

lolipop (1):
      [intel] Add Intel I217 Gigabit Ethernet PCI ID

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoseabios: update to 1.7.5-rc1
Gerd Hoffmann [Thu, 15 May 2014 12:01:59 +0000 (14:01 +0200)]
seabios: update to 1.7.5-rc1

Code grew a bit, had to disable CONFIG_USB_UAS to make the
bios for the old machine types continue top fit into 128k.

git shortlog since 1.7.4:

Eric Northup (2):
      init_virtio_blk, init_virtio_scsi: reset HBA on error
      vp_init_simple: enable PCI bus-mastering before relying on DMA.

Gabriel L. Somlo (1):
      SMBIOS: Check for aggregate tables & entry point in fw_cfg

Gerd Hoffmann (4):
      smbios: catch zero-length strings
      pci: improve io address space allocation
      xhci: allocate scratch pad buffers
      vga: rework bar detection, add virtio-vga

Johannes Krampf (5):
      build: Remove unneccesary semicolons from acpi_extract scripts.
      build: Make print statements in scripts python3 compatible.
      build: Be explicit that we want integers when dividing for python3 compat.
      build: Avoid sort() on unordered classes for python3 compatibility.
      build: Be careful with unicode and byte strings for python3 compatibility.

Kevin O'Connor (79):
      build: Don't trash the .config file when src/Kconfig changes.
      Remove the pmm handle argument from _malloc().
      Clear the total block transfer count on error.
      Remove unnecesary updates of the disk op->count field.
      Always perform thread cleanup on MainThread stack.
      pvscsi: Don't store reference to struct pci_device.
      pvscsi: Always run entirely in 32bit mode.
      pvscsi: Remove use of LOWFLAT and GLOBALFLAT macros.
      usb: Replace EHCI to UHCI/OHCI synchronization with new scheme.
      Minor - pciinit.c - order header files and use static on local functions.
      Minor - fix misspelling in romfile.c comment.
      ehci: memset the qTD structures in ehci_alloc_intr_pipe
      build: Update kconfig to version in Linux 3.13.
      scripts: Allow encodeint.py to take integers in hex notation.
      coreboot: Support alternative locations for CBFS.
      debug: Add runtime option to not report the debug serial port to the OS.
      debug: Only call serial_debug_preinit() at startup.
      debug: Unify the SeaBIOS debug version banner.
      xhci: Use 64bit writes to ERDP register.
      xhci: Fix incorrect direction setting on status transmissions.
      xhci: Set the interval parameter on interrupt pipes.
      xhci: Verify PAGESIZE register before initializing driver.
      xhci: Allocate and free the xhci inctx structure on each use.
      xhci: Move set_address code from xhci_control to xhci_alloc_pipe.
      xhci: Eliminate 'struct xhci_device'.
      xhci: Support xhci controllers with 64 byte contexts.
      xhci: Allow the XHCI USB controller to be enabled for coreboot.
      xhci: Don't use a dummy endpoint count in configure command.
      xhci: Report the "protocol defined" and PSIC bits of extended capabilities.
      xhci: Support USB hubs on xhci controllers.
      Add call32_params() helper function.
      Add space between DTYPE_* definitions.
      xhci: Run the XHCI driver entirely in 32bit mode.
      Remove pci_writel() and pci_readl() functions.
      xhci: Check if scratch pad allocation fails.
      Increase maximum size of permanent high memory area.
      usb: USB 3 devices encode bMaxPacketSize0 field.
      usb: Move default pipe max packet size code from xhci to main code.
      xhci: Use the same endpoint initialization code in xhci_alloc_pipe()
      xhci: Add copyright notice to usb-xhci.c
      vgabios: Make sure exported structs use PACKED.
      vgabios: Simplify the bios save state area.
      vgabios: Simplify save/restore mechanism.
      vgabios: Attempt to detect old x86emu and force a fault.
      vgabios: Don't interpret TAB character.
      vgabios: Refactor write_teletype and write_chars.
      vgabios: Make sure stdvga_list_modes() doesn't overrun the buffer.
      coreboot: Add support for a "links" file to have aliases in CBFS.
      Enhance nullTrailingSpace() so that it can also skip leading spaces.
      coreboot: Move links file processing to its own function.
      vgabios: Fix PMM allocation request size.
      smbios: Default all values to zero.
      usb: Only disable HID devices if both USB_MOUSE and USB_KEYBOARD are off.
      Minor - fix some typos in comments.
      Replace CONFIG_THREAD_OPTIONROMS with a runtime config setting.
      acpi: Move acpi parsing logic from acpi.c to biostables.c / paravirt.c.
      smbios: Move smbios parsing logic from smbios.c to biostables.c.
      Move PirAddr definition from pirtable.c to biostables.c.
      Use biostables.c for copying bios tables even when generating them.
      Document no new changes to pirtable.c, mptable.c, acpi.c, and smbios.c.
      apm: Remove old Bochs mechanism for shutdown/suspend/standby.
      Minor - remove unused includes from pci.c.
      vgabios: Add option to control use of standard VGA IO ports.
      vgabios: Split vgafb_scroll() into separate move and clear functions.
      vgabios: Rewrite vgafb.c graphics operations to set of 4 standard operators.
      vgabios: Introduce text_address().
      vgabios: Add support for manipulating framebuffers in high memory.
      Set the color attribute when calling vgabios print character.
      vgabios: PMM scan was incorrectly depending on a zero %ds segment.
      coreboot: Make coreboot table searching available to other code.
      vgabios: Initial support for coreboot native vga vgabios.
      Minor - replace some tab characters that slipped into the code.
      Factor out smbios table walking from display_uuid to smbios_next().
      vgabios: Define PlatformRunningOn to make compile happy.
      If an int 1587 call is made from an option rom, stay in bigreal mode.
      xhci: Use msleep() instead of mdelay() for port status delay.
      build: Make sure romlayout.o is recompiled on Kconfig change.
      Fix int 1589 calls when CONFIG_ENTRY_EXTRASTACK is enabled.
      acpi: Fix acpi dsdt compile warning.

Laszlo Ersek (1):
      init_virtio_scsi(): reset the HBA before freeing its virtio ring

Marcel Apfelbaum (3):
      resume: restore piix pm config registers after resume
      hw/pci: reserve IO and mem for pci-2-pci bridges with no devices attached
      hw/pci: check if pci2pci bridges implement optional limit registers

Roger Pau Monne (1):
      ld: don't hardcode "-melf_i386"

Sander Eikelenboom (1):
      Prevent build failure by not splitting line in the middle of arguments to checkrom.py script

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agotcg-s390: Improve setcond
Richard Henderson [Mon, 31 Mar 2014 16:57:06 +0000 (12:57 -0400)]
tcg-s390: Improve setcond

There are a variety of common cases for which we can use carry tricks to
avoid a conditional branch.  On very new hardware, use LOAD ON CONDITION
instead of a conditional branch.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-s390: Allow immediate operands to add2 and sub2
Richard Henderson [Mon, 31 Mar 2014 07:16:37 +0000 (03:16 -0400)]
tcg-s390: Allow immediate operands to add2 and sub2

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-s390: Implement tcg_register_jit
Richard Henderson [Mon, 24 Mar 2014 01:04:40 +0000 (21:04 -0400)]
tcg-s390: Implement tcg_register_jit

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-s390: Use more risbg in the tlb sequence
Richard Henderson [Sun, 23 Mar 2014 23:35:44 +0000 (19:35 -0400)]
tcg-s390: Use more risbg in the tlb sequence

Elides two insns from the sequence.  The resulting tlb compare
sequence is satisfyingly minimal:

risbg  %r2,%r8,51,186,56
risbg  %r3,%r8,61,178,0
cg     %r3,904(%r10,%r2)
lg     %r2,920(%r10,%r2)
jlh    tlb_miss

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-s390: Move ldst helpers out of line
Richard Henderson [Sun, 23 Mar 2014 21:26:15 +0000 (14:26 -0700)]
tcg-s390: Move ldst helpers out of line

That is, the old LDST_OPTIMIZATION.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-s390: Convert to new ldst opcodes
Richard Henderson [Sun, 23 Mar 2014 20:36:00 +0000 (13:36 -0700)]
tcg-s390: Convert to new ldst opcodes

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-s390: Integrate endianness into TCGMemOp
Richard Henderson [Sun, 23 Mar 2014 20:24:53 +0000 (13:24 -0700)]
tcg-s390: Integrate endianness into TCGMemOp

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-s390: Convert to TCGMemOp
Richard Henderson [Sun, 23 Mar 2014 20:15:50 +0000 (13:15 -0700)]
tcg-s390: Convert to TCGMemOp

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-s390: Fix off-by-one in wraparound andi
Richard Henderson [Thu, 15 May 2014 04:09:47 +0000 (00:09 -0400)]
tcg-s390: Fix off-by-one in wraparound andi

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg: Fix tcg_reg_alloc_mov vs no-op truncation
Richard Henderson [Tue, 13 May 2014 21:50:18 +0000 (14:50 -0700)]
tcg: Fix tcg_reg_alloc_mov vs no-op truncation

Commit af3cbfbe8018ccc16fb3a0048e928f66f0d05e87 hoisted some "common"
loads of the temporary type, forgetting that the types could differ
during truncating moves.  This affects the correctness of the memory
offset on big-endian hosts.

Tested-by: Tom Musta <tommusta@gmail.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agousb: fix up post load checks
Michael S. Tsirkin [Tue, 13 May 2014 09:33:16 +0000 (12:33 +0300)]
usb: fix up post load checks

Correct post load checks:
1. dev->setup_len == sizeof(dev->data_buf)
    seems fine, no need to fail migration
2. When state is DATA, passing index > len
   will cause memcpy with negative length,
   resulting in heap overflow

First of the issues was reported by dgilbert.

Reported-by: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
10 years agomigration: show average throughput when migration finishes
Peter Lieven [Mon, 12 May 2014 08:46:00 +0000 (10:46 +0200)]
migration: show average throughput when migration finishes

currently the value of the throughput field contains whatever
was the last calculated throughput shortly before the migration
finished.

This patch updates the post migration contents of the field to
the average throughput.

Signed-off-by: Peter Lieven <pl@kamp.de>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
10 years agosavevm: Remove all the unneeded version_minimum_id_old (rest)
Juan Quintela [Wed, 16 Apr 2014 14:01:33 +0000 (16:01 +0200)]
savevm: Remove all the unneeded version_minimum_id_old (rest)

After previous Peter patch, they are redundant.  This way we don't
assign them except when needed.  Once there, there were lots of case
where the ".fields" indentation was wrong:

     .fields = (VMStateField []) {
and
     .fields =      (VMStateField []) {

Change all the combinations to:

     .fields = (VMStateField[]){

The biggest problem (appart from aesthetics) was that checkpatch complained
when we copy&pasted the code from one place to another.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
10 years agosavevm: Remove all the unneeded version_minimum_id_old (usb)
Juan Quintela [Wed, 16 Apr 2014 11:31:26 +0000 (13:31 +0200)]
savevm: Remove all the unneeded version_minimum_id_old (usb)

After previous Peter patch, they are redundant.  This way we don't
assign them except when needed.  Once there, there were lots of case
where the ".fields" indentation was wrong:

     .fields = (VMStateField []) {
and
     .fields =      (VMStateField []) {

Change all the combinations to:

     .fields = (VMStateField[]){

The biggest problem (appart from aesthetics) was that checkpatch complained
when we copy&pasted the code from one place to another.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoSplit ram_save_block
Dr. David Alan Gilbert [Fri, 9 May 2014 10:54:55 +0000 (11:54 +0100)]
Split ram_save_block

ram_save_block is getting a bit too complicated, and does two separate
things:
   1) Finds a page to send
   2) Sends the page (dealing with compression etc)

Split into 'ram_save_page' to send the page and deal with compression (2)
Rename remaining function to 'ram_find_and_save_block'

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
10 years agoarch_init: Simplify code for load_xbzrle()
Chen Gang [Sat, 10 May 2014 12:51:24 +0000 (20:51 +0800)]
arch_init: Simplify code for load_xbzrle()

For xbzrle_decode_buffer(), when decoding contents will exceed writing
buffer, it will return -1, so need not check the return value whether
large than writing buffer.

And when failure occurs within load_xbzrle(), it always return -1
without any resources which need release.

So can remove the related checking statements, and also can remove 'rc'
and 'ret' local variables,

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
10 years agoMerge remote-tracking branch 'remotes/rth/fix-i386' into staging
Peter Maydell [Tue, 13 May 2014 17:36:18 +0000 (18:36 +0100)]
Merge remote-tracking branch 'remotes/rth/fix-i386' into staging

* remotes/rth/fix-i386:
  exec-all.h: Use stl_le_p instead of stl_p patching x86

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoexec-all.h: Use stl_le_p instead of stl_p patching x86
Richard Henderson [Tue, 13 May 2014 17:16:07 +0000 (10:16 -0700)]
exec-all.h: Use stl_le_p instead of stl_p patching x86

We got the wrong version of stl_p, the one that bswaps as appropriate
for the target.  Since x86 is always little-endian, the "_le_" routine
will resolve to what we want.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agohw/arm/omap_gpmc: Avoid buffer overrun filling prefetch FIFO
Peter Maydell [Tue, 13 May 2014 15:09:39 +0000 (16:09 +0100)]
hw/arm/omap_gpmc: Avoid buffer overrun filling prefetch FIFO

In fill_prefetch_fifo(), if the device we are reading from is 16 bit,
then we must not try to transfer an odd number of bytes into the FIFO.
This could otherwise have resulted in our overrunning the prefetch.fifo
array by one byte.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
10 years agohw/arm/stellaris: Correct handling of GPTM TAR register
Peter Maydell [Tue, 13 May 2014 15:09:39 +0000 (16:09 +0100)]
hw/arm/stellaris: Correct handling of GPTM TAR register

We don't implement very much of the GPTM TAR register, and what we
do is wrong. The "are we in RT mode?" field is in s->config, not
s->control. Correct this, use LOG_UNIMP rather than hw_error()
for the cases we don't support, and avoid an unlabelled fallthrough
that makes Coverity complain.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
10 years agohw/timer/exynos4210_mct: Avoid overflow in exynos4210_ltick_recalc_count
Peter Maydell [Tue, 13 May 2014 15:09:39 +0000 (16:09 +0100)]
hw/timer/exynos4210_mct: Avoid overflow in exynos4210_ltick_recalc_count

Add casts to avoid potentially overflowing the multiplications
of 32 bit quantities in exynos4210_ltick_recalc_count().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
10 years agohw/dma/omap_dma: Add (uint32_t) casts when shifting uint16_t by 16
Peter Maydell [Tue, 13 May 2014 15:09:39 +0000 (16:09 +0100)]
hw/dma/omap_dma: Add (uint32_t) casts when shifting uint16_t by 16

Add missing (uint32_t) casts in cases where we're trying to
put a uint16_t value into the top half of a 32-bit field.
These were already present in some but not all places.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
10 years agohw/arm/omap1: Avoid unintended sign extension writing omap_rtc YEARS_REG
Peter Maydell [Tue, 13 May 2014 15:09:39 +0000 (16:09 +0100)]
hw/arm/omap1: Avoid unintended sign extension writing omap_rtc YEARS_REG

When writing to the YEARS_REG register, if the year value is
99 then the multiplication by 31536000 will overflow into
the sign bit of a 32 bit value and then be erroneously
sign-extended if time_t is 64 bits. Add a cast to avoid this.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
10 years agohw/net/cadence_gem: Remove dead code
Peter Maydell [Tue, 13 May 2014 15:09:38 +0000 (16:09 +0100)]
hw/net/cadence_gem: Remove dead code

Commit 191946c moved the code to handle padding to minimum
length from after the handling of the CRC to before it.
This means that the CRC code doesn't need to cope with the
possibility that the size is less than 60; remove this
dead code.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
10 years agohw/intc/allwinner-a10-pic: Add missing 'break'
Peter Maydell [Tue, 13 May 2014 15:09:38 +0000 (16:09 +0100)]
hw/intc/allwinner-a10-pic: Add missing 'break'

Add missing 'break' after handling of AW_A10_PIC_BASE_ADDR write.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
10 years agotarget-arm/helper.c: Don't flush the TLB if SCTLR is rewritten unchanged
Peter Maydell [Tue, 13 May 2014 15:09:38 +0000 (16:09 +0100)]
target-arm/helper.c: Don't flush the TLB if SCTLR is rewritten unchanged

Linux makes a habit of writing the same value to the SCTLR that it
already holds. In a sample boot of the kernel to a shell prompt
it wrote the SCTLR with the value it already held 325465 times,
and wrote different values just 3 times.

Skip flushing the TLB if the SCTLR value isn't actually being changed;
this speeds up my sample boot by 3-5%.

Reported-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Reviewed-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1399560029-19007-1-git-send-email-peter.maydell@linaro.org

10 years agohw/net/stellaris_enet: Convert to vmstate
Peter Maydell [Tue, 13 May 2014 15:09:38 +0000 (16:09 +0100)]
hw/net/stellaris_enet: Convert to vmstate

Convert this device to use vmstate for its save/load, including
providing a post_load function that sanitizes inbound data to
avoid possible buffer overflows if it is malicious.

The sanitizing fixes CVE-2013-4532 (though nobody should be
relying on the security properties of most of the unmaintained
ARM board models anyway, and migration doesn't actually
work on this board due to issues in other device models).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
10 years agohw/net/stellaris_enet: Get rid of rx_fifo pointer
Peter Maydell [Tue, 13 May 2014 15:09:37 +0000 (16:09 +0100)]
hw/net/stellaris_enet: Get rid of rx_fifo pointer

The rx_fifo pointer is awkward to migrate, and is actually
redundant since it is always possible to determine it from
the current rx[].len/.data and rx_fifo_len. Remove both
rx_fifo and rx_fifo_len from the state, replacing them with
a simple rx_fifo_offset which points at the current location
in the RX fifo.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
10 years agohw/net/stellaris_enet: Fix debug format strings
Peter Maydell [Tue, 13 May 2014 15:09:37 +0000 (16:09 +0100)]
hw/net/stellaris_enet: Fix debug format strings

Fix various debug format strings which were incorrect for the
data type, so that building with debug enabled is possible.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
10 years agohw/net/stellaris_enet: Correctly implement the TR and THR registers
Peter Maydell [Tue, 13 May 2014 15:09:37 +0000 (16:09 +0100)]
hw/net/stellaris_enet: Correctly implement the TR and THR registers

Packet transmission for the stellaris ethernet controller can be triggered
in one of two ways:
 * by setting a threshold value in the THR register; when the FIFO
   fill level reaches the threshold, the h/w starts transmitting.
   Software has to finish filling the FIFO before the transmit
   process completes to avoid a (silent) underrun
 * by software writing to the TR register to explicitly trigger
   transmission

Since QEMU transmits packets instantaneously (from the guest's
point of view), implement "transmit based on threshold" with
our existing mechanism of "transmit as soon as we have the whole
packet", with the additional wrinkle that we don't transmit if
the packet size is below the specified threshold, and implement
"transmit by specific request" properly.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
10 years agohw/net/stellaris_enet: Rewrite tx fifo handling code
Peter Maydell [Tue, 13 May 2014 15:09:36 +0000 (16:09 +0100)]
hw/net/stellaris_enet: Rewrite tx fifo handling code

The datasheet is clear that the frame length written to the DATA
register is actually stored in the TX FIFO; this means we don't
need to keep both tx_frame_len and tx_fifo_len state separately.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
10 years agohw/net/stellaris_enet: Correct handling of packet padding
Peter Maydell [Tue, 13 May 2014 15:09:36 +0000 (16:09 +0100)]
hw/net/stellaris_enet: Correct handling of packet padding

The PADEN bit in the transmit control register enables padding of short
data packets out to the required minimum length. However a typo here
meant we were adjusting tx_fifo_len rather than tx_frame_len, so the
padding didn't actually happen. Fix this bug.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Cc: qemu-stable@nongnu.org
10 years agohw/net/stellaris_enet: Restructure tx_fifo code to avoid buffer overrun
Peter Maydell [Tue, 13 May 2014 15:09:36 +0000 (16:09 +0100)]
hw/net/stellaris_enet: Restructure tx_fifo code to avoid buffer overrun

The current tx_fifo code has a corner case where the guest can overrun
the fifo buffer: if automatic CRCs are disabled we allow the guest to write
the CRC word even if there isn't actually space for it in the FIFO.
The datasheet is unclear about exactly how the hardware deals with this
situation; the most plausible answer seems to be that the CRC word is
just lost.

Implement this fix by separating the "can we stuff another word in the
FIFO" logic from the "should we transmit the packet now" check. This
also moves us closer to the real hardware, which has a number of ways
it can be configured to trigger sending the packet, some of which we
don't implement.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Cc: qemu-stable@nongnu.org
10 years agosavevm: Remove all the unneeded version_minimum_id_old (arm)
Juan Quintela [Tue, 13 May 2014 15:09:35 +0000 (16:09 +0100)]
savevm: Remove all the unneeded version_minimum_id_old (arm)

After commit 767adce2d, they are redundant.  This way we don't assign them
except when needed.  Once there, there were lots of cases where the ".fields"
indentation was wrong:

     .fields = (VMStateField []) {
and
     .fields =      (VMStateField []) {

Change all the combinations to:

     .fields = (VMStateField[]){

The biggest problem (apart from aesthetics) was that checkpatch complained
when we copy&pasted the code from one place to another.

Signed-off-by: Juan Quintela <quintela@redhat.com>
[PMM: fixed minor conflict, corrected commit message typos]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agodisas/libvixl: Update to libvixl 1.4
Peter Maydell [Tue, 13 May 2014 15:09:35 +0000 (16:09 +0100)]
disas/libvixl: Update to libvixl 1.4

Update our copy of libvixl to upstream's 1.4 release.
Note that we no longer need any local fixes for compilation
on 32 bit hosts -- they have all been integrated upstream.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1399040419-9227-1-git-send-email-peter.maydell@linaro.org
Acked-by: Richard Henderson <rth@twiddle.net>
10 years agoMerge remote-tracking branch 'remotes/rth/tags/pull-tcg-20140512' into staging
Peter Maydell [Tue, 13 May 2014 12:16:37 +0000 (13:16 +0100)]
Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20140512' into staging

tcg updates for 20140512

# gpg: Signature made Tue 13 May 2014 00:19:56 BST using RSA key ID 4DD0279B
# gpg: Can't check signature: public key not found

* remotes/rth/tags/pull-tcg-20140512: (26 commits)
  tcg: Remove unreachable code in tcg_out_op and op_defs
  tcg: Use tcg_target_available_regs in tcg_reg_alloc_mov
  tcg: Make call address a constant parameter
  tci: Create tcg_out_call
  tcg-mips: Split out tcg_out_call
  tcg-sparc: Create tcg_out_call
  tcg-ppc64: Rename tcg_out_calli to tcg_out_call
  tcg-ppc: Split out tcg_out_call
  tcg-s390: Rename tgen_calli to tcg_out_call
  tcg-i386: Rename tcg_out_calli to tcg_out_call
  tcg: Require TCG_TARGET_INSN_UNIT_SIZE
  tci: Define TCG_TARGET_INSN_UNIT_SIZE
  tcg-mips: Define TCG_TARGET_INSN_UNIT_SIZE
  tcg-ia64: Define TCG_TARGET_INSN_UNIT_SIZE
  tcg-s390: Define TCG_TARGET_INSN_UNIT_SIZE
  tcg-aarch64: Define TCG_TARGET_INSN_UNIT_SIZE
  tcg-arm: Define TCG_TARGET_INSN_UNIT_SIZE
  tcg-sparc: Define TCG_TARGET_INSN_UNIT_SIZE
  tcg-ppc: Define TCG_TARGET_INSN_UNIT_SIZE
  tcg-ppc64: Define TCG_TARGET_INSN_UNIT_SIZE
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agobsd-user: Remove reference to CONFIG_UNAME_RELEASE
Peter Maydell [Fri, 9 May 2014 15:06:41 +0000 (16:06 +0100)]
bsd-user: Remove reference to CONFIG_UNAME_RELEASE

Commit e586822a5 broke the bsd-user build when it removed the
CONFIG_UNAME_RELEASE define but forgot to remove the use of it
in bsd-user. Fix this in the simplest possible way (bsd-user
doesn't make any use at all of the qemu_uname_release variable
except to allow it to be pointlessly set by the user, so this
is all we need to do.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1399648001-20980-1-git-send-email-peter.maydell@linaro.org

10 years agopc: port 92 reset requires a low->high transition
Paolo Bonzini [Tue, 5 Mar 2013 14:04:36 +0000 (15:04 +0100)]
pc: port 92 reset requires a low->high transition

The PIIX datasheet says that "before another INIT pulse can be
generated via [port 92h], [bit 0] must be written back to a
zero.

This bug is masked right now because a full reset will clear the
value of port 92h.  But once we implement soft reset correctly,
the next attempt to enable the A20 line by setting bit 1 (and
leaving the others untouched) will cause another reset.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agocpu: make CPU_INTERRUPT_RESET available on all targets
Paolo Bonzini [Tue, 5 Mar 2013 14:35:17 +0000 (15:35 +0100)]
cpu: make CPU_INTERRUPT_RESET available on all targets

On the x86, some devices need access to the CPU reset pin (INIT#).
Provide a generic service to do this, using one of the internal
cpu_interrupt targets.  Generalize the PPC-specific code for
CPU_INTERRUPT_RESET to other targets.

Since PPC does not support migration across QEMU versions (its
machine types are not versioned yet), I picked the value that
is used on x86, CPU_INTERRUPT_TGT_INT_1.  Consequently, TGT_INT_2
and TGT_INT_3 are shifted down by one while keeping their value.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agoapic: do not accept SIPI on the bootstrap processor
Paolo Bonzini [Tue, 19 Mar 2013 13:17:18 +0000 (14:17 +0100)]
apic: do not accept SIPI on the bootstrap processor

SIPI interrupts are ignored on the bootstrap.  Never accept one.

Cc: Andreas Faerber <afaerber@suse.de>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: preserve FPU and MSR state on INIT
Paolo Bonzini [Tue, 12 Mar 2013 12:16:28 +0000 (13:16 +0100)]
target-i386: preserve FPU and MSR state on INIT

Most MSRs, plus the FPU, MMX, MXCSR, XMM and YMM registers should not
be zeroed on INIT (Table 9-1 in the Intel SDM).  Copy them out of
CPUX86State and back in, instead of special casing env->pat.

The relevant fields are already consecutive except PAT and SMBASE.
However:

- KVM and Hyper-V MSRs should be reset because they include memory
locations written by the hypervisor.  These MSRs are moved together
at the end of the preserved area.

- SVM state can be moved out of the way since it is written by VMRUN.

Cc: Andreas Faerber <afaerber@suse.de>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: fix set of registers zeroed on reset
Paolo Bonzini [Tue, 29 Apr 2014 11:10:05 +0000 (13:10 +0200)]
target-i386: fix set of registers zeroed on reset

BND0-3, BNDCFGU, BNDCFGS, BNDSTATUS were not zeroed on reset, but they
should be (Intel Instruction Set Extensions Programming Reference
319433-015, pages 9-4 and 9-6).  Same for YMM.

XCR0 should be reset to 1.

TSC and TSC_RESET were zeroed already by the memset, remove the explicit
assignments.

Cc: Andreas Faerber <afaerber@suse.de>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agokvm: forward INIT signals coming from the chipset
Paolo Bonzini [Fri, 8 Mar 2013 18:21:50 +0000 (19:21 +0100)]
kvm: forward INIT signals coming from the chipset

Reviewed-by: Gleb Natapov <gnatapov@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agokvm: reset state from the CPU's reset method
Paolo Bonzini [Wed, 20 Mar 2013 12:11:56 +0000 (13:11 +0100)]
kvm: reset state from the CPU's reset method

Now that we have a CPU object with a reset method, it is better to
keep the KVM reset close to the CPU reset.  Using qemu_register_reset
as we do now keeps them far apart.

With this patch, PPC no longer calls the kvm_arch_ function, so
it can get removed there.  Other arches call it from their CPU
reset handler, and the function gets an ARMCPU/X86CPU/S390CPU.

Note that ARM- and s390-specific functions are called kvm_arm_*
and kvm_s390_*, while x86-specific functions are called kvm_arch_*.
That follows the convention used by the different architectures.
Changing that is the topic of a separate patch.

Reviewed-by: Gleb Natapov <gnatapov@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: the x86 CPL is stored in CS.selector - auto update hflags accordingly.
Kevin O'Connor [Tue, 29 Apr 2014 20:38:59 +0000 (16:38 -0400)]
target-i386: the x86 CPL is stored in CS.selector - auto update hflags accordingly.

Instead of manually calling cpu_x86_set_cpl() when the CPL changes,
check for CPL changes on calls to cpu_x86_load_seg_cache(R_CS).  Every
location that called cpu_x86_set_cpl() also called
cpu_x86_load_seg_cache(R_CS), so cpu_x86_set_cpl() is no longer
required.

This fixes the SMM handler code as it was not setting/restoring the
CPL level manually.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: set eflags prior to calling cpu_x86_load_seg_cache() in seg_helper.c
Kevin O'Connor [Tue, 29 Apr 2014 20:38:31 +0000 (16:38 -0400)]
target-i386: set eflags prior to calling cpu_x86_load_seg_cache() in seg_helper.c

The cpu_x86_load_seg_cache() function inspects eflags, so make sure
all changes to eflags are done prior to loading the segment caches.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: set eflags and cr0 prior to calling cpu_x86_load_seg_cache() in smm_helper.c
Kevin O'Connor [Tue, 29 Apr 2014 20:38:10 +0000 (16:38 -0400)]
target-i386: set eflags and cr0 prior to calling cpu_x86_load_seg_cache() in smm_helper.c

The cpu_x86_load_seg_cache() function inspects cr0 and eflags, so make
sure all changes to eflags and cr0 are done prior to loading the
segment caches.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: set eflags prior to calling svm_load_seg_cache() in svm_helper.c
Kevin O'Connor [Tue, 29 Apr 2014 20:37:50 +0000 (16:37 -0400)]
target-i386: set eflags prior to calling svm_load_seg_cache() in svm_helper.c

The svm_load_seg_cache() function calls cpu_x86_load_seg_cache() which
inspects env->eflags.  So, make sure all changes to eflags are done
prior to loading the segment cache.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agopci-assign: limit # of msix vectors
Michael S. Tsirkin [Mon, 28 Apr 2014 14:02:21 +0000 (17:02 +0300)]
pci-assign: limit # of msix vectors

KVM only supports MSIX table size up to 256 vectors,
but some assigned devices support more vectors,
at the moment attempts to assign them fail with EINVAL.

Tweak the MSIX capability exposed to guest to limit table size
to a supported value.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Gonglei <arei.gonglei@huawei.com>
Cc: qemu-stable@nongnu.org
Acked-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>