- Add a patch for the virtio crashing issue

- Remove a patch no longer necessary

from Brad (maintainer)
This commit is contained in:
ajacoutot 2018-09-05 07:01:50 +00:00
parent e44539a659
commit dacb48dcd8
3 changed files with 41 additions and 13 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.180 2018/09/04 12:46:12 espie Exp $
# $OpenBSD: Makefile,v 1.181 2018/09/05 07:01:50 ajacoutot Exp $
USE_WXNEEDED= Yes
@ -7,10 +7,10 @@ ONLY_FOR_ARCHS= aarch64 amd64 arm i386 powerpc sparc64
COMMENT= multi system emulator
DISTNAME= qemu-3.0.0
REVISION= 1
CATEGORIES= emulators
MASTER_SITES= https://download.qemu.org/
EXTRACT_SUFX= .tar.xz
REVISION= 0
HOMEPAGE= https://www.qemu.org/

View File

@ -1,21 +1,11 @@
$OpenBSD: patch-configure,v 1.57 2018/08/17 07:18:59 ajacoutot Exp $
$OpenBSD: patch-configure,v 1.58 2018/09/05 07:01:50 ajacoutot Exp $
- Fix TLS test to work with Clang's emulated TLS
- Fix curses test to work on OpenBSD
- More appropriate CFLAGS handling
Index: configure
--- configure.orig
+++ configure
@@ -1876,7 +1876,7 @@ static __thread int tls_var;
int main(void) { return tls_var; }
EOF
-if ! compile_prog "-Werror" "" ; then
+if ! compile_prog "-Werror" "-pthread" ; then
error_exit "Your compiler does not support the __thread specifier for " \
"Thread-Local Storage (TLS). Please upgrade to a version that does."
fi
@@ -3371,6 +3371,7 @@ if test "$curses" != "no" ; then
fi
curses_found=no

View File

@ -0,0 +1,38 @@
$OpenBSD: patch-hw_virtio_virtio_c,v 1.4 2018/09/05 07:01:50 ajacoutot Exp $
Because the cache is sized to include the rings and the event indices,
negotiating the VIRTIO_RING_F_EVENT_IDX feature will result in the size
of the cache changing. And because MemoryRegionCache accesses are
range-checked, if we skip this we end up with an assertion failure.
Index: hw/virtio/virtio.c
--- hw/virtio/virtio.c.orig
+++ hw/virtio/virtio.c
@@ -2006,14 +2006,25 @@ static int virtio_set_features_nocheck(VirtIODevice *v
int virtio_set_features(VirtIODevice *vdev, uint64_t val)
{
- /*
+ int ret;
+ /*
* The driver must not attempt to set features after feature negotiation
* has finished.
*/
if (vdev->status & VIRTIO_CONFIG_S_FEATURES_OK) {
return -EINVAL;
}
- return virtio_set_features_nocheck(vdev, val);
+ ret = virtio_set_features_nocheck(vdev, val);
+ if (!ret && virtio_vdev_has_feature(vdev, VIRTIO_RING_F_EVENT_IDX)) {
+ /* VIRTIO_RING_F_EVENT_IDX changes the size of the caches. */
+ int i;
+ for (i = 0; i < VIRTIO_QUEUE_MAX; i++) {
+ if (vdev->vq[i].vring.num != 0) {
+ virtio_init_region_cache(vdev, i);
+ }
+ }
+ }
+ return ret;
}
int virtio_load(VirtIODevice *vdev, QEMUFile *f, int version_id)