From 57ac4a7a28fef81b80b547c64d26681edc4a2cda Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 30 Oct 2018 09:23:40 +0100 Subject: [PATCH 1/6] fmops: fix off-by-one in AR_TABLE and DR_TABLE array size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: P J P Reported-by: Wangjunqing Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Gerd Hoffmann Message-id: 20181030082340.17170-1-kraxel@redhat.com Suggested-by: Paolo Bonzini Signed-off-by: Gerd Hoffmann --- hw/audio/fmopl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/audio/fmopl.h b/hw/audio/fmopl.h index e7e578a48e..e008e72d7a 100644 --- a/hw/audio/fmopl.h +++ b/hw/audio/fmopl.h @@ -72,8 +72,8 @@ typedef struct fm_opl_f { /* Rhythm sention */ uint8_t rhythm; /* Rhythm mode , key flag */ /* time tables */ - int32_t AR_TABLE[75]; /* atttack rate tables */ - int32_t DR_TABLE[75]; /* decay rate tables */ + int32_t AR_TABLE[76]; /* attack rate tables */ + int32_t DR_TABLE[76]; /* decay rate tables */ uint32_t FN_TABLE[1024]; /* fnumber -> increment counter */ /* LFO */ int32_t *ams_table; From d2e550a82893d5498c4be51559ec2607d7f5e101 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Sun, 21 Oct 2018 21:07:21 +0200 Subject: [PATCH 2/6] ps2kbd: default to scan enabled after reset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A check for scan_enabled has been added to ps2_keyboard_event in commit 143c04c7e0639e53086519592ead15d2556bfbf2 to prevent stream corruption. This works well as long as operating system is resetting keyboard, or enabling it. This fixes IBM 40p firmware, which doesn't bother sending KBD_CMD_RESET, KBD_CMD_ENABLE or KBD_CMD_RESET_ENABLE before trying to use the keyboard. Signed-off-by: Hervé Poussineau Reviewed-by: Philippe Mathieu-Daudé Message-id: 20181021190721.2148-1-hpoussin@reactos.org Signed-off-by: Gerd Hoffmann --- hw/input/ps2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/input/ps2.c b/hw/input/ps2.c index 6c43fc2912..eb33ee9b6f 100644 --- a/hw/input/ps2.c +++ b/hw/input/ps2.c @@ -942,7 +942,7 @@ static void ps2_kbd_reset(void *opaque) trace_ps2_kbd_reset(opaque); ps2_common_reset(&s->common); - s->scan_enabled = 0; + s->scan_enabled = 1; s->translate = 0; s->scancode_set = 2; s->modifiers = 0; From b7ee9e4970bd76ca181ae6ea853c350e039eb71d Mon Sep 17 00:00:00 2001 From: Wang Xin Date: Fri, 23 Nov 2018 14:46:46 +0800 Subject: [PATCH 3/6] cirrus_vga/migration: update the bank offset before use The cirrus bank0/1 offset should be updated before we update the vram's alias offset. Signed-off-by: Wang Xin Message-id: 20181123064646.23036-1-linzhecheng@huawei.com Signed-off-by: Gerd Hoffmann --- hw/display/cirrus_vga.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c index d9b854d74d..a0e71469f4 100644 --- a/hw/display/cirrus_vga.c +++ b/hw/display/cirrus_vga.c @@ -2746,11 +2746,12 @@ static int cirrus_post_load(void *opaque, int version_id) s->vga.gr[0x00] = s->cirrus_shadow_gr0 & 0x0f; s->vga.gr[0x01] = s->cirrus_shadow_gr1 & 0x0f; + cirrus_update_bank_ptr(s, 0); + cirrus_update_bank_ptr(s, 1); cirrus_update_memory_access(s); /* force refresh */ s->vga.graphic_mode = -1; - cirrus_update_bank_ptr(s, 0); - cirrus_update_bank_ptr(s, 1); + return 0; } From 7ec910675929a593c9890f412125c31c578cde6e Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 23 Nov 2018 07:39:57 +0100 Subject: [PATCH 4/6] audio/hda: fix guest triggerable assert MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Guest writes to a readonly register trigger the assert in intel_hda_reg_write(). Add a check and just ignore them. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1628433 Signed-off-by: Gerd Hoffmann Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Philippe Mathieu-Daudé Message-id: 20181123063957.9515-1-kraxel@redhat.com --- hw/audio/intel-hda.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index 23a2cf6484..33e333cc26 100644 --- a/hw/audio/intel-hda.c +++ b/hw/audio/intel-hda.c @@ -23,6 +23,7 @@ #include "hw/pci/msi.h" #include "qemu/timer.h" #include "qemu/bitops.h" +#include "qemu/log.h" #include "hw/audio/soundhw.h" #include "intel-hda.h" #include "intel-hda-defs.h" @@ -929,6 +930,11 @@ static void intel_hda_reg_write(IntelHDAState *d, const IntelHDAReg *reg, uint32 if (!reg) { return; } + if (!reg->wmask) { + qemu_log_mask(LOG_GUEST_ERROR, "intel-hda: write to r/o reg %s\n", + reg->name); + return; + } if (d->debug) { time_t now = time(NULL); From 933d2d4bf2b9d7673872e6e46bb0fa15e44191fb Mon Sep 17 00:00:00 2001 From: linzhecheng Date: Tue, 20 Nov 2018 16:34:19 +0800 Subject: [PATCH 5/6] usb-host: set ifs.detached as true if kernel driver is not active If no kernel driver is active, we can already claim and perform I/O on it without detaching it. Signed-off-by: linzhecheng Message-id: 20181120083419.17716-1-linzhecheng@huawei.com Signed-off-by: Gerd Hoffmann --- hw/usb/host-libusb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c index f31e9cbbb8..b6602ded4e 100644 --- a/hw/usb/host-libusb.c +++ b/hw/usb/host-libusb.c @@ -1120,6 +1120,9 @@ static void usb_host_detach_kernel(USBHostDevice *s) rc = libusb_kernel_driver_active(s->dh, i); usb_host_libusb_error("libusb_kernel_driver_active", rc); if (rc != 1) { + if (rc == 0) { + s->ifs[i].detached = true; + } continue; } trace_usb_host_detach_kernel(s->bus_num, s->addr, i); From e1ca8f7e1915496148f6e0ce1f7c2309af013312 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Thu, 22 Nov 2018 08:16:13 +0100 Subject: [PATCH 6/6] qapi: add query-display-options command Add query-display-options command, which allows querying the qemu display configuration. This isn't particularly useful, except it exposes QAPI type DisplayOptions in query-qmp-schema, so that libvirt can discover recently added -display parameter rendernode (commit d4dc4ab133b). Works around lack of sufficiently powerful command line introspection. Signed-off-by: Gerd Hoffmann Reviewed-by: Eric Blake Tested-by: Eric Blake Tested-by: Erik Skultety Message-id: 20181122071613.2889-1-kraxel@redhat.com [ kraxel: reworded commit message as suggested by armbru ] --- qapi/ui.json | 13 +++++++++++++ vl.c | 6 ++++++ 2 files changed, 19 insertions(+) diff --git a/qapi/ui.json b/qapi/ui.json index e0000248d3..fd39acb5c3 100644 --- a/qapi/ui.json +++ b/qapi/ui.json @@ -1102,3 +1102,16 @@ 'discriminator' : 'type', 'data' : { 'gtk' : 'DisplayGTK', 'egl-headless' : 'DisplayEGLHeadless'} } + +## +# @query-display-options: +# +# Returns information about display configuration +# +# Returns: @DisplayOptions +# +# Since: 3.1 +# +## +{ 'command': 'query-display-options', + 'returns': 'DisplayOptions' } diff --git a/vl.c b/vl.c index fa25d1ae2d..d6fd95c227 100644 --- a/vl.c +++ b/vl.c @@ -128,6 +128,7 @@ int main(int argc, char **argv) #include "qapi/qapi-commands-block-core.h" #include "qapi/qapi-commands-misc.h" #include "qapi/qapi-commands-run-state.h" +#include "qapi/qapi-commands-ui.h" #include "qapi/qmp/qerror.h" #include "sysemu/iothread.h" @@ -2055,6 +2056,11 @@ static void parse_display_qapi(const char *optarg) visit_free(v); } +DisplayOptions *qmp_query_display_options(Error **errp) +{ + return QAPI_CLONE(DisplayOptions, &dpy); +} + static void parse_display(const char *p) { const char *opts;