]> git.proxmox.com Git - mirror_qemu.git/log
mirror_qemu.git
5 years agotarget/arm: Fix non-parallel expansion of CASP
Richard Henderson [Mon, 25 Mar 2019 14:16:46 +0000 (14:16 +0000)]
target/arm: Fix non-parallel expansion of CASP

The second word has been loaded from the unincremented
address since the first commit.

Fixes: 44ac14b06fa
Reported-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20190322234302.12770-1-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/elmarco/tags/slirp-pull-request' into staging
Peter Maydell [Mon, 25 Mar 2019 07:59:40 +0000 (07:59 +0000)]
Merge remote-tracking branch 'remotes/elmarco/tags/slirp-pull-request' into staging

slirp: clarify license of slirp as BSD-3

# gpg: Signature made Fri 22 Mar 2019 19:16:50 GMT
# gpg:                using RSA key DAE8E10975969CE5
# gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" [full]
# gpg:                 aka "Marc-André Lureau <marcandre.lureau@gmail.com>" [full]
# Primary key fingerprint: 87A9 BD93 3F87 C606 D276  F62D DAE8 E109 7596 9CE5

* remotes/elmarco/tags/slirp-pull-request:
  slirp: is not maintained by Kelly Price for a long time
  slirp: remove reference to COPYRIGHT file
  slirp: clarify license of slirp files using SPDX: implicit via unstated
  slirp: clarify license of slirp files using SPDX: implicit via COPYRIGHT
  slirp: clarify license of slirp files using SPDX: explicit MIT
  slirp: clarify license of slirp files using SPDX: explicit BSD
  slirp: relicense GPL files to BSD-3
  slirp: update COPYRIGHT to use full 3-Clause BSD License

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoslirp: is not maintained by Kelly Price for a long time
Marc-André Lureau [Wed, 13 Mar 2019 16:30:45 +0000 (17:30 +0100)]
slirp: is not maintained by Kelly Price for a long time

slirp has been maintained by the QEMU maintainers and will be
maintained under an independent project soon.

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kelly Price <strredwolf@gmail.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
5 years agoslirp: remove reference to COPYRIGHT file
Marc-André Lureau [Wed, 13 Mar 2019 16:03:47 +0000 (17:03 +0100)]
slirp: remove reference to COPYRIGHT file

The slirp COPYRIGHT file is a BSD-3 license. Instead of referring to
another project file, the SPDX license notice present in all source
files states that unequivocally.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
5 years agoslirp: clarify license of slirp files using SPDX: implicit via unstated
Marc-André Lureau [Wed, 13 Mar 2019 15:56:07 +0000 (16:56 +0100)]
slirp: clarify license of slirp files using SPDX: implicit via unstated

Add SPDX license identifier to clarify the license of files without
explicit license header.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
5 years agoslirp: clarify license of slirp files using SPDX: implicit via COPYRIGHT
Marc-André Lureau [Wed, 13 Mar 2019 15:56:07 +0000 (16:56 +0100)]
slirp: clarify license of slirp files using SPDX: implicit via COPYRIGHT

Add SPDX license identifier to clarify the license of files with
reference to BSD license from slirp COPYRIGHT file.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
5 years agoslirp: clarify license of slirp files using SPDX: explicit MIT
Marc-André Lureau [Wed, 13 Mar 2019 15:56:07 +0000 (16:56 +0100)]
slirp: clarify license of slirp files using SPDX: explicit MIT

Add SPDX license identifier to clarify the license of files with
explicit MIT license header.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
5 years agoslirp: clarify license of slirp files using SPDX: explicit BSD
Marc-André Lureau [Wed, 13 Mar 2019 15:56:07 +0000 (16:56 +0100)]
slirp: clarify license of slirp files using SPDX: explicit BSD

Add SPDX license identifier to clarify the license of files with
explicit 3-clause BSD license header.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
5 years agoslirp: relicense GPL files to BSD-3
Marc-André Lureau [Mon, 11 Mar 2019 18:10:14 +0000 (19:10 +0100)]
slirp: relicense GPL files to BSD-3

In order to make slirp a standalone project, the project must have a
clear license, and be compatible with the GPL or LGPL.

Since commit 2f5f89963186d42a7ded253bc6cf5b32abb45cec ("Remove the
advertising clause from the slirp license"), slirp is BSD-3. But new
files have been added under slirp/ with QEMU GPL license since then.

The copyright holders have been asked to relicense files to BSD-3 and
gave their permission:

- slirp/dhcpv6.{c,h}

Subject: Re: Clearing slirp/ license
To: "Marc-André Lureau" <marcandre.lureau@gmail.com>, QEMU <qemu-devel@nongnu.org>, Thomas Huth <thuth@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>, Samuel Thibault <samuel.thibault@ens-lyon.org>
References: <CAJ+F1CKBRNdLPb_wOLhURdUJd-j1RHY2toKSTEhCBt_zs4Xk1w@mail.gmail.com>
From: "Cédric Le Goater" <clg@kaod.org>
Message-ID: <e942cdab-fe1b-fdf4-3b9f-da16a4afa953@kaod.org>
Date: Mon, 11 Mar 2019 16:23:25 +0100

> Could you reply that you have no objection in relicensing those files
> are 3-Clause BSD?

Fine for me. You can change the license of slirp/ncsi.c and
slirp/ncsi-pkt.hto a 3-Clause BSD.

Thanks,

C.

Subject: Re: [Qemu-devel] Clearing slirp/ license
To: Peter Maydell <peter.maydell@linaro.org>, Shan Gavin <shan.gavin@gmail.com>
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>, "Marc-André Lureau" <marcandre.lureau@gmail.com>, Gavin Shan <gwshan@linux.vnet.ibm.com>, Thomas Huth <thuth@redhat.com>, QEMU <qemu-devel@nongnu.org>, Samuel Thibault <samuel.thibault@ens-lyon.org>
References: <CAJ+F1CKBRNdLPb_wOLhURdUJd-j1RHY2toKSTEhCBt_zs4Xk1w@mail.gmail.com> <e942cdab-fe1b-fdf4-3b9f-da16a4afa953@kaod.org> <CAJ+F1C+hFfsa5gcSdttTP5J+uyDvNdYJWrm9OJM26+Zc1ZQkew@mail.gmail.com> <cc62e1fd-c564-e1b7-d10c-30665b481352@ozlabs.ru> <CAOL5TwkQXhPjdPP9v7n7mxAVxbDCSo6MEaG+E-Xys=MoD_pg2g@mail.gmail.com> <CAFEAcA_g=L2LSo=B_5dpJhJJrqFiOb6sswMVohQwpVGiKi_A7w@mail.gmail.com>
From: "Cédric Le Goater" <clg@kaod.org>
Message-ID: <4ddf6031-0df1-b3b5-965e-a181266e42b0@kaod.org>
Date: Tue, 12 Mar 2019 11:49:21 +0100

> Is the code in question copyright you personally, or copyright
> IBM as your employer at the time ? If the latter, it is IBM that
> would need to approve the relicensing.

That was done. I had our legal team approve the change of license.

Thanks,

C.

From: Shan Gavin <shan.gavin@gmail.com>
Date: Tue, 12 Mar 2019 15:04:54 +0800
Message-ID: <CAOL5TwkQXhPjdPP9v7n7mxAVxbDCSo6MEaG+E-Xys=MoD_pg2g@mail.gmail.com>
Subject: Re: [Qemu-devel] Clearing slirp/ license
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: "Marc-André Lureau" <marcandre.lureau@gmail.com>, "Cédric Le Goater" <clg@kaod.org>, gwshan@linux.vnet.ibm.com, Peter Maydell <peter.maydell@linaro.org>, Thomas Huth <thuth@redhat.com>, QEMU <qemu-devel@nongnu.org>, Samuel Thibault <samuel.thibault@ens-lyon.org>
> Gavin, could you reply that you have no objection in relicensing
> ncsi-pkt.h as 3-Clause BSD?

No objection. Please go ahead with the relicensing.

Cheers,
Gavin

- ncsi.c, ncsi-pkt.h

Subject: Re: Clearing slirp/ license
To: "Marc-André Lureau" <marcandre.lureau@gmail.com>, QEMU <qemu-devel@nongnu.org>, "Cédric Le Goater" <clg@kaod.org>
Cc: Peter Maydell <peter.maydell@linaro.org>, Samuel Thibault <samuel.thibault@ens-lyon.org>
References: <CAJ+F1CKBRNdLPb_wOLhURdUJd-j1RHY2toKSTEhCBt_zs4Xk1w@mail.gmail.com>
From: Thomas Huth <thuth@redhat.com>
Message-ID: <ed5a9f55-f2e5-298d-58ac-414759e9b491@redhat.com>
Date: Wed, 13 Feb 2019 12:30:32 +0100

> Could you reply that you have no objection in relicensing those files
> are 3-Clause BSD?

Ok, for the records: I'm fine if you change the license of dhcpv6.[ch]
to either 3-Clause BSD or 2-Clause BSD.

 Thomas

- vmstate.{c,h}

From: Juan Quintela <quintela@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@gmail.com>
Cc: QEMU <qemu-devel@nongnu.org>, Peter Maydell <peter.maydell@linaro.org>, Samuel Thibault <samuel.thibault@ens-lyon.org>
Subject: Re: Clearing slirp/ license
Date: Tue, 12 Mar 2019 12:43:17 +0100
Message-ID: <87k1h4qpwq.fsf@trasno.org>

> Juan, Could you reply that you have no objection in relicensing the
> vmstate files as 3-Clause BSD?

No problem at all on my side.

Later, Juan.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[ for the NC-SI files ]
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Acked-by: Thomas Huth <thuth@redhat.com>
5 years agoslirp: update COPYRIGHT to use full 3-Clause BSD License
Marc-André Lureau [Thu, 14 Mar 2019 11:51:28 +0000 (12:51 +0100)]
slirp: update COPYRIGHT to use full 3-Clause BSD License

According to commit 2f5f89963186d42a7ded253bc6cf5b32abb45cec ("Remove
the advertising clause from the slirp license"), Danny Gasparovski
gave permission to license slirp code under 3-clause BSD license:

    Subject: RE: Slirp license
    Date: Thu, 8 Jan 2009 10:51:00 +1100
    From: "Gasparovski, Daniel" <Daniel.Gasparovski@ato.gov.au>
    To: "Richard Fontana" <rfontana@redhat.com>

    I have no objection to having Slirp code in QEMU be licensed under
    the 3-clause BSD license.

slirp/COPYRIGHT's initial version in 2004 (commit 5fafdf24) listed
only 3 clauses BUT used the poisonous advertising clause for clause 3
which is the controversial clause of non-free 4-clause (that is, it
appears that the BSD-4 license was copied, and then the WRONG clause
was deleted, when creating COPYRIGHT.  Perhaps explained as an easy
mistake to make since 3-clause was created by removing clause 3 of the
4-clause, where you sometimes see the three-clause version with
clauses 1, 2, 4; but more commonly see a renumbered version with
clauses 1, 2, 3 to close the gap. If you pay attention only to clause
numbers instead of content, it can be easy to confuse which clause to
delete to go from 4-clause to 3-clause).

Commit 2f5f89963 removed the poisonous wrong clause on
the grounds of moving from 4-clause to 3-clause; but did not add the
missing clause, which makes it LOOK like the 2-clause version.  But I
think we have a decent enough trail showing the intent for 3-clause.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
5 years agoMerge remote-tracking branch 'remotes/ehabkost/tags/x86-next-pull-request' into staging
Peter Maydell [Fri, 22 Mar 2019 09:37:38 +0000 (09:37 +0000)]
Merge remote-tracking branch 'remotes/ehabkost/tags/x86-next-pull-request' into staging

x86 queue for -rc1

A few fixes that missed -rc0:
* CPU model documentation updates (Daniel P. Berrangé)
* Fix bogus OSPKE warnings (Eduardo Habkost)
* Work around KVM bugs when handing arch_capabilities
  (Eduardo Habkost)

# gpg: Signature made Thu 21 Mar 2019 19:32:02 GMT
# gpg:                using RSA key 2807936F984DC5A6
# gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full]
# Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6

* remotes/ehabkost/tags/x86-next-pull-request:
  docs: add note about stibp CPU feature for spectre v2
  docs: clarify that spec-ctrl is only needed for Spectre v2
  i386: Disable OSPKE on CPU model definitions
  i386: Make arch_capabilities migratable
  i386: kvm: Disable arch_capabilities if MSR can't be set

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/berrange/tags/authz-next-pull-request' into...
Peter Maydell [Thu, 21 Mar 2019 13:02:15 +0000 (13:02 +0000)]
Merge remote-tracking branch 'remotes/berrange/tags/authz-next-pull-request' into staging

Fix object interface check macro usage

# gpg: Signature made Thu 21 Mar 2019 11:53:15 GMT
# gpg:                using RSA key BE86EBB415104FDF
# gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>" [full]
# gpg:                 aka "Daniel P. Berrange <berrange@redhat.com>" [full]
# Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E  8E3F BE86 EBB4 1510 4FDF

* remotes/berrange/tags/authz-next-pull-request:
  authz: Use OBJECT_CHECK() on objects

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/berrange/tags/qcrypto-next-pull-request' into...
Peter Maydell [Thu, 21 Mar 2019 12:09:38 +0000 (12:09 +0000)]
Merge remote-tracking branch 'remotes/berrange/tags/qcrypto-next-pull-request' into staging

Avoid struct packing warnings with gcc9

# gpg: Signature made Thu 21 Mar 2019 11:55:03 GMT
# gpg:                using RSA key BE86EBB415104FDF
# gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>" [full]
# gpg:                 aka "Daniel P. Berrange <berrange@redhat.com>" [full]
# Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E  8E3F BE86 EBB4 1510 4FDF

* remotes/berrange/tags/qcrypto-next-pull-request:
  crypto/block: remove redundant struct packing to fix build with gcc 9

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agocrypto/block: remove redundant struct packing to fix build with gcc 9
Greg Kurz [Thu, 28 Feb 2019 15:06:06 +0000 (16:06 +0100)]
crypto/block: remove redundant struct packing to fix build with gcc 9

Build fails with gcc 9:

crypto/block-luks.c:689:18: error: taking address of packed member of ‘struct QCryptoBlockLUKSHeader’ may result in an unaligned pointer value [-Werror=address-of-packed-member]
  689 |     be32_to_cpus(&luks->header.payload_offset);
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
crypto/block-luks.c:690:18: error: taking address of packed member of ‘struct QCryptoBlockLUKSHeader’ may result in an unaligned pointer value [-Werror=address-of-packed-member]
  690 |     be32_to_cpus(&luks->header.key_bytes);
      |                  ^~~~~~~~~~~~~~~~~~~~~~~
crypto/block-luks.c:691:18: error: taking address of packed member of ‘struct QCryptoBlockLUKSHeader’ may result in an unaligned pointer value [-Werror=address-of-packed-member]
  691 |     be32_to_cpus(&luks->header.master_key_iterations);
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

... a bunch of similar errors...

crypto/block-luks.c:1288:22: error: taking address of packed member of ‘struct QCryptoBlockLUKSKeySlot’ may result in an unaligned pointer value [-Werror=address-of-packed-member]
 1288 |         be32_to_cpus(&luks->header.key_slots[i].stripes);
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

All members of the QCryptoBlockLUKSKeySlot and QCryptoBlockLUKSHeader are
naturally aligned and we already check at build time there isn't any
unwanted padding. Drop the QEMU_PACKED attribute.

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoauthz: Use OBJECT_CHECK() on objects
Philippe Mathieu-Daudé [Fri, 15 Mar 2019 17:12:18 +0000 (18:12 +0100)]
authz: Use OBJECT_CHECK() on objects

TYPE_QAUTHZ is an abstract object of type TYPE_OBJECT. All other
are children of TYPE_QAUTHZ, thus also objects.

Keep INTERFACE_CHECK() for interfaces, and use OBJECT_CHECK() on
objects.

Reported-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoMerge remote-tracking branch 'remotes/berrange/tags/qio-next-pull-request' into staging
Peter Maydell [Thu, 21 Mar 2019 09:33:11 +0000 (09:33 +0000)]
Merge remote-tracking branch 'remotes/berrange/tags/qio-next-pull-request' into staging

Merge I/O patch queue

Fix problem with end of file handling with websock channels

# gpg: Signature made Wed 20 Mar 2019 16:57:15 GMT
# gpg:                using RSA key BE86EBB415104FDF
# gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>" [full]
# gpg:                 aka "Daniel P. Berrange <berrange@redhat.com>" [full]
# Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E  8E3F BE86 EBB4 1510 4FDF

* remotes/berrange/tags/qio-next-pull-request:
  io: fix handling of EOF / error conditions in websock GSource

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoio: fix handling of EOF / error conditions in websock GSource
Daniel P. Berrangé [Wed, 20 Feb 2019 18:22:39 +0000 (18:22 +0000)]
io: fix handling of EOF / error conditions in websock GSource

We were never reporting the G_IO_HUP event when an end of file was hit
on the websocket channel.

We also didn't report G_IO_ERR when we hit a fatal error processing the
websocket protocol.

The latter in particular meant that the chardev code would not notice
when an eof/error was encountered on the websocket channel, unless the
guest OS happened to trigger a write operation.

This meant that once the first client had quit, the chardev would never
listen to accept a new client.

Fixes launchpad bug 1816819
Acked-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agodocs: add note about stibp CPU feature for spectre v2
Daniel P. Berrangé [Thu, 7 Mar 2019 12:18:38 +0000 (12:18 +0000)]
docs: add note about stibp CPU feature for spectre v2

While the stibp CPU feature is not commonly used by guest OS for spectre
mitigation due to its performance impact, it is none the less best
practice to expose it to all guest OS. This allows the guest OS to
decide whether to make use or it.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20190307121838.6345-3-berrange@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agodocs: clarify that spec-ctrl is only needed for Spectre v2
Daniel P. Berrangé [Thu, 7 Mar 2019 12:18:37 +0000 (12:18 +0000)]
docs: clarify that spec-ctrl is only needed for Spectre v2

The docs currently say that the spec-ctrl feature is needed for both
Spectre variants, but it is only used to address Spectre v2. Also
remove the note about retpolines. The guest OS is usually treated
as a blackbox from host mgmt pov, so it won't have knowledge about
use of retpolines and thus should unconditionally expose spec-ctrl,
allowing the guest to decide whether to use it or not.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20190307121838.6345-2-berrange@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agoi386: Disable OSPKE on CPU model definitions
Eduardo Habkost [Tue, 19 Mar 2019 20:05:15 +0000 (17:05 -0300)]
i386: Disable OSPKE on CPU model definitions

Currently, the Cascadelake-Server, Icelake-Client, and
Icelake-Server are always generating the following warning:

  qemu-system-x86_64: warning: \
    host doesn't support requested feature: CPUID.07H:ECX [bit 4]

This happens because OSPKE was never returned by
GET_SUPPORTED_CPUID or x86_cpu_get_supported_feature_word().
OSPKE is a runtime flag automatically set by the KVM module or by
TCG code, was always cleared by x86_cpu_filter_features(), and
was not supposed to appear on the CPU model table.

Remove the OSPKE flag from the CPU model table entries, to avoid
the bogus warning and avoid returning invalid feature data on
query-cpu-* QMP commands.  As OSPKE was always cleared by
x86_cpu_filter_features(), this won't have any guest-visible
impact.

Include a test case that should detect the problem if we introduce
a similar bug again.

Fixes: c7a88b52f62b ("i386: Add new model of Cascadelake-Server")
Fixes: 8a11c62da914 ("i386: Add new CPU model Icelake-{Server,Client}")
Cc: Tao Xu <tao3.xu@intel.com>
Cc: Robert Hoo <robert.hu@linux.intel.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20190319200515.14999-1-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agoi386: Make arch_capabilities migratable
Eduardo Habkost [Fri, 25 Jan 2019 22:06:06 +0000 (20:06 -0200)]
i386: Make arch_capabilities migratable

Now that kvm_arch_get_supported_cpuid() will only return
arch_capabilities if QEMU is able to initialize the MSR properly,
we know that the feature is safely migratable.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20190125220606.4864-3-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agoi386: kvm: Disable arch_capabilities if MSR can't be set
Eduardo Habkost [Fri, 25 Jan 2019 22:06:05 +0000 (20:06 -0200)]
i386: kvm: Disable arch_capabilities if MSR can't be set

KVM has two bugs in the handling of MSR_IA32_ARCH_CAPABILITIES:

1) Linux commit commit 1eaafe91a0df ("kvm: x86: IA32_ARCH_CAPABILITIES
   is always supported") makes GET_SUPPORTED_CPUID return
   arch_capabilities even if running on SVM.  This makes "-cpu
   host,migratable=off" incorrectly expose arch_capabilities on CPUID on
   AMD hosts (where the MSR is not emulated by KVM).

2) KVM_GET_MSR_INDEX_LIST does not return MSR_IA32_ARCH_CAPABILITIES if
   the MSR is not supported by the host CPU.  This makes QEMU not
   initialize the MSR properly at kvm_put_msrs() on those hosts.

Work around both bugs on the QEMU side, by checking if the MSR
was returned by KVM_GET_MSR_INDEX_LIST before returning the
feature flag on kvm_arch_get_supported_cpuid().

This has the unfortunate side effect of making arch_capabilities
unavailable on hosts without hardware support for the MSR until bug #2
is fixed on KVM, but I can't see another way to work around bug #1
without that side effect.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20190125220606.4864-2-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agoUpdate version for v4.0.0-rc0 release
Peter Maydell [Tue, 19 Mar 2019 17:17:22 +0000 (17:17 +0000)]
Update version for v4.0.0-rc0 release

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Peter Maydell [Tue, 19 Mar 2019 16:27:14 +0000 (16:27 +0000)]
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging

Block layer patches:

- mirror: Fix early return from drain (could cause deadlocks)
- vmdk: Fixed probing for version 3 images
- vl: Fix to create migration object before block backends again (fixes
  segfault for block drivers that set migration blockers)
- Several minor fixes, documentation and test case improvements

# gpg: Signature made Tue 19 Mar 2019 14:59:17 GMT
# gpg:                using RSA key 7F09B272C88F2FD6
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full]
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6

* remotes/kevin/tags/for-upstream:
  qemu-iotests: Treat custom TEST_DIR in 051
  blockdev: Check @replaces in blockdev_mirror_common
  block: Make bdrv_{copy_on_read,crypto_luks,replication} static
  blockjob: fix user pause in block_job_error_action
  qemu-iotests: Fix 232 for non-qcow2
  vl: Fix to create migration object before block backends again
  iotests: 153: Wait for an answer to QMP commands
  block: Silence Coverity in bdrv_drop_intermediate()
  vmdk: Support version=3 in VMDK descriptor files
  qapi: fix block-latency-histogram-set description and examples
  qcow2: Fix data file error condition in qcow2_co_create()
  mirror: Confirm we're quiesced only if the job is paused or cancelled

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/aperard/tags/pull-xen-20190319' into staging
Peter Maydell [Tue, 19 Mar 2019 15:47:13 +0000 (15:47 +0000)]
Merge remote-tracking branch 'remotes/aperard/tags/pull-xen-20190319' into staging

Xen queue

Fix a bug on FreeBSD when doing a migration.

# gpg: Signature made Tue 19 Mar 2019 15:40:55 GMT
# gpg:                using RSA key F80C006308E22CFD8A92E7980CF5572FD7FB55AF
# gpg:                issuer "anthony.perard@citrix.com"
# gpg: Good signature from "Anthony PERARD <anthony.perard@gmail.com>" [marginal]
# gpg:                 aka "Anthony PERARD <anthony.perard@citrix.com>" [marginal]
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 5379 2F71 024C 600F 778A  7161 D8D5 7199 DF83 42C8
#      Subkey fingerprint: F80C 0063 08E2 2CFD 8A92  E798 0CF5 572F D7FB 55AF

* remotes/aperard/tags/pull-xen-20190319:
  xen-mapcache: use MAP_FIXED flag so the mmap address hint is always honored

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoxen-mapcache: use MAP_FIXED flag so the mmap address hint is always honored
Roger Pau Monne [Mon, 18 Mar 2019 17:37:31 +0000 (18:37 +0100)]
xen-mapcache: use MAP_FIXED flag so the mmap address hint is always honored

Or if it's not possible to honor the hinted address an error is returned
instead. This makes it easier to spot the actual failure, instead of
failing later on when the caller of xen_remap_bucket realizes the
mapping has not been created at the requested address.

Also note that at least on FreeBSD using MAP_FIXED will cause mmap to
try harder to honor the passed address.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Igor Druzhinin <igor.druzhinin@cirtix.com>
Message-Id: <20190318173731.14494-1-roger.pau@citrix.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
5 years agoqemu-iotests: Treat custom TEST_DIR in 051
Lukáš Doktor [Tue, 19 Mar 2019 14:20:49 +0000 (15:20 +0100)]
qemu-iotests: Treat custom TEST_DIR in 051

When custom TEST_DIR is specified the output includes it without leading
'/':

    $ TEST_DIR=/var/tmp ./check -file -qcow2 051
    ....
-drive0 (NODE_NAME): json:{"backing": {"driver": "qcow2", "file":
{"driver": "file", "filename": "TEST_DIR/t.qcow2"}}, "driver": "qcow2",
"file": {"driver": "file", "filename": SNAPSHOT_PATH}} (qcow2,
read-only)
+drive0 (NODE_NAME): json:{"backing": {"driver": "qcow2", "file":
{"driver": "file", "filename": "TEST_DIR/t.qcow2"}}, "driver": "qcow2",
"file": {"driver": "file", "filename": "TEST_DIR/vl.ziHfeP"}} (qcow2,
read-only)

Let's remove it from the sed regexp.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
5 years agoblockdev: Check @replaces in blockdev_mirror_common
Max Reitz [Wed, 13 Feb 2019 22:53:01 +0000 (23:53 +0100)]
blockdev: Check @replaces in blockdev_mirror_common

There is no reason why the constraints we put on @replaces should be
limited to drive-mirror.  Therefore, move the sanity checks from
qmp_drive_mirror() to blockdev_mirror_common() so they apply to
blockdev-mirror as well.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
5 years agoblock: Make bdrv_{copy_on_read,crypto_luks,replication} static
Alberto Garcia [Mon, 18 Mar 2019 15:48:01 +0000 (17:48 +0200)]
block: Make bdrv_{copy_on_read,crypto_luks,replication} static

Signed-off-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
5 years agoblockjob: fix user pause in block_job_error_action
Vladimir Sementsov-Ogievskiy [Tue, 19 Mar 2019 09:24:42 +0000 (12:24 +0300)]
blockjob: fix user pause in block_job_error_action

Job (especially mirror) may call block_job_error_action several
times before actual pause if it has several in-flight requests.

block_job_error_action will call job_pause more than once in this case,
which lead to following block-job-resume qmp command can't actually
resume the job.

Fix it by do not increase pause level in block_job_error_action if
user_paused already set.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
5 years agoqemu-iotests: Fix 232 for non-qcow2
Kevin Wolf [Mon, 18 Mar 2019 16:42:37 +0000 (17:42 +0100)]
qemu-iotests: Fix 232 for non-qcow2

232 is marked as generic, but commit 12efe428c9e added code that assumes
qcow2. What the new test really needs is backing files and support for
updating the backing file link (.bdrv_change_backing_file).

Split the non-generic code into a new test case 247 and make it work
with qed, too.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
5 years agovl: Fix to create migration object before block backends again
Markus Armbruster [Wed, 13 Mar 2019 08:43:30 +0000 (09:43 +0100)]
vl: Fix to create migration object before block backends again

Recent commit cda4aa9a5a0 moved block backend creation before machine
property evaluation.  This broke qemu-iotests 055.  Turns out we need
to create the migration object before block backends, so block
backends can add migration blockers.  Fix by calling
migration_object_init() earlier, right before configure_blockdev().

Fixes: cda4aa9a5a08777cf13e164c0543bd4888b8adce
Reported-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
5 years agoiotests: 153: Wait for an answer to QMP commands
Sergio Lopez [Fri, 15 Mar 2019 11:46:55 +0000 (12:46 +0100)]
iotests: 153: Wait for an answer to QMP commands

There are various actions in this test that must be executed
sequentially, as the result of it depends on the state triggered by the
previous one.

If the last argument of _send_qemu_cmd() is an empty string, it just
sends the QMP commands without waiting for an answer. While unlikely, it
may happen that the next action in the test gets invoked before QEMU
processes the QMP request.

This issue seems to be easier to reproduce on servers with limited
resources or highly loaded.

With this change, we wait for an answer on all _send_qemu_cmd() calls.

Signed-off-by: Sergio Lopez <slp@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
5 years agoblock: Silence Coverity in bdrv_drop_intermediate()
Kevin Wolf [Fri, 15 Mar 2019 11:15:16 +0000 (12:15 +0100)]
block: Silence Coverity in bdrv_drop_intermediate()

Coverity doesn't like that the return value of bdrv_check_update_perm()
stays unused only in this place (CID 1399710).

Even if checking local_err should be equivalent to checking ret < 0,
let's switch to using the return value to be more consistent (and in
case of a bug somewhere down the call chain, forgetting to assign errp
is more likely than returning 0 for an error case).

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
5 years agovmdk: Support version=3 in VMDK descriptor files
Sam Eiderman [Thu, 14 Mar 2019 14:14:37 +0000 (16:14 +0200)]
vmdk: Support version=3 in VMDK descriptor files

Commit 509d39aa22909c0ed1aabf896865f19c81fb38a1 added support for read
only VMDKs of version 3.

This commit fixes the probe function to correctly handle descriptors of
version 3.

This commit has two effects:
    1. We no longer need to supply '-f vmdk' when pointing to descriptor
       files of version 3 in qemu/qemu-img command line arguments.
    2. This fixes the scenario where a VMDK points to a parent version 3
       descriptor file which is being probed as "raw" instead of "vmdk".

Reviewed-by: Arbel Moshe <arbel.moshe@oracle.com>
Reviewed-by: Mark Kanda <mark.kanda@oracle.com>
Signed-off-by: Shmuel Eiderman <shmuel.eiderman@oracle.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
5 years agoqapi: fix block-latency-histogram-set description and examples
Vladimir Sementsov-Ogievskiy [Thu, 14 Mar 2019 08:52:21 +0000 (11:52 +0300)]
qapi: fix block-latency-histogram-set description and examples

There no @device parameter, only the @id one.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
5 years agoqcow2: Fix data file error condition in qcow2_co_create()
Kevin Wolf [Wed, 13 Mar 2019 14:22:38 +0000 (15:22 +0100)]
qcow2: Fix data file error condition in qcow2_co_create()

We were trying to check whether bdrv_open_blockdev_ref() returned
success, but accidentally checked the wrong variable. Spotted by
Coverity (CID 1399703).

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
5 years agomirror: Confirm we're quiesced only if the job is paused or cancelled
Sergio Lopez [Fri, 8 Mar 2019 15:48:53 +0000 (16:48 +0100)]
mirror: Confirm we're quiesced only if the job is paused or cancelled

While child_job_drained_begin() calls to job_pause(), the job doesn't
actually transition between states until it runs again and reaches a
pause point. This means bdrv_drained_begin() may return with some jobs
using the node still having 'busy == true'.

As a consequence, block_job_detach_aio_context() may get into a
deadlock, waiting for the job to be actually paused, while the coroutine
servicing the job is yielding and doesn't get the opportunity to get
scheduled again. This situation can be reproduced by issuing a
'block-commit' immediately followed by a 'device_del'.

To ensure bdrv_drained_begin() only returns when the jobs have been
paused, we change mirror_drained_poll() to only confirm it's quiesced
when job->paused == true and there aren't any in-flight requests, except
if we reached that point by a drained section initiated by the
mirror/commit job itself.

The other block jobs shouldn't need any changes, as the default
drained_poll() behavior is to only confirm it's quiesced if the job is
not busy or completed.

Signed-off-by: Sergio Lopez <slp@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
5 years agoMerge remote-tracking branch 'remotes/palmer/tags/riscv-for-master-4.0-rc0-2' into...
Peter Maydell [Tue, 19 Mar 2019 12:55:02 +0000 (12:55 +0000)]
Merge remote-tracking branch 'remotes/palmer/tags/riscv-for-master-4.0-rc0-2' into staging

RISC-V Patches for 4.0-rc0, Part 2

This patch set contains three major sources of bug fixes:

* Jim has added support for GDB XML files, as well as fixing access to
  CSRs via the GDB stub.
* Alistair has rebased a large set of fixes from Michael that were still
  in his patch queue.  These fix bugs all over our tree, including:
    * Logging of PMP errors.
    * User ABI cleanups and fixes, most notably on RVE guests.
    * Fixes for interrupt emulation fidelity.
    * Improvements to the emulation fidelity of the sifive_u machine.
* Bin Meng has improved the emulation fidelity of the SiFive UART, which
  now supports both TX and RX interrupts (as well as setting the correct
  interrupt line).

# gpg: Signature made Tue 19 Mar 2019 12:42:11 GMT
# gpg:                using RSA key 00CE76D1834960DFCE886DF8EF4CA1502CCBAB41
# gpg:                issuer "palmer@dabbelt.com"
# gpg: Good signature from "Palmer Dabbelt <palmer@dabbelt.com>" [unknown]
# gpg:                 aka "Palmer Dabbelt <palmer@sifive.com>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 00CE 76D1 8349 60DF CE88  6DF8 EF4C A150 2CCB AB41

* remotes/palmer/tags/riscv-for-master-4.0-rc0-2:
  riscv: sifive_u: Correct UART0's IRQ in the device tree
  riscv: sifive_uart: Generate TX interrupt
  target/riscv: Remove unused struct
  riscv: sifive_u: Allow up to 4 CPUs to be created
  RISC-V: Update load reservation comment in do_interrupt
  RISC-V: Convert trap debugging to trace events
  RISC-V: Add support for vectored interrupts
  RISC-V: Change local interrupts from edge to level
  RISC-V: linux-user support for RVE ABI
  elf: Add RISC-V PSABI ELF header defines
  RISC-V: Remove unnecessary disassembler constraints
  RISC-V: Allow interrupt controllers to claim interrupts
  RISC-V: Replace __builtin_popcount with ctpop8 in PLIC
  riscv: pmp: Log pmp access errors as guest errors
  RISC-V: Add hooks to use the gdb xml files.
  RISC-V: Add debug support for accessing CSRs.
  RISC-V: Fixes to CSR_* register macros.
  RISC-V: Add 64-bit gdb xml files.
  RISC-V: Add 32-bit gdb xml files.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoriscv: sifive_u: Correct UART0's IRQ in the device tree
Bin Meng [Sun, 17 Mar 2019 08:03:11 +0000 (01:03 -0700)]
riscv: sifive_u: Correct UART0's IRQ in the device tree

The UART0's interrupt vector is wrongly set to 1 in the device tree.
Use SIFIVE_U_UART0_IRQ instead.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
5 years agoriscv: sifive_uart: Generate TX interrupt
Bin Meng [Sun, 17 Mar 2019 08:03:10 +0000 (01:03 -0700)]
riscv: sifive_uart: Generate TX interrupt

At present the sifive uart model only generates RX interrupt. This
updates it to generate TX interrupt so that it is more useful.

Note the TX fifo is still unimplemented.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
5 years agotarget/riscv: Remove unused struct
Alistair Francis [Sat, 16 Mar 2019 01:21:39 +0000 (01:21 +0000)]
target/riscv: Remove unused struct

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
5 years agoriscv: sifive_u: Allow up to 4 CPUs to be created
Alistair Francis [Sat, 16 Mar 2019 01:21:29 +0000 (01:21 +0000)]
riscv: sifive_u: Allow up to 4 CPUs to be created

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
5 years agoRISC-V: Update load reservation comment in do_interrupt
Michael Clark [Sat, 16 Mar 2019 01:21:21 +0000 (01:21 +0000)]
RISC-V: Update load reservation comment in do_interrupt

Cc: Palmer Dabbelt <palmer@sifive.com>
Cc: Alistair Francis <Alistair.Francis@wdc.com>
Signed-off-by: Michael Clark <mjc@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
5 years agoRISC-V: Convert trap debugging to trace events
Michael Clark [Sat, 16 Mar 2019 01:21:12 +0000 (01:21 +0000)]
RISC-V: Convert trap debugging to trace events

Cc: Palmer Dabbelt <palmer@sifive.com>
Cc: Alistair Francis <Alistair.Francis@wdc.com>
Signed-off-by: Michael Clark <mjc@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
5 years agoRISC-V: Add support for vectored interrupts
Michael Clark [Sat, 16 Mar 2019 01:21:03 +0000 (01:21 +0000)]
RISC-V: Add support for vectored interrupts

If vectored interrupts are enabled (bits[1:0]
of mtvec/stvec == 1) then use the following
logic for trap entry address calculation:

 pc = mtvec + cause * 4

In addition to adding support for vectored interrupts
this patch simplifies the interrupt delivery logic
by making sync/async cause decoding and encoding
steps distinct.

The cause code and the sign bit indicating sync/async
is split at the beginning of the function and fixed
cause is renamed to cause. The MSB setting for async
traps is delayed until setting mcause/scause to allow
redundant variables to be eliminated. Some variables
are renamed for conciseness and moved so that decls
are at the start of the block.

Cc: Palmer Dabbelt <palmer@sifive.com>
Cc: Alistair Francis <Alistair.Francis@wdc.com>
Signed-off-by: Michael Clark <mjc@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
5 years agoRISC-V: Change local interrupts from edge to level
Michael Clark [Sat, 16 Mar 2019 01:20:54 +0000 (01:20 +0000)]
RISC-V: Change local interrupts from edge to level

This effectively changes riscv_cpu_update_mip
from edge to level. i.e. cpu_interrupt or
cpu_reset_interrupt are called regardless of
the current interrupt level.

Fixes WFI doesn't return when a IPI is issued:

- https://github.com/riscv/riscv-qemu/issues/132

To test:

1) Apply RISC-V Linux CPU hotplug patch:

- http://lists.infradead.org/pipermail/linux-riscv/2018-May/000603.html

2) Enable CONFIG_CPU_HOTPLUG in linux .config

3) Try to offline and online cpus:

  echo 1 > /sys/devices/system/cpu/cpu2/online
  echo 0 > /sys/devices/system/cpu/cpu2/online
  echo 1 > /sys/devices/system/cpu/cpu2/online

Reported-by: Atish Patra <atishp04@gmail.com>
Cc: Atish Patra <atishp04@gmail.com>
Cc: Alistair Francis <Alistair.Francis@wdc.com>
Signed-off-by: Michael Clark <mjc@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
5 years agoRISC-V: linux-user support for RVE ABI
Kito Cheng [Sat, 16 Mar 2019 01:20:46 +0000 (01:20 +0000)]
RISC-V: linux-user support for RVE ABI

This change checks elf_flags for EF_RISCV_RVE and if
present uses the RVE linux syscall ABI which uses t0
for the syscall number instead of a7.

Warn and exit if a non-RVE ABI binary is run on a
cpu with the RVE extension as it is incompatible.

Cc: Palmer Dabbelt <palmer@sifive.com>
Cc: Sagar Karandikar <sagark@eecs.berkeley.edu>
Cc: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Cc: Alistair Francis <Alistair.Francis@wdc.com>
Co-authored-by: Kito Cheng <kito.cheng@gmail.com>
Co-authored-by: Michael Clark <mjc@sifive.com>
Signed-off-by: Michael Clark <mjc@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
5 years agoelf: Add RISC-V PSABI ELF header defines
Michael Clark [Sat, 16 Mar 2019 01:20:37 +0000 (01:20 +0000)]
elf: Add RISC-V PSABI ELF header defines

Refer to the RISC-V PSABI specification for details:

- https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md

Cc: Michael Tokarev <mjt@tls.msk.ru>
Cc: Richard Henderson <richard.henderson@linaro.org>
Cc: Alistair Francis <Alistair.Francis@wdc.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Michael Clark <mjc@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
5 years agoRISC-V: Remove unnecessary disassembler constraints
Michael Clark [Sat, 16 Mar 2019 01:20:28 +0000 (01:20 +0000)]
RISC-V: Remove unnecessary disassembler constraints

Remove machine generated constraints that are not
referenced by the pseudo-instruction constraints.

Cc: Palmer Dabbelt <palmer@sifive.com>
Cc: Sagar Karandikar <sagark@eecs.berkeley.edu>
Cc: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Cc: Alistair Francis <Alistair.Francis@wdc.com>
Signed-off-by: Michael Clark <mjc@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
5 years agoRISC-V: Allow interrupt controllers to claim interrupts
Michael Clark [Sat, 16 Mar 2019 01:20:20 +0000 (01:20 +0000)]
RISC-V: Allow interrupt controllers to claim interrupts

We can't allow the supervisor to control SEIP as this would allow the
supervisor to clear a pending external interrupt which will result in
lost a interrupt in the case a PLIC is attached. The SEIP bit must be
hardware controlled when a PLIC is attached.

This logic was previously hard-coded so SEIP was always masked even
if no PLIC was attached. This patch adds riscv_cpu_claim_interrupts
so that the PLIC can register control of SEIP. In the case of models
without a PLIC (spike), the SEIP bit remains software controlled.

This interface allows for hardware control of supervisor timer and
software interrupts by other interrupt controller models.

Cc: Palmer Dabbelt <palmer@sifive.com>
Cc: Sagar Karandikar <sagark@eecs.berkeley.edu>
Cc: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Cc: Alistair Francis <Alistair.Francis@wdc.com>
Signed-off-by: Michael Clark <mjc@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
5 years agoRISC-V: Replace __builtin_popcount with ctpop8 in PLIC
Michael Clark [Sat, 16 Mar 2019 01:20:11 +0000 (01:20 +0000)]
RISC-V: Replace __builtin_popcount with ctpop8 in PLIC

The mode variable only uses the lower 4-bits (M,H,S,U) so
replace the GCC specific __builtin_popcount with ctpop8.

Cc: Palmer Dabbelt <palmer@sifive.com>
Cc: Sagar Karandikar <sagark@eecs.berkeley.edu>
Cc: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Cc: Alistair Francis <Alistair.Francis@wdc.com>
Signed-off-by: Michael Clark <mjc@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
5 years agoriscv: pmp: Log pmp access errors as guest errors
Alistair Francis [Sat, 16 Mar 2019 01:20:02 +0000 (01:20 +0000)]
riscv: pmp: Log pmp access errors as guest errors

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
5 years agoRISC-V: Add hooks to use the gdb xml files.
Jim Wilson [Fri, 15 Mar 2019 10:26:59 +0000 (03:26 -0700)]
RISC-V: Add hooks to use the gdb xml files.

The gdb CSR xml file has registers in documentation order, not numerical
order, so we need a table to map the register numbers.  This also adds
fairly standard gdb hooks to access xml specified registers.

notice:
    The fpu xml from gdb 8.3 has unused register #, 65 and make first
    csr register # become 69. We register extra register on gdb to correct
    csr offset calculation

Signed-off-by: Jim Wilson <jimw@sifive.com>
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
5 years agoRISC-V: Add debug support for accessing CSRs.
Jim Wilson [Fri, 15 Mar 2019 10:26:58 +0000 (03:26 -0700)]
RISC-V: Add debug support for accessing CSRs.

Add a debugger field to CPURISCVState.  Add riscv_csrrw_debug function
to set it.  Disable mode checks when debugger field true.

Signed-off-by: Jim Wilson <jimw@sifive.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20190212230903.9215-1-jimw@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
5 years agoRISC-V: Fixes to CSR_* register macros.
Jim Wilson [Fri, 15 Mar 2019 10:26:57 +0000 (03:26 -0700)]
RISC-V: Fixes to CSR_* register macros.

This adds some missing CSR_* register macros, and documents some as being
priv v1.9.1 specific.

Signed-off-by: Jim Wilson <jimw@sifive.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20190212230830.9160-1-jimw@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
5 years agoRISC-V: Add 64-bit gdb xml files.
Jim Wilson [Fri, 15 Mar 2019 10:26:56 +0000 (03:26 -0700)]
RISC-V: Add 64-bit gdb xml files.

Signed-off-by: Jim Wilson <jimw@sifive.com>
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
5 years agoRISC-V: Add 32-bit gdb xml files.
Jim Wilson [Fri, 15 Mar 2019 10:26:55 +0000 (03:26 -0700)]
RISC-V: Add 32-bit gdb xml files.

Signed-off-by: Jim Wilson <jimw@sifive.com>
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
5 years agoMerge remote-tracking branch 'remotes/dgibson/tags/ppc-for-4.0-20190319' into staging
Peter Maydell [Tue, 19 Mar 2019 10:52:44 +0000 (10:52 +0000)]
Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-4.0-20190319' into staging

ppc patch queue for 2019-03-19

This is a small set, it has a number of fixes and a couple of minor
cleanups to go in for the hard freeze.

# gpg: Signature made Tue 19 Mar 2019 10:05:48 GMT
# gpg:                using RSA key 75F46586AE61A66CC44E87DC6C38CACA20D9B392
# gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>" [full]
# gpg:                 aka "David Gibson (Red Hat) <dgibson@redhat.com>" [full]
# gpg:                 aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>" [full]
# gpg:                 aka "David Gibson (kernel.org) <dwg@kernel.org>" [unknown]
# Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392

* remotes/dgibson/tags/ppc-for-4.0-20190319:
  spapr: Remove NULL checks on error_propagate() calls
  ppc/xics/spapr: Fix H_IPOLL implementation
  ppc/pnv: Fix variable size in pnv_psi_power9_irq_set()
  ppc/pnv: Use local_err variable in pnv_chip_power9_intc_create()
  MAINTAINERS: PPC: add a PowerNV machine entry
  ppc/pnv: update skiboot to commit 261ca8e779e5.
  spapr: Correctly set LPCR[GTSE] in H_REGISTER_PROCESS_TABLE

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/mdroth/tags/qga-pull-2019-03-18-tag' into staging
Peter Maydell [Tue, 19 Mar 2019 09:53:29 +0000 (09:53 +0000)]
Merge remote-tracking branch 'remotes/mdroth/tags/qga-pull-2019-03-18-tag' into staging

qemu-ga patch queue for 4.0

* fix w32 build breakages with VSS enabled
* fix PCI topology reporting for Windows
* fix OS version reporting for Windows
* add systemd info to qga schema documentation
* add proper 'id' handling to QGA so it conforms to QMP spec

# gpg: Signature made Mon 18 Mar 2019 16:20:32 GMT
# gpg:                using RSA key CEACC9E15534EBABB82D3FA03353C9CEF108B584
# gpg:                issuer "mdroth@linux.vnet.ibm.com"
# gpg: Good signature from "Michael Roth <flukshun@gmail.com>" [full]
# gpg:                 aka "Michael Roth <mdroth@utexas.edu>" [full]
# gpg:                 aka "Michael Roth <mdroth@linux.vnet.ibm.com>" [full]
# Primary key fingerprint: CEAC C9E1 5534 EBAB B82D  3FA0 3353 C9CE F108 B584

* remotes/mdroth/tags/qga-pull-2019-03-18-tag:
  qmp: common 'id' handling & make QGA conform to QMP spec
  qga: process_event() simplification
  qga: Fix guest-get-fsinfo PCI address collection in Windows
  qga-win: fix VSS build breakage due to unintended gnu99 C++ flag
  qga-win: include glib when building VSS DLL
  qga-win: Adding support for Windows Server 2019 get-osinfo command
  qga: update docs with systemd suspend support info

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agospapr: Remove NULL checks on error_propagate() calls
Markus Armbruster [Mon, 18 Mar 2019 19:01:48 +0000 (20:01 +0100)]
spapr: Remove NULL checks on error_propagate() calls

Patch created mechanically by rerunning:

  $  spatch --sp-file scripts/coccinelle/error_propagate_null.cocci \
    --macro-file scripts/cocci-macro-file.h \
    --dir . --in-place

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20190318190148.18283-1-armbru@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
5 years agoppc/xics/spapr: Fix H_IPOLL implementation
Benjamin Herrenschmidt [Thu, 14 Mar 2019 06:38:55 +0000 (07:38 +0100)]
ppc/xics/spapr: Fix H_IPOLL implementation

H_IPOLL takes the CPU# of the processor to poll as an argument,
it doesn't operate on self.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20190314063855.27890-1-clg@kaod.org>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
5 years agoppc/pnv: Fix variable size in pnv_psi_power9_irq_set()
Greg Kurz [Wed, 13 Mar 2019 14:54:06 +0000 (15:54 +0100)]
ppc/pnv: Fix variable size in pnv_psi_power9_irq_set()

PSI registers are 64-bit.

Spotted by Coverity: CID 1399704

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <155248884690.893204.5428179144527749023.stgit@bahia.lan>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
5 years agoppc/pnv: Use local_err variable in pnv_chip_power9_intc_create()
Greg Kurz [Wed, 13 Mar 2019 14:54:01 +0000 (15:54 +0100)]
ppc/pnv: Use local_err variable in pnv_chip_power9_intc_create()

Detected by Coverity: CID 1399702

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <155248884129.893204.2293309859485638162.stgit@bahia.lan>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
5 years agoMAINTAINERS: PPC: add a PowerNV machine entry
Cédric Le Goater [Wed, 13 Mar 2019 16:24:23 +0000 (17:24 +0100)]
MAINTAINERS: PPC: add a PowerNV machine entry

and declare David and myself as maintainers of the PPC PowerNV
(Non-Virtualized) machine using the OPAL (skiboot) firmware.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Greg Kurz <groug@kaod.org>
Message-Id: <20190313162423.22081-1-clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
5 years agoppc/pnv: update skiboot to commit 261ca8e779e5.
Cédric Le Goater [Sun, 10 Mar 2019 17:53:37 +0000 (18:53 +0100)]
ppc/pnv: update skiboot to commit 261ca8e779e5.

It includes better support for POWER9 processor and the QEMU platform.
DD1.0 workarounds have been removed which simplifies a bit the XIVE
PowerNV model.

Built from submodule.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20190310175338.22266-1-clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
5 years agospapr: Correctly set LPCR[GTSE] in H_REGISTER_PROCESS_TABLE
David Gibson [Wed, 13 Mar 2019 03:17:27 +0000 (14:17 +1100)]
spapr: Correctly set LPCR[GTSE] in H_REGISTER_PROCESS_TABLE

176dccee "target/ppc/spapr: Clear partition table entry when allocating
hash table" reworked the H_REGISTER_PROCESS_TABLE hypercall, but
unfortunately due to a small error no longer correctly sets the LPCR[GTSE]
bit which allows the guest to directly execute (some types of) tlbie (TLB
flush) instructions without involving the hypervisor.

We got away with this, initially, because POWER9 did not have hypervisor
mode enabled in its msr_mask, which meant we didn't actually run hypervisor
privilege checks in TCG at all.  However, da874d90 "target/ppc: add HV
support for POWER9" turned on HV support on POWER9 for the benefit of the
powernv machine type.

This exposed the earlier bug in H_REGISTER_PROCESS_TABLE, and causes guests
which rely on LPCR[GTSE] (i.e. basically all of them) to crash during early
boot when their first tlbie instruction causes an unexpected trap.

Fixes: 176dccee target/ppc/spapr: Clear partition table entry when allocating hash table
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Greg Kurz <groug@kaod.org>
Tested-by: Cleber Rosa <crosa@redhat.com>
5 years agoqmp: common 'id' handling & make QGA conform to QMP spec
Marc-André Lureau [Wed, 20 Feb 2019 15:42:53 +0000 (16:42 +0100)]
qmp: common 'id' handling & make QGA conform to QMP spec

Let qmp_dispatch() copy the 'id' field. That way any qmp client will
conform to the specification, including QGA. Furthermore, it
simplifies the work for qemu monitor.

CC: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
5 years agoqga: process_event() simplification
Marc-André Lureau [Wed, 20 Feb 2019 15:42:52 +0000 (16:42 +0100)]
qga: process_event() simplification

Simplify the code around qmp_dispatch():
- rely on qmp_dispatch/check_obj() for message checking
- have a single send_response() point
- constify send_response() argument

It changes a couple of error messages:

* When @req isn't a dictionary, from
    Invalid JSON syntax
  to
    QMP input must be a JSON object

* When @req lacks member "execute", from
    this feature or command is not currently supported
  to
    QMP input lacks member 'execute'

CC: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
5 years agoqga: Fix guest-get-fsinfo PCI address collection in Windows
Matt Hines [Mon, 28 Jan 2019 22:30:56 +0000 (14:30 -0800)]
qga: Fix guest-get-fsinfo PCI address collection in Windows

The Windows QEMU guest agent erroneously tries to collect PCI information
directly from the physical drive. However, windows stores SCSI/IDE information
with the drive and PCI information with the underlying storage controller
This changes get_pci_info to use the physical drive's underlying storage
controller to get PCI information.

* Additionally Fixes incorrect size being passed to DeviceIoControl
  when getting volume extents. Can occasionally crash the guest agent

Signed-off-by: Matt Hines <mhines@scalecomputing.com>
*fix up some checkpatch warnings
*fix domain reporting and add some sanity checks for debug
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
5 years agoscripts/make-release: Stop shipping u-boot source as a tarball
Peter Maydell [Thu, 14 Mar 2019 15:56:28 +0000 (15:56 +0000)]
scripts/make-release: Stop shipping u-boot source as a tarball

In commit d0dead3b6df7f6cd970e we changed to shipping the u-boot
sources as a tarball, to work around a problem where they
contained a file and directory that had the same name except
for case, which was preventing QEMU's source tarball being
unpacked on case-insensitive filesystems.

In commit f2a3b549e357041f86d7e we updated our u-boot blob
and sources to v2019.01, which no longer has this problem,
so we can finally remove our workaround (effectively
reverting d0dead3b6df7f6cd970e).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Message-id: 20190314155628.8822-1-peter.maydell@linaro.org

5 years agoqga-win: fix VSS build breakage due to unintended gnu99 C++ flag
Michael Roth [Sat, 16 Mar 2019 01:24:30 +0000 (20:24 -0500)]
qga-win: fix VSS build breakage due to unintended gnu99 C++ flag

Commit 7be41675f7c set -std=gnu99 for C code via QEMU_CFLAGS. Currently
we generate a "custom" QEMU_CXXFLAGS for VSS DLL C++ build by
filtering out some options from QEMU_CFLAGS and adding some others.
Since we don't filter out -std=gnu99 currently this breaks builds when
VSS support is enabled.

We could keep the existing approach, filter out -std=gnu99 from
QEMU_CFLAGS, and add -std=gnu++98, like configure currently does for
QEMU_CXXFLAGS, but as it turns out our resulting QEMU_CXXFLAGS would
be exactly what configure already generates, just with these filtered
out:

  -fstack-protector-all -fstack-protector-strong

and these added:

  -Wno-unknown-pragmas -Wno-delete-non-virtual-dtor

So fix the issue by re-using configure-generated QEMU_CXXFLAGS and
just handling these specific changes.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqga-win: include glib when building VSS DLL
Michael Roth [Tue, 12 Feb 2019 21:29:16 +0000 (15:29 -0600)]
qga-win: include glib when building VSS DLL

Commit 3ebee3b191e defined assert() as g_assert(), but when we build
the VSS DLL component of QGA (to handle fsfreeze) we do not include
glib, which results in breakage when building with VSS support enabled.

Fix this by including glib (along with the -lintl and -lws2_32
dependencies it brings).

Since the VSS DLL is built statically, this introduces an additional
dependency on static glib and supporting libs for the mingw environment
(possibly why we didn't include glib originally), but VSS support
already has very specific prerequisites so it shouldn't affect too many
build environments.

Since the VSS DLL code does use qemu/osdep.h, this should also help
avoid future breakages and possibly allow for some clean ups in current
VSS code.

Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Cc: Daniel P. Berrangé <berrange@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
5 years agoqga-win: Adding support for Windows Server 2019 get-osinfo command
Bishara AbuHattoum [Wed, 19 Dec 2018 08:40:51 +0000 (10:40 +0200)]
qga-win: Adding support for Windows Server 2019 get-osinfo command

Since Windows Server 2016, Microsoft stopped upgrading the major and minor
versions of their new Windows Server product, so, the current functionality
of checking major and minor version numbers to determine the Windows Server
version wont work as expected.
The implemented solution here is to use the build number in addition to the
major and minor version numbers of the product to determine the Windows
Server product version.
The final build number of Windows Server 2016 is 14939, and
the final build number of Windows Server 2019 is 17764, so any Windows
Server product that has the major version of 10 and minor version of 0
with a build number lower or equal to 14939 will resemble 2016 and if the
build number is lower or equal to 17763 will resemble 2019.

Reference:
https://techcommunity.microsoft.com/t5/Windows-Server-Insiders/Windows-Server-2019-version-info/m-p/293112/highlight/true#M859

Signed-off-by: Bishara AbuHattoum <bishara@daynix.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
5 years agoqga: update docs with systemd suspend support info
Daniel Henrique Barboza [Tue, 13 Nov 2018 16:55:39 +0000 (14:55 -0200)]
qga: update docs with systemd suspend support info

Commit 067927d62e ("qga: systemd hibernate/suspend/hybrid-sleep
support") failed to update qapi-schema.json after adding systemd
hibernate/suspend/hybrid-sleep capabilities to guest-suspend-* QGA
commands.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
5 years agoMerge remote-tracking branch 'remotes/kraxel/tags/vga-20190318-pull-request' into...
Peter Maydell [Mon, 18 Mar 2019 15:00:15 +0000 (15:00 +0000)]
Merge remote-tracking branch 'remotes/kraxel/tags/vga-20190318-pull-request' into staging

vga: fixes for 4.0 (ati trace, virtio-gpu reset).

# gpg: Signature made Mon 18 Mar 2019 13:25:54 GMT
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/vga-20190318-pull-request:
  virtio-gpu: clear command and fence queues on reset
  virtio-gpu: delay virglrenderer reset when blocked.
  ati-vga: fix tracing

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/kraxel/tags/seabios-1.12.1-20190318-pull-reques...
Peter Maydell [Mon, 18 Mar 2019 13:14:24 +0000 (13:14 +0000)]
Merge remote-tracking branch 'remotes/kraxel/tags/seabios-1.12.1-20190318-pull-request' into staging

seabios update for 4.0

# gpg: Signature made Mon 18 Mar 2019 13:07:53 GMT
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/seabios-1.12.1-20190318-pull-request:
  seabios: update binaries to 1.12.1
  seabios: turn off CONFIG_ATA_DMA
  seabios: update submodule to 1.12.1

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoseabios: update binaries to 1.12.1
Gerd Hoffmann [Mon, 18 Mar 2019 12:49:51 +0000 (13:49 +0100)]
seabios: update binaries to 1.12.1

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agoseabios: turn off CONFIG_ATA_DMA
Gerd Hoffmann [Mon, 18 Mar 2019 12:42:49 +0000 (13:42 +0100)]
seabios: turn off CONFIG_ATA_DMA

There have been regressions reported, when booting FreeDOS.
https://www.mail-archive.com/qemu-devel@nongnu.org/msg593254.html

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agoseabios: update submodule to 1.12.1
Gerd Hoffmann [Mon, 18 Mar 2019 12:41:09 +0000 (13:41 +0100)]
seabios: update submodule to 1.12.1

git shortlog rel-1.12.0..rel-1.12.1
===================================

Kevin O'Connor (1):
      usb-ehci: Clear pipe token on pipe reallocate

Stephen Douthit (1):
      tpm: Check for TPM related ACPI tables before attempting hw probe

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agoMerge remote-tracking branch 'remotes/kraxel/tags/audio-20190318-pull-request' into...
Peter Maydell [Mon, 18 Mar 2019 12:39:59 +0000 (12:39 +0000)]
Merge remote-tracking branch 'remotes/kraxel/tags/audio-20190318-pull-request' into staging

audio: pulseaudio fixes for 4.0

# gpg: Signature made Mon 18 Mar 2019 12:08:50 GMT
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/audio-20190318-pull-request:
  audio/paaudio: fix microphone input being unusable
  audio/paaudio: prolong and make latency configurable
  audio/paaudio: fix ignored buffer_length setting

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agovirtio-gpu: clear command and fence queues on reset
Gerd Hoffmann [Thu, 14 Mar 2019 11:53:58 +0000 (12:53 +0100)]
virtio-gpu: clear command and fence queues on reset

It was never correct to not clear them.  Due to commit "3912e66a3feb
virtio-vga: fix reset." this became more obvious though.  The virtio
rings get properly reset now, and trying to process the stale commands
will trigger an assert in the virtio core.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 20190314115358.26678-3-kraxel@redhat.com

5 years agovirtio-gpu: delay virglrenderer reset when blocked.
Gerd Hoffmann [Thu, 14 Mar 2019 11:53:57 +0000 (12:53 +0100)]
virtio-gpu: delay virglrenderer reset when blocked.

If renderer_blocked is set do not call virtio_gpu_virgl_reset().
Instead set a flag indicating that virglrenderer needs a reset.
When renderer_blocked gets cleared do the actual reset call.

Without this we can trigger an assert in spice due to calling
spice_qxl_gl_scanout() while another operation is still running:

spice_qxl_gl_scanout: condition `qxl_state->gl_draw_cookie == GL_DRAW_COOKIE_INVALID' failed

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20190314115358.26678-2-kraxel@redhat.com

5 years agoati-vga: fix tracing
Gerd Hoffmann [Tue, 12 Mar 2019 08:11:43 +0000 (09:11 +0100)]
ati-vga: fix tracing

HWADDR_PRIx can't be used in tracing, use PRIx64 instead.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20190312081143.24850-1-kraxel@redhat.com

5 years agoMerge remote-tracking branch 'remotes/kraxel/tags/ui-20190318-pull-request' into...
Peter Maydell [Mon, 18 Mar 2019 11:30:13 +0000 (11:30 +0000)]
Merge remote-tracking branch 'remotes/kraxel/tags/ui-20190318-pull-request' into staging

ui: fixes for 4.0 (vnc, curses, keymaps).

# gpg: Signature made Mon 18 Mar 2019 11:20:19 GMT
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/ui-20190318-pull-request:
  keymaps: regenerate keymaps
  keymaps: use nodeadkeys variant for de and fr
  curses ui: add missing iconv_close calls
  curses ui: always initialize all curses_line fields
  vnc: fix unalignment access in tight_pack24

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoaudio/paaudio: fix microphone input being unusable
Martin Schrodt [Fri, 15 Mar 2019 08:46:53 +0000 (09:46 +0100)]
audio/paaudio: fix microphone input being unusable

The current code does not specify the metrics of the buffers for the
input device. This makes PulseAudio choose very bad defaults, which
causes input to be unusable: Audio put in gets out 30 seconds later.
This patch fixes that and makes the latency configurable as well.

Signed-off-by: Martin Schrodt <martin@schrodt.org>
Message-id: 20190315084653.120020-4-martin@schrodt.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agoaudio/paaudio: prolong and make latency configurable
Martin Schrodt [Fri, 15 Mar 2019 08:46:52 +0000 (09:46 +0100)]
audio/paaudio: prolong and make latency configurable

The latency of a connection to the PulseAudio server is determined by
the tlength parameter. This was hardcoded to 10ms, which is a bit too
tight on my machine, causing audio on host and guest to malfunction.
A setting of 15ms works fine here. To allow tweaking, I also made the
setting configurable via the new -audiodev config. This allows to squeeze out better timings in scenarios where the emulation allows it.

I also removed setting of the minreq parameter to (seemingly arbitrary) half the latency, since it showed worse audio quality during my tests. Allowing PulseAudio to request smaller chunks helped.

Signed-off-by: Martin Schrodt <martin@schrodt.org>
Message-id: 20190315084653.120020-3-martin@schrodt.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agoaudio/paaudio: fix ignored buffer_length setting
Martin Schrodt [Fri, 15 Mar 2019 08:46:51 +0000 (09:46 +0100)]
audio/paaudio: fix ignored buffer_length setting

Audiodev configuration allows to set the length of the buffered data.
The setting was ignored and a constant value used instead.
This patch makes the code apply the setting properly, and uses the
previous default if nothing is supplied.

Signed-off-by: Martin Schrodt <martin@schrodt.org>
Message-id: 20190315084653.120020-2-martin@schrodt.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agokeymaps: regenerate keymaps
Gerd Hoffmann [Fri, 15 Mar 2019 11:02:48 +0000 (12:02 +0100)]
keymaps: regenerate keymaps

Pick up the config updates.  Also add a few keys to the maps which
got a QKeyCode assigned since the last time we generated the maps
(Hiragana_Katakana, Muhenkan).  Sync with xkbcommon updates.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20190315110248.29208-3-kraxel@redhat.com

5 years agokeymaps: use nodeadkeys variant for de and fr
Gerd Hoffmann [Fri, 15 Mar 2019 11:02:47 +0000 (12:02 +0100)]
keymaps: use nodeadkeys variant for de and fr

The reverse keymap code can't handle dead keys.  So use the nodeadkeys
variant of the keyboard layout for the german and french maps.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20190315110248.29208-2-kraxel@redhat.com

5 years agocurses ui: add missing iconv_close calls
Samuel Thibault [Thu, 14 Mar 2019 17:25:24 +0000 (18:25 +0100)]
curses ui: add missing iconv_close calls

The iconv_t are opened but never closed.

Spotted by Coverity: CID 1399708
Spotted by Coverity: CID 1399709
Spotted by Coverity: CID 1399713

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Message-Id: <20190314172524.9290-1-samuel.thibault@ens-lyon.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agocurses ui: always initialize all curses_line fields
Samuel Thibault [Fri, 15 Mar 2019 13:09:32 +0000 (14:09 +0100)]
curses ui: always initialize all curses_line fields

cchar_t can contain not only attr and chars fields, but also ext_color.
Initialize the whole structure to zero instead of enumerating fields.

Spotted by Coverity: CID 1399711

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Message-Id: <20190315130932.26094-1-samuel.thibault@ens-lyon.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agoMerge remote-tracking branch 'remotes/palmer/tags/riscv-for-4.0-rc0' into staging
Peter Maydell [Mon, 18 Mar 2019 09:52:37 +0000 (09:52 +0000)]
Merge remote-tracking branch 'remotes/palmer/tags/riscv-for-4.0-rc0' into staging

A Single RISC-V Patch for 4.0-rc0

There was a regression introduced by the decodetree conversion that has
a fairly straight-forward fix.  Since this fixes bugs that everyone has
hit I'd like to target it for rc0.

# gpg: Signature made Mon 18 Mar 2019 05:26:07 GMT
# gpg:                using RSA key 00CE76D1834960DFCE886DF8EF4CA1502CCBAB41
# gpg:                issuer "palmer@dabbelt.com"
# gpg: Good signature from "Palmer Dabbelt <palmer@dabbelt.com>" [unknown]
# gpg:                 aka "Palmer Dabbelt <palmer@sifive.com>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 00CE 76D1 8349 60DF CE88  6DF8 EF4C A150 2CCB AB41

* remotes/palmer/tags/riscv-for-4.0-rc0:
  target/riscv: Fix manually parsed 16 bit insn

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agovnc: fix unalignment access in tight_pack24
Li Qiang [Mon, 18 Mar 2019 01:04:42 +0000 (09:04 +0800)]
vnc: fix unalignment access in tight_pack24

When adding '-fsanitize=undefined' in compiling configuration
and connect VM with vnc, it reports following error:

ui/vnc-enc-tight.c:910:13: runtime error: load of
misaligned address 0x621000466513 for type 'uint32_t',
which requires 4 byte alignment

This patch fix this issue.

Signed-off-by: Li Qiang <liq3ea@163.com>
Message-id: 20190318010442.14897-1-liq3ea@163.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agotarget/riscv: Fix manually parsed 16 bit insn
Bastian Koppelmann [Fri, 15 Mar 2019 13:51:40 +0000 (14:51 +0100)]
target/riscv: Fix manually parsed 16 bit insn

during the refactor to decodetree we removed the manual decoding that is
necessary for c.jal/c.addiw and removed the translation of c.flw/c.ld
and c.fsw/c.sd. This reintroduces the manual parsing and the
omited implementation.

Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Tested-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Tested-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
5 years agoMerge remote-tracking branch 'remotes/rth/tags/pull-hppa-20190316' into staging
Peter Maydell [Sun, 17 Mar 2019 14:10:52 +0000 (14:10 +0000)]
Merge remote-tracking branch 'remotes/rth/tags/pull-hppa-20190316' into staging

Fix lost interrupts.
Update seabios-hppa.

# gpg: Signature made Sat 16 Mar 2019 16:13:42 GMT
# gpg:                using RSA key 64DF38E8AF7E215F
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [full]
# Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A  05C0 64DF 38E8 AF7E 215F

* remotes/rth/tags/pull-hppa-20190316:
  Update seabios-hppa to latest upstream
  target/hppa: Avoid squishing DISAS_IAQ_N_STALE_EXIT

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/marcel/tags/rdma-pull-request' into staging
Peter Maydell [Sat, 16 Mar 2019 20:18:48 +0000 (20:18 +0000)]
Merge remote-tracking branch 'remotes/marcel/tags/rdma-pull-request' into staging

RDMA queue

 * Another Clang compilation fix
 * Collect pvrdma debugging statistics
 * Various fixes for the pvrdma device

# gpg: Signature made Sat 16 Mar 2019 14:09:02 GMT
# gpg:                using RSA key 36D4C0F0CF2FE46D
# gpg: Good signature from "Marcel Apfelbaum <marcel.apfelbaum@zoho.com>" [marginal]
# gpg:                 aka "Marcel Apfelbaum <marcel@redhat.com>" [marginal]
# gpg:                 aka "Marcel Apfelbaum <marcel.apfelbaum@gmail.com>" [marginal]
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: B1C6 3A57 F92E 08F2 640F  31F5 36D4 C0F0 CF2F E46D

* remotes/marcel/tags/rdma-pull-request:
  hw/rdma: Fix the error prints in create_qp_rings()
  hw/pvrdma: Fix zero-initialization of resp in {query/modify}_qp
  hw/rdma: Use {} instead of {0}
  hw/rdma: Remove unused parameter from rdma_poll_cq()
  hw/rdma: Fix broken paths to docs/devel/tracing.txt
  hw/rdma: another clang compilation fix
  hw/pvrdma: Provide correct value to object_get_typename
  hw/pvrdma: Unregister from shutdown notifier when device goes down
  hw/pvrdma: Delete pvrdma_exit function
  hw/pvrdma: Delete unneeded function argument
  hw/rdma: Free all receive buffers when QP is destroyed
  hw/rdma: Free all MAD receive buffers when device is closed
  {hmp, hw/pvrdma}: Expose device internals via monitor interface
  hw/pvrdma: Collect debugging statistics
  hw/rdma: Protect against concurrent execution of poll_cq
  hw/rdma: Introduce protected qlist
  hw/rdma: Switch to generic error reporting way
  contrib/rdmacm-mux: Fix out-of-bounds risk

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agohw/rdma: Fix the error prints in create_qp_rings()
Kamal Heib [Wed, 27 Feb 2019 08:55:46 +0000 (10:55 +0200)]
hw/rdma: Fix the error prints in create_qp_rings()

The prints should indicate that we are talking about QP and not CQ.

Fixes: 98d176f8e592 ("hw/rdma: PVRDMA commands and data-path ops")
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
Message-Id: <20190227085546.23690-1-kamalheib1@gmail.com>
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
5 years agohw/pvrdma: Fix zero-initialization of resp in {query/modify}_qp
Kamal Heib [Thu, 14 Mar 2019 15:30:31 +0000 (17:30 +0200)]
hw/pvrdma: Fix zero-initialization of resp in {query/modify}_qp

Make sure to zero-initialize only the pvrdma_cmd_query_qp_resp and not
the whole pvrdma_cmd_resp for query_qp, in modify_qp the resp isn't used
so remove it.

Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
Message-Id: <20190314153031.7197-5-kamalheib1@gmail.com>
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
5 years agohw/rdma: Use {} instead of {0}
Kamal Heib [Thu, 14 Mar 2019 15:30:30 +0000 (17:30 +0200)]
hw/rdma: Use {} instead of {0}

Initialize structs with {} instead of {0} to make sure that all code is
using the same convention.

Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Message-Id: <20190314153031.7197-4-kamalheib1@gmail.com>
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>