Commit Graph

57048 Commits

Author SHA1 Message Date
David Hildenbrand 9dec238826 s390x/tcg: take care of external interrupt subclasses
We can now let go of INTERRUPT_EXT. When cr0 changes, we have to
revalidate if we now have a pending external interrupt, just like
when the PSW (or SYSTEM MASK only) changes.

Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20170928203708.9376-6-david@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2017-10-20 13:32:10 +02:00
David Hildenbrand 8417f904ba s390x/tcg: rework checking for deliverable interrupts
Currently, enabling/disabling of interrupts is not really supported.

Let's improve interrupt handling code by explicitly checking for
deliverable interrupts only. This is the first step. Checking for
external interrupt subclasses will be done next.

Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20170928203708.9376-5-david@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2017-10-20 13:32:10 +02:00
David Hildenbrand 14ca122e75 s390x/tcg: injection of emergency signals and external calls
Preparation for new TCG SIGP code. Especially also prepare for
indicating that another external call is already pending.

Take care of interrupt priority.

Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20170928203708.9376-4-david@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2017-10-20 13:32:10 +02:00
David Hildenbrand d516f74c99 s390x/tcg: cleanup service interrupt injection
There are still some leftovers from old virtio interrupts in there.
Most importantly, we don't have to queue service interrupts anymore.
Just like KVM, we can simply multiplex the SCLP service interrupts and
avoid the queue.

Also, now only valid parameters/cpu_addr will be stored on service
interrupts.

Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20170928203708.9376-3-david@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2017-10-20 13:32:10 +02:00
David Hildenbrand 6482b0ffd1 s390x/tcg: turn INTERRUPT_EXT into a mask
External interrupts are currently all handled like floating external
interrupts, they are queued. Let's prepare for a split of floating
and local interrupts by turning INTERRUPT_EXT into a mask.

While we can have various floating external interrupts of one kind, there
is usually only one (or a fixed number) of the local external interrupts.

So turn INTERRUPT_EXT into a mask and properly indicate the kind of
external interrupt. Floating interrupts will have to moved out of
one CPU instance later once we have SMP support.

The only floating external interrupts used right now are SERVICE
interrupts, so let's use that name. Following patches will clean up
SERVICE interrupt injection.

This get's rid of the ugly special handling for cpu timer and clock
comparator interrupts. And we really only store the parameters as
defined by the PoP.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20170928203708.9376-2-david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2017-10-20 13:32:10 +02:00
Halil Pasic 9ea63c05d9 s390x/css: be more consistent if broken beyond repair
Calling do_subchannel_work with no function control flags set in SCSW is
a programming error. Currently we handle this differently in
do_subchannel_work_virtual and do_subchannel_work_passthrough. Let's be
consistent and guard with a common assert against this programming error.

Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com>
Message-Id: <20171004154144.88995-2-pasic@linux.vnet.ibm.com>
Reviewed-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2017-10-20 13:32:10 +02:00
Marc-André Lureau 96f64aa878 S390: use g_new() family of functions
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
[PMD: more changes in hw/s390x/css.c, added target/s390x/cpu_models.c]
Message-Id: <20171006235023.11952-27-f4bug@amsat.org>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2017-10-20 13:32:10 +02:00
Peter Maydell e67277f8f3 Merge tpm 2017/10/19 v1
-----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJZ6MfvAAoJEHWtZYAqC0IRWbQIAJ2PxlWGzc8s1EjgiGexRlfQ
 8dVDBhRhRZPp+OrrJwbnMQdOqjhdjsfzaJD4kXeokMdz2OkDQflC4DMbLVnCi5l3
 UZCommUtvrRBuNpVhxqude8BWM7Yc6GH4Y//52OyVeM3yZkE35LXwm/wtiEW2RUK
 E1XGT+OAN1Mnn6ocGGiEiZnD3noZrnfc6YOxlVGJOhgREo1Fg9W+pt1ecicA/bKe
 o2spHbZMh+l3ZXAg3/Fzp3T29XeMBUSgnQRyNJGDNYDRALwJhI1qi0akG3YKvnqn
 2MHzQQQwaHsEfObnhDPphm0h498gy4hx8kBWFUjsfHUxxznzQTLFk8sMmO232p8=
 =vEq0
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2017-10-19-1' into staging

Merge tpm 2017/10/19 v1

# gpg: Signature made Thu 19 Oct 2017 16:42:39 BST
# gpg:                using RSA key 0x75AD65802A0B4211
# gpg: Good signature from "Stefan Berger <stefanb@linux.vnet.ibm.com>"
# 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: B818 B9CA DF90 89C2 D5CE  C66B 75AD 6580 2A0B 4211

* remotes/stefanberger/tags/pull-tpm-2017-10-19-1: (21 commits)
  tpm: move recv_data_callback to TPM interface
  tpm: add a QOM TPM interface
  tpm-tis: fold TPMTISEmuState in TPMState
  tpm-tis: remove tpm_tis.h header
  tpm-tis: move TPMState to TIS header
  tpm: remove locty_data from TPMState
  tpm-emulator: fix error handling
  tpm: add TPMBackendCmd to hold the request state
  tpm: remove locty argument from receive_cb
  tpm: remove needless cast
  tpm: remove unused TPMBackendCmd
  tpm: remove configure_tpm() hop
  tpm: remove init() class method
  tpm: remove TPMDriverOps
  tpm: move TPMSizedBuffer to tpm_tis.h
  tpm: remove tpm_register_driver()
  tpm: replace tpm_get_backend_driver() to drop be_drivers
  tpm: lookup tpm backend class in tpm_driver_find_by_type()
  tpm: make tpm_get_backend_driver() static
  tpm-tis: remove RAISE_STS_IRQ
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-10-20 10:49:55 +01:00
Stefan Weil e947d47da0 oslib-posix: Fix compiler warning and some data types
gcc warning:

/qemu/util/oslib-posix.c:304:11: error:
 variable ‘addr’ might be clobbered by ‘longjmp’ or ‘vfork’
 [-Werror=clobbered]

Fix also some related data types:

numpages, hpagesize are used as pointer offset.
Always use size_t for them and also for the derived
numpages_per_thread and size_per_thread.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Message-id: 20171016202912.1117-1-sw@weilnetz.de
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2017-10-20 11:16:27 +02:00
Peter Maydell 840e069130 Update OpenBIOS images
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQEcBAABAgAGBQJZ6Pg8AAoJEFvCxW+uDzIf2j8H/R8YExzV4HMvGN4+/VA0T8Mk
 Ogu7olA5AarutceDAvara8hZYoWUD5uL0uMIN+16KBz25ebCJu6Oyvnq8gBPbXqw
 EQThk3Ced5Rfos3f/1yf0RwKKY7Yjc0HGJ97C9aeoI39kwvw4DkvOnsVoVKOvHnn
 /hFx0bzCugu0B2rmCj45HAPs1k1b+ipuqQFUfVt76Ff9grmS4aP9qWTWvPanPqJB
 nhzPZxdd9fvhSjWgWTtMR6220Kzp0HaBNCObbELrBstuiw3vOGoUA030kQ0reECA
 g3+68LtKy0Iyo3nCJa51yFMHvgUcbVbjJ9nodRbDKi1ZnoHQj6tuAGKpSt99gbk=
 =AkdP
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/mcayland/tags/qemu-openbios-signed' into staging

Update OpenBIOS images

# gpg: Signature made Thu 19 Oct 2017 20:08:44 BST
# gpg:                using RSA key 0x5BC2C56FAE0F321F
# gpg: Good signature from "Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>"
# Primary key fingerprint: CC62 1AB9 8E82 200D 915C  C9C4 5BC2 C56F AE0F 321F

* remotes/mcayland/tags/qemu-openbios-signed:
  Update OpenBIOS images to 83818bd built from submodule.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-10-20 10:14:39 +01:00
Fam Zheng 6a2e11974f docker: Fix PATH for ccache
Before bcd7f06f57 we source /etc/profile
so the PATH included the right paths to ccache binaries. Now we need to
update $PATH explicitly from run script.

Keep the old /usr/lib around just so that in the future, ccache from 32
bit images will just work.

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <20171018073841.30062-1-famz@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
2017-10-20 14:28:50 +08:00
Greg Kurz 1dc1700a60 docker: fix out-of-tree 'make docker-test-build@debian-powerpc-cross'
Without this patch, it fails with:

IOError: [Errno 2] No such file or directory:
 'tests/docker/dockerfiles/debian-apt-fake.sh'

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <150841324224.31292.4012464539983692364.stgit@bahia.lan>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Fam Zheng <famz@redhat.com>
2017-10-20 14:28:50 +08:00
Paolo Bonzini bc739b8e7d docker: allow running from srcdir != builddir build
The new script uses "git submodule", which is picky about being invoked
from the top of the git checkout.  Invoke the script from $(SRC_PATH)
to avoid git's wrath.

Fixes: b7f404201e
Cc: Fam Zheng <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Message-Id: <1508331989-142364-1-git-send-email-pbonzini@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
2017-10-20 14:28:50 +08:00
Peter Xu 08c3f6d57f docker: cleanup temp directory after test
There are temp directories named "docker-src.*" after doing docker
tests.  I don't see much point in keeping that (it only contains the
qemu.tar which is exactly current tree, and the copied "run" file).
Let's remove it after test finished.

CC: "Alex Bennée" <alex.bennee@linaro.org>
CC: Fam Zheng <famz@redhat.com>
CC: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20171017071247.32355-1-peterx@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
2017-10-20 14:28:50 +08:00
Fam Zheng 4b2c6bc563 docker: Don't allocate tty unless DEBUG=1
The existence of tty in the container seems to urge gcc into colorizing
the errors, but the escape chars will clutter the report once turned
into email replies on patchew. Move -t to debug mode.

Reported-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <20171013011954.9975-1-famz@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Fam Zheng <famz@redhat.com>
2017-10-20 14:28:50 +08:00
Mark Cave-Ayland 1bc6bc5c18 Update OpenBIOS images to 83818bd built from submodule.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2017-10-19 20:08:04 +01:00
Peter Maydell 063833a6ec qemu-sparc update
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQEcBAABAgAGBQJZ6EsoAAoJEFvCxW+uDzIf+igIAJcwjr6eC1u1nBhouLW43TJk
 y/yraOW33aDir7A/1LxFL3DFQ/ECT+RjBPpwVzLf1KllljKQkRRw101bU21SaEVT
 gKJOsrNHBibV5LtsKsIL7+ToLFaVwx7BKKewCJ1sGZ00e6AK/bU8WC8QIUJsmrVP
 tmRoAEnnLmgTHjn8coBa3OupiZAXYISVrD3if2eGbcQp1ELaYPE0YDBhuFDTp6kj
 QsyJfBxkp0FBq78GBeEcsvUPz4qTvWNeZ7Lv6WNDBPSqB/sLfJgGWfezKFHzk2rH
 MGA5K63EGTvCQpP1IF4pwkHyfjhXJ+EyLsyqQItuwsuzSZ68GtpLYgjxPczNKnw=
 =4IgQ
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/mcayland/tags/qemu-sparc-signed' into staging

qemu-sparc update

# gpg: Signature made Thu 19 Oct 2017 07:50:16 BST
# gpg:                using RSA key 0x5BC2C56FAE0F321F
# gpg: Good signature from "Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>"
# Primary key fingerprint: CC62 1AB9 8E82 200D 915C  C9C4 5BC2 C56F AE0F 321F

* remotes/mcayland/tags/qemu-sparc-signed:
  sun4u: fix assert when adding NICs which aren't the in-built model
  sun4u: update PCI topology to include simba PCI bridges

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-10-19 18:42:51 +01:00
Peter Maydell d634fc0499 seabios: update to 1.11 prerelease
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJZ6GAVAAoJEEy22O7T6HE49nUQAIEDdE05fmWQJrhmHH+5TLCU
 Fva+jC0iFYEvECbIAmFJHFGeoUP08ySNMAL5eVu+ouXKHIPVCIIzoIrwyAWuW/m7
 QEsfpoPNcWW79BIiBC4uV863gjeVAVSUWNqLmETAMKF8hrzxWmYASo36RDhWPpN5
 oDtkjMtI/5oCMm3D3TxMFOLxhHHvjYwoyYkLKq0M59cV3wNqZyleZ2MUoVGm7gb5
 iUL3M14EHq8nzat4PDXe/MjtvafxBd9CeMpsuY1mjSlfQ7eal17OSL3VNVvckkGm
 GaqoXx/u4/McGPfnUUPuk1hKsm3yue00hC6LN8Jqa1s2dgc9zn1+wzyJhzVGBMDk
 lsf7yZ6bIoKAxMUyPZRuJxAr+cHXvt82+I70tN9uGQR001X+PhAE3zf3ld4KPBQH
 P7nx1K0njoxVFZ1JNmBIEQ4jnH8hxVRAIk/8W1ETREG4nUNrBWp7S9LJmlnLvgLZ
 M1H9Ao5RBO9cTjUrx3MnpeuR31vx81rj43MoWwhbVvopTX+UYBpi8ZoU2FfmXPO5
 3Mn0Rh511noEbbso3FAZd/MSHmHIXB68HrYBK6CkVKUzynrkSj23q+nORmly3YV7
 b+egoyCRe26sONVQ/0MRZ185qlq/BCE6FRClGaYWS4JFeI+x739IQQN72Rt/RcfK
 BIQf2i47sCEdR9CKBq5n
 =GxLc
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/seabios-1.11-prerelease-20171019-pull-request' into staging

seabios: update to 1.11 prerelease

# gpg: Signature made Thu 19 Oct 2017 09:19:33 BST
# gpg:                using RSA key 0x4CB6D8EED3E87138
# 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>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/seabios-1.11-prerelease-20171019-pull-request:
  seabios: update to 1.11 prerelease

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-10-19 18:06:30 +01:00
Aaron Lindsay 00525864f2 build: Fix dtc-checkout race condition in Makefile
This was introduced by:
    commit aef45d51d1
    Author: Daniel P. Berrange <berrange@redhat.com>
    Date:   Fri Sep 29 11:11:56 2017 +0100

	build: automatically handle GIT submodule checkout for dtc

On my system, I see the following with a fresh clone:

% ./configure --disable-gtk --target-list=aarch64-softmmu
% make -j8
  GEN     aarch64-softmmu/config-devices.mak.tmp
  GEN     config-host.h
mkdir -p dtc/libfdt
  GIT     ui/keycodemapdb dtc
mkdir -p dtc/tests
  GEN     qemu-options.def
[snip]
  GEN     migration/trace.h
make: *** [git-submodule-update] Error 1
make: *** Waiting for unfinished jobs....

Upon closer inspection, the root cause of the error is:

% git submodule update --init ui/keycodemapdb dtc
fatal: destination path 'dtc' already exists and is not an empty directory.
Clone of 'git://git.qemu-project.org/dtc.git' into submodule path 'dtc' failed

This patch fixes this race condition by forcing the 'dtc/%' rule which caused
'dtc' to be non-empty to wait on '.git-submodule-status'.

Signed-off-by: Aaron Lindsay <alindsay@codeaurora.org>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Acked-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 1508352023-28591-1-git-send-email-alindsay@codeaurora.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-10-19 16:48:16 +01:00
Marc-André Lureau 05a699985c tpm: move recv_data_callback to TPM interface
Simplify the TPM backend setup, move callback to TPM interface.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-10-19 11:42:33 -04:00
Marc-André Lureau 698f5daa4a tpm: add a QOM TPM interface
This will simplify backend / interface objects relationship, so the
frontend interface will simply have to implement the TPM QOM interface.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-10-19 11:42:32 -04:00
Marc-André Lureau 3d4960c7ad tpm-tis: fold TPMTISEmuState in TPMState
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-10-19 11:42:32 -04:00
Marc-André Lureau 732cd5877e tpm-tis: remove tpm_tis.h header
The definitions are now private to TIS implementation.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-10-19 11:42:31 -04:00
Marc-André Lureau 5086bf9784 tpm-tis: move TPMState to TIS header
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-10-19 11:42:30 -04:00
Marc-André Lureau d280976625 tpm: remove locty_data from TPMState
Keep it internal to tpm-tis instead.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-10-19 11:42:29 -04:00
Marc-André Lureau c106ede9c8 tpm-emulator: fix error handling
The previous patch cleaned up a bit error handling, and exposed an
existing bug: error_report_err() could be called with a NULL error.
Instead, make tpm_emulator_set_locality() set the error.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-10-19 11:42:28 -04:00
Marc-André Lureau 0e43b7e61c tpm: add TPMBackendCmd to hold the request state
This simplifies a bit locality handling, and argument passing, and
could pave the way to queuing requests (if that makes sense).

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-10-19 11:42:28 -04:00
Marc-André Lureau d1fd6b563d tpm: remove locty argument from receive_cb
The tpm_state is passed as argument, the assert() is pointless since
we give it the value of tpm_state->locty_number already.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-10-19 11:42:27 -04:00
Marc-André Lureau 54aa36d5c8 tpm: remove needless cast
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-10-19 11:42:26 -04:00
Marc-André Lureau 905e78ba25 tpm: remove unused TPMBackendCmd
There is only handling of request so far in both backends.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-10-19 11:42:25 -04:00
Marc-André Lureau 76ae76bfea tpm: remove configure_tpm() hop
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-10-19 11:42:24 -04:00
Marc-André Lureau 27a79d96b4 tpm: remove init() class method
No backend use it.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-10-19 11:42:24 -04:00
Marc-André Lureau d31076ba75 tpm: remove TPMDriverOps
Use TPMBackendClass to hold class methods/fields.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-10-19 11:42:23 -04:00
Marc-André Lureau cfab6da8a7 tpm: move TPMSizedBuffer to tpm_tis.h
Close to where it's being used.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-10-19 11:42:23 -04:00
Marc-André Lureau ed836d9d6b tpm: remove tpm_register_driver()
No more users of be_drivers[], drop that too.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-10-19 11:42:22 -04:00
Marc-André Lureau d91a7a575e tpm: replace tpm_get_backend_driver() to drop be_drivers
Use tpm_driver_find_by_type() instead.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-10-19 11:42:22 -04:00
Marc-André Lureau f3faa1dff4 tpm: lookup tpm backend class in tpm_driver_find_by_type()
One step towards removing TPMDriverOps and driver registration.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-10-19 11:42:21 -04:00
Marc-André Lureau 349ccdc89c tpm: make tpm_get_backend_driver() static
No need to export the function.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-10-19 11:42:20 -04:00
Marc-André Lureau d8383d61fa tpm-tis: remove RAISE_STS_IRQ
This look like temporary hacking code. It shouldn't be necessary in
release code, or there should be a runtime option for it.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-10-19 11:42:20 -04:00
Marc-André Lureau ff2bc0c115 tpm-tis: remove unused hw_access argument
This argument is always false, simplify the code.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-10-19 11:42:19 -04:00
Peter Maydell a8b392ac9a * TCG 8-byte atomic accesses bugfix (Andrew)
* Report disk rotation rate (Daniel)
 * Report invalid scsi-disk block size configuration (Mark)
 * KVM and memory API MemoryListener fixes (David, Maxime, Peter Xu)
 * x86 CPU hotplug crash fix (Igor)
 * Load/store API documentation (Peter Maydell)
 * Small fixes by myself and Thomas
 * qdev DEVICE_DELETED deferral (Michael)
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAlnnJUgUHHBib256aW5p
 QHJlZGhhdC5jb20ACgkQv/vSX3jHroMifwf/dTZwtGqvAV4+jezCiZ3MTknz39dM
 HOGnD3m2xy04QT5LHiwDmaLFXy1y/AUVQm79JMPN4dKoFvtruREoWUq8EU0FCsLZ
 PkdCbJuXKGiBYMRXkQQxeT8lAyaBQwZdc+O9mYuOrSGZOQscA7SxgClYmzVdVzcy
 ZNTqkuaw1NDIAapdfGv94WLza4Nb8XX8bFwohgkf4mLDXifhjYHQTbBTfB0NqPxH
 Rk3HU+wgYUCJRYXpvktESgzRo5sm1aozCRq3f0Y6RV12ylgF6GG4CyN7YcKRn8eh
 NZbyehHiF5YU2kuvO9SmAB+FqM2+aMtq8uuNuI1Nxgd222MOVaChyWc3jg==
 =gmUj
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging

* TCG 8-byte atomic accesses bugfix (Andrew)
* Report disk rotation rate (Daniel)
* Report invalid scsi-disk block size configuration (Mark)
* KVM and memory API MemoryListener fixes (David, Maxime, Peter Xu)
* x86 CPU hotplug crash fix (Igor)
* Load/store API documentation (Peter Maydell)
* Small fixes by myself and Thomas
* qdev DEVICE_DELETED deferral (Michael)

# gpg: Signature made Wed 18 Oct 2017 10:56:24 BST
# gpg:                using RSA key 0xBFFBD25F78C7AE83
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>"
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>"
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* remotes/bonzini/tags/for-upstream: (29 commits)
  scsi: reject configurations with logical block size > physical block size
  qdev: defer DEVICE_DEL event until instance_finalize()
  Revert "qdev: Free QemuOpts when the QOM path goes away"
  qdev: store DeviceState's canonical path to use when unparenting
  qemu-pr-helper: use new libmultipath API
  watch_mem_write: implement 8-byte accesses
  notdirty_mem_write: implement 8-byte accesses
  memory: reuse section_from_flat_range()
  kvm: simplify kvm_align_section()
  kvm: region_add and region_del is not called on updates
  kvm: fix error message when failing to unregister slot
  kvm: tolerate non-existing slot for log_start/log_stop/log_sync
  kvm: fix alignment of ram address
  memory: call log_start after region_add
  target/i386: trap on instructions longer than >15 bytes
  target/i386: introduce x86_ld*_code
  tco: add trace events
  docs/devel/loads-stores.rst: Document our various load and store APIs
  nios2: define tcg_env
  build: remove CONFIG_LIBDECNUMBER
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-10-19 15:38:07 +01:00
Peter Maydell f2a48d696c Linux-user updates for Qemu 2.11
-----BEGIN PGP SIGNATURE-----
 
 iQJLBAABCAA1FiEE/4IDyMORmK4FgUHvtEiQ3t48m8AFAlnnRv4XHHJpa3Uudm9p
 cGlvQGxpbmFyby5vcmcACgkQtEiQ3t48m8D1hw/8Cu/gXcWzHPxoqU/Bz9lSMS0+
 1UICiGBVNBcrs7QapG+Z4mI4goGcxjFKFEFgHuuvQTb91ONR43jIx4cNryOlu3jS
 9njiHkgY7EeKXf84uPToie9WiXvf2IMI6wKdqJ53htJ8/Y1putbJ2CGf7c8vGIGh
 9WhNGbiQyhpWU3xrEThVptUz+CVOqXxBYVKff0krG7ZSyODhrybPDkp8D020rXa1
 O7oc8pAvwpYWiqpp+iiEU5PXFB7DoLUldefqqZQw+Rgntu6sEU+Rum7ykA2d6jBR
 o0YldbJeU2eq2Kh9EqJHDbTZwevTeul6NEcgd6ZoJkTDhOSDK9mMd6jkkRUHzf+u
 OAlGFFmfdqf9NE5S38XIMRHykwgMtWzQNU2MVLtalkEcadbOy7RnY/lOE/uEACh4
 Ao/GPMDCar7nYR2Ga/P9LXFhR90hbvvvRAB10l7TIgE6/EJJUJs9E0HxC5ktsonv
 gC4tMTejhCwe61Neb0Z9b2gxSkwznJYe9OdTa13CENXMAy3AqPUTsDY91Y80HdpX
 3rE869VSHMIQNuyNecCrUeHyKYkLoB+qGmavtO7m1RNEUeWTPP2WSDMCVKxVT4bg
 ol0UeTOwy0hGm2MUwn3scL+yMEVWjcEyInWDZCCGIvJMxfnwkqAMTO0xZXAIE8n0
 bBHdQ4xVsujMIDmQcO0=
 =9fWY
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/riku/tags/pull-linux-user-20171018' into staging

Linux-user updates for Qemu 2.11

# gpg: Signature made Wed 18 Oct 2017 13:20:14 BST
# gpg:                using RSA key 0xB44890DEDE3C9BC0
# gpg: Good signature from "Riku Voipio <riku.voipio@iki.fi>"
# gpg:                 aka "Riku Voipio <riku.voipio@linaro.org>"
# Primary key fingerprint: FF82 03C8 C391 98AE 0581  41EF B448 90DE DE3C 9BC0

* remotes/riku/tags/pull-linux-user-20171018:
  linux-user: Fix TARGET_MTIOCTOP/MTIOCGET/MTIOCPOS values
  linux-user/main: support dfilter
  linux-user: Fix target FS_IOC_GETFLAGS and FS_IOC_SETFLAGS numbers
  linux-user/sh4: Reduce TARGET_VIRT_ADDR_SPACE_BITS to 31
  linux-user: Tidy and enforce reserved_va initialization
  tcg: Fix off-by-one in assert in page_set_flags
  linux-user: Allow -R values up to 0xffff0000 for 32-bit ARM guests
  linux-user: remove duplicate break in syscall
  target/m68k,linux-user: manage FP registers in ucontext
  linux-user: fix O_TMPFILE handling

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-10-19 14:39:30 +01:00
Peter Maydell ba6f0fc25e ui: opengl updates for dma-buf support.
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJZ5eXgAAoJEEy22O7T6HE4nhEQANHY8Exu2HFGKHbd59IR7MAl
 jc3CiT5tc9/HGcPuhUw5BuEBpd053/COZQktSTAjOUYo7tDmwM+dbEz5SU0dIVXf
 hu1ZoAvgOmC+X+TZRY2YyFrjvwjORRxATxnLlg3ETTDbaEu8EI4G0xA8NYox7j1X
 nPduAsSEK4YiPcOkfbi2LmQIaLE4phtmFnVed0cLWG0hE1n1KWDu0TQGQB4ZNLb1
 t5RtEc/qLrkVSGupLy0lwBIlMGAFZzjmr2co13IpPd6Weow8v++c68aO6PtAWQWA
 pFhDuWwENg/LshyHa2tgWg+QaGl5p+306fVq79RX23juLZ5OaPyPtuptL2uXen5N
 74GroqLwkbl9TabjLpmNGGLvwKwV5cLtmpGW/t4jAX0fhb0RjfMwIeazgeWkifED
 z4o7tkXTR9EUc+6nHYXbdy5okmxBXv3JvDM9LAMG1d3c4T9VRsKJJMwoPclbkwi1
 SxGLoYvz9IU4VjYAkFgoeYeKGX9UbJPzKp3kyuczZEAAm8Gd9uaAhCYvIk9nE/Mi
 JlPPfz1J8EerdD2mJjbIMZvz/7mvcrkRhQBzM/bTUDxuVTdWVrD+mP5qoq7XuApi
 0GgMJbubYEBSBsD3tpRArSOkLmoRanH9CaGetY5o2m4p+BaQ7ssiCQ5oPczrW4lj
 L83OfkWx4PiBB5swQHv1
 =P3Cr
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/opengl-20171017-pull-request' into staging

ui: opengl updates for dma-buf support.

# gpg: Signature made Tue 17 Oct 2017 12:13:36 BST
# gpg:                using RSA key 0x4CB6D8EED3E87138
# 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>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/opengl-20171017-pull-request:
  egl-headless: add dmabuf support
  egl-helpers: add egl_texture_blit and egl_texture_blend
  egl-helpers: add dmabuf import support
  opengl: add flipping vertex shader
  opengl: move shader init from console-gl.c to shader.c
  console: add support for dmabufs

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-10-19 12:09:53 +01:00
Peter Maydell 73b733e690 cirrus: bugfixes, with some vga cleanups.
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJZ5b5FAAoJEEy22O7T6HE4UugQAK1Y4PabCrOGFs1FYe/tCCvf
 kMLa7iWRoXWE9gPMArHQ4XURC6sZ54g+MOGZFWp7VdHTdkXsID8BDB60G2h0P5Gg
 IZxSrw+7k1u7plc/LzjFfwryGsAEm6Buj2FbA79XvMUr+6IS8MH2UpsrP5KJbqsQ
 19a0GIYRly92UOmfdiKBH5lZ5XAv2BlPihUFB7gNesZmoQd11opQIwdTixFY9LBs
 viS5ntrQX1G4rIfuhuyk16TlL+aOX+zk1W0MOoPvASt9s0pv836gJ2dTRkDUHpic
 89ORr8QdBE2/ODT9H0aWxKsb/txEKRCuPB+2YIf9JtOCHltCW1sOUdmqcN7jVtU7
 rEF6AlF0zTtdRGbzWcEAoXW+FBa9YQtxXtrYNLLkiySE+Wj5BNi0bKRCbRr1APCg
 pMCruCtp3MYRVZKRVG5WO4Tb1NSoLG5W95iIh5qdGX99bqkJ4hD6R8x/5d6CMVR2
 q5iiO1HjOzAkWjhFEbq2NhvSaxaZeGt/Dm6cL/p8hBPSiZzkeJ1AqfvzjOjez3pJ
 G0MBHkD8o53cdDMrjnwl1zv2pq5aR//4FR1XffpSTeziWpnzu/nxSNIN5oKS3FJ3
 4AsePk4CA29Wq4QJUZzf+LgQZIRRBRLhTIuIUL9izq6BRA2QAyCF5QPvxed1jAQ+
 HjRYrQEbbY7VPFpZa70T
 =hdje
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/vga-20171017-pull-request' into staging

cirrus: bugfixes, with some vga cleanups.

# gpg: Signature made Tue 17 Oct 2017 09:24:37 BST
# gpg:                using RSA key 0x4CB6D8EED3E87138
# 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>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/vga-20171017-pull-request:
  cirrus: fix oob access in mode4and5 write functions
  vga: add ram_addr_t cast
  vga: handle cirrus vbe mode wraparounds.
  vga: drop line_offset variable

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-10-19 10:53:19 +01:00
Gerd Hoffmann 083fab0290 seabios: update to 1.11 prerelease
This is the seabios update for qemu 2.11.  Well, almost, seabios is in
freeze for the upcoming 1.11 release.  This updates seabios to current
git master snapshot, and it will be updated again to 1.11 final before
the 2.11 release.

With this two-step seabios gets some more wide testing before the actual
release and the update to 1.11 final (which will most likely happen
after qemu freeze) should have bugfix patches only.

git shortlog
============

Aleksandr Bezzubikov (3):
      pci: refactor pci_find_capapibilty to get bdf as the first argument instead of the whole pci_device
      pci: add QEMU-specific PCI capability structure
      pci: enable RedHat PCI bridges to reserve additional resources on PCI init

Ben Warren (5):
      QEMU DMA: Add DMA write capability
      romfile-loader: Switch to using named structs
      QEMU fw_cfg: Add command to write back address of file
      QEMU fw_cfg: Add functions for accessing files by key
      QEMU fw_cfg: Write fw_cfg back on S3 resume

Daniel Verkamp (5):
      nvme: support NVMe 1.0 controllers
      nvme: extend command timeout to 5 seconds
      nvme: fix reversed loop condition in cmd_readwrite
      nvme: fix extraction of status code bits
      nvme: fix copy-paste mistake in comment

Filippo Sironi (1):
      nvme: Use the Maximum Queue Entries Supported (MQES) to initialize I/O queues

Gerd Hoffmann (7):
      usb: add hub portmap
      usb-xhci: use hub portmap
      std: add cp437 to unicode map
      kbd: make enqueue_key public, add ascii_to_keycode
      romfile: add support for constant files.
      paravirt: serial console configuration.
      add serial console support

Igor Mammedov (1):
      drop "etc/boot-cpus" fw_cfg file and reuse legacy QEMU_CFG_NB_CPUS

Jason Wang (1):
      virtio: IOMMU support

Julian Stecklina (2):
      block: add NVMe boot support
      nvme: fix out of memory behavior

Julius Werner (1):
      coreboot: Adapt to upstream CBMEM console changes

Kevin O'Connor (26):
      usb: Make usb_time_sigatt variable static
      tpm: Add comment banners to tcg.c separating major parts of spec
      tpm: Don't call tpm_set_failure() from tpm12_get_capability()
      tpm: Move code around in tcgbios.c to keep like code together
      acpi: Generalize find_fadt() and find_tcpa_by_rsdp() into find_acpi_table()
      tpm: Don't call tpm_build_and_send_cmd() from tpm20_stirrandom()
      tpm: Rework tpm_build_and_send_cmd() into tpm_simple_cmd()
      ps2port: Disable keyboard/mouse prior to resetting ps2 controller
      docs: Note release dates for 1.10.1 and 1.10.2
      resume: Don't attempt to use generic reboot mechanisms on QEMU
      boot: Increase description size in boot menu
      src: Minor - remove tab characters that slipped into SeaBIOS C code
      NVMe: Allow NVMe to be enabled on real hardware
      smm: Backup and restore A20 on an SMI based mode switch
      stacks: Make sure to initialize Call16Data
      stacks: Don't update the A20 settings if they haven't changed
      stacks: There is no need to disable NMI if it is already disabled
      vga: Fix bug in stdvga_get_linesize()
      docs: Fix typos in Memory_Model.md
      tcgbios: Fix use of unitialized variable
      boot: Rename drive_g to drive
      disk: Don't require the 'struct drive_s' to be in the f-segment
      block: Rename disk_op_s->drive_gf to drive_fl
      virtio: Allocate drive_s storage in low memory
      xhci: Build TRBs directly in xhci_trb_queue()
      xhci: Verify the device is still present in xhci_cmd_submit()

Ladi Prosek (1):
      ahci: Set upper 32-bit registers to zero

Patrick Rudolph (4):
      SeaVGABios/cbvga: Advertise correct pixel format
      SeaVGABIOS/vbe: Query driver for scanline pitch v2
      SeaVGABios/cbvga: Use active mode to clear screen
      SeaVGABios/cbvga: Advertise compatible VESA modes

Paul Menzel (1):
      vgasrc: Increase debug level

Petr Berky (1):
      config: Add function to check if fw_cfg exists

Ricardo Ribalda Delgado (1):
      serialio: Support for mmap serial ports

Roman Kagan (11):
      blockcmd: accept only disks and CD-ROMs
      blockcmd: generic SCSI luns enumeration
      virtio-scsi: enumerate luns with REPORT LUNS
      esp-scsi: enumerate luns with REPORT LUNS
      usb-uas: enumerate luns with REPORT LUNS
      pvscsi: fix the comment about lun enumeration
      mpt-scsi: try to enumerate luns with REPORT LUNS
      lsi-scsi: reset in case of a serious problem
      lsi-scsi: try to enumerate luns with REPORT LUNS
      blockcmd: start REPORT_LUNS with the smallest buffer
      Revert "lsi-scsi: reset in case of a serious problem"

Stefan Berger (1):
      tpm: Log TPM 2 digest structure in little endian format

Youness Alaoui (1):
      nvme: Enable NVMe support for non-qemu hardware

Zeh, Werner (1):
      ahci: Disable Native Command Queueing

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-10-19 10:14:26 +02:00
Mark Cave-Ayland bcf9e2c2f2 sun4u: fix assert when adding NICs which aren't the in-built model
Commit 8d93297 introduced a bug whereby non-inbuilt NICs are realized before
setting the default MAC address causing an assert. Switch NIC creation
over from pci_create_simple() to pci_create() which works exactly the
same except omitting the realize as originally intended.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Artyom Tarasenko <atar4qemu@gmail.com>
2017-10-19 07:45:35 +01:00
Mark Cave-Ayland 6864fa3897 sun4u: update PCI topology to include simba PCI bridges
This patch updates the sun4u model to being much closer to a real Ultra 5
by moving devices behind the 2 simba PCI bridges (A and B) as found on real
hardware.

The most noticeable change introduced by this patchset is that in-built devices
are no longer attached to the PCI root bus, but instead behind PCI bridge A.
Along with this the interrupt routing is updated accordingly to match the
official documentation.

Since the existing code currently bypasses the PCI bridge interrupt
swizzling, the interrupt mapping functions are reorganised so that
pci_pbm_map_irq() is used by the PCI bridges and pci_apb_map_irq() is
used by the PCI host bridge.

Behind the sabre PCI host bridge, the PCI IO space now needs to be
split into two separate halves at 0x8000000. Therefore we also setup a new
PCI IO space region of increased size on the PCI host bridge and enable
32-bit PCI IO accesses to allow IO accesses to reach devices behind PCI
bridge B correctly.

As part of this change we also combine the onboard sunhme NIC and the ebus
into a single multi-function device as done on a real Ultra 5. For other
NICs the existing behaviour is preserved, i.e. we initialise them and
place them into the next free slot on PCI bus B.

Finally we mark the physically unavailable slots (plus slot 0 in busA) as
reserved to ensure that users can't plug devices into non-existent slots
which will break interrupt routing.

Note: since this commit changes PCI topology and interrupt routing, an
updated openbios-sparc64 binary is included with this commit containing the
associated changes to maintain bisectability.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Artyom Tarasenko <atar4qemu@gmail.com>
2017-10-19 07:45:35 +01:00
Mark Kanda 3da023b582 scsi: reject configurations with logical block size > physical block size
Logical block size of a SCSI disk should never be larger than
physical block size. From an ATA/SCSI perspective, it makes no sense
to have the logical block size greater than the physical block size,
and it cannot even be effectively expressed in the command set. The
whole point of adding the physical block size to the ATA/SCSI command
set was to communicate a desire for a larger block size (than logical),
while maintaining backwards compatibility with legacy 512 byte block
size.

When setting logical_block_size > physical_block_size, QEMU cannot express
it in READ CAPACITY(16) output, and all it can do is set the physical
block exponent to 0 (i.e. logical_block_size == physical_block_size).
Reporting the error properly, however, is better.

Signed-off-by: Mark Kanda <mark.kanda@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Message-Id: <1508185024-5840-1-git-send-email-mark.kanda@oracle.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-10-18 11:56:14 +02:00
Michael Roth f7b879e072 qdev: defer DEVICE_DEL event until instance_finalize()
DEVICE_DEL is currently emitted when a Device is unparented, as
opposed to when it is finalized. The main design motivation for this
seems to be that after unparent()/unrealize(), the Device is no
longer visible to the guest, and thus the operation is complete
from the perspective of management.

However, there are cases where remaining host-side cleanup is also
pertinent to management. The is generally handled by treating these
resources as aspects of the "backend", which can be managed via
separate interfaces/events, such as blockdev_add/del, netdev_add/del,
object_add/del, etc, but some devices do not have this level of
compartmentalization, namely vfio-pci, and possibly to lend themselves
well to it.

In the case of vfio-pci, the "backend" cleanup happens as part of
the finalization of the vfio-pci device itself, in particular the
cleanup of the VFIO group FD. Failing to wait for this cleanup can
result in tools like libvirt attempting to rebind the device to
the host while it's still being used by VFIO, which can result in
host crashes or other misbehavior depending on the host driver.

Deferring DEVICE_DEL still affords us the ability to manage backends
explicitly, while also addressing cases like vfio-pci's, so we
implement that approach here.

An alternative proposal involving having VFIO emit a separate event
to denote completion of host-side cleanup was discussed, but the
prevailing opinion seems to be that it is not worth the added
complexity, and leaves the issue open for other Device implementations
to solve in the future.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Tested-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20171016222315.407-4-mdroth@linux.vnet.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-10-18 10:34:50 +02:00
Michael Roth 2fc06c4ac6 Revert "qdev: Free QemuOpts when the QOM path goes away"
This reverts commit abed886ec6.

This patch originally addressed an issue where a DEVICE_DELETED
event could be emitted (in device_unparent()) before a Device's
QemuOpts were cleaned up (in device_finalize()), leading to a
"duplicate ID" error if management attempted to immediately add
a device with the same ID in response to the DEVICE_DELETED event.

An alternative will be implemented in a subsequent patch where we
defer the DEVICE_DELETED event until device_finalize(), which would
also prevent the race, so we revert the original fix in preparation.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Tested-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20171016222315.407-3-mdroth@linux.vnet.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-10-18 10:34:50 +02:00