Skip to contentSkip to conversation

Bugfix/cleanup patches for 2019-07-16

GIT PULL Applied Paolo Bonzini 4 participants 26 messages Jul 16, 2019 – Jul 19, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

The following changes since commit 46cd24e7ed38191b5ab5c40a836d6c5b6b604f8a:

Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2019-07-12 17:34:13 +0100)

are available in the git repository at:

git://github.com/bonzini/qemu.git tags/for-upstream

for you to fetch changes up to 45d8bc3adedeceaf449d758aee1810bfbe6feff4:

vl: make sure char-pty message displayed by moving setbuf to the beginning (2019-07-16 09:27:16 +0200)

----------------------------------------------------------------
* VFIO bugfix for AMD SEV (Alex)
* Kconfig improvements (Julio, Philippe)
* MemoryRegion reference counting bugfix (King Wang)
* Build system cleanups (Marc-André, myself)
* rdmacm-mux off-by-one (Marc-André)
* ZBC passthrough fixes (Shinichiro, myself)
* WHPX build fix (Stefan)
* char-pty fix (Wei Yang)

----------------------------------------------------------------
Alex Williamson (1):
target/i386: sev: Do not unpin ram device memory region

Julio Montes (1):
hw/i386: turn off vmport if CONFIG_VMPORT is disabled

King Wang (1):
memory: unref the memory region in simplify flatview

Marc-André Lureau (2):
build-sys: remove slirp cflags from main-loop.o
rdmacm-mux: fix strcpy string warning

Paolo Bonzini (8):
scsi: explicitly list guest-recoverable sense codes
scsi: add guest-recoverable ZBC errors
iscsi: fix busy/timeout/task set full
iscsi: base all handling of check condition on scsi_sense_to_errno
util: merge main-loop.c and iohandler.c
checkpatch: detect doubly-encoded UTF-8
Makefile: do not repeat $(CONFIG_SOFTMMU) in hw/Makefile.objs
create_config: remove $(CONFIG_SOFTMMU) hack

Philippe Mathieu-Daudé (3):
hw/lm32/Kconfig: Milkymist One provides a USB 1.1 Controller hw/usb/Kconfig: Add CONFIG_USB_EHCI_PCI hw/usb/Kconfig: USB_XHCI_NEC requires USB_XHCI

Shinichiro Kawasaki (1):
scsi-disk: pass sense correctly for guest-recoverable errors

Stefan Weil (1):
Fix broken build with WHPX enabled

Wei Yang (1):
vl: make sure char-pty message displayed by moving setbuf to the beginning

 block/iscsi.c             |  29 +++++-----
 configure                 |   2 +-
 contrib/rdmacm-mux/main.c |   2 +-
 hw/Makefile.objs          |  61 +++++++++++----------
 hw/i386/Kconfig           |   4 +-
 hw/i386/pc.c              |   5 ++
 hw/lm32/Kconfig           |   1 +
 hw/scsi/scsi-disk.c       |  15 ++++--
 hw/usb/Kconfig            |  11 ++--
 hw/usb/Makefile.objs      |   5 +-
 include/scsi/utils.h      |   1 +
 memory.c                  |   5 +-
 scripts/checkpatch.pl     |  16 ++++++
 scripts/create_config     |   2 +-
 scsi/utils.c              |  53 ++++++++++++++++--
 target/i386/sev.c         |  11 ++++
 target/i386/whpx-all.c    |   4 +-
 util/Makefile.objs        |   3 +-
 util/iohandler.c          | 135 ----------------------------------------------
 util/main-loop.c          | 110 +++++++++++++++++++++++++++++++++++++
 vl.c                      |   4 +-
 21 files changed, 276 insertions(+), 203 deletions(-)
 delete mode 100644 util/iohandler.c
Signature · 1 line
1.8.3.1
#1 lore raw

[Qemu-devel] [PULL 01/19] scsi-disk: pass sense correctly for guest-recoverable errors

From: Shinichiro Kawasaki <[email protected]>

When an error was passed down to the guest because it was recoverable, the sense length was not copied from the SG_IO data. As a result, the guest saw the CHECK CONDITION status but not the sense data.

---
 hw/scsi/scsi-disk.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
hw/scsi/scsi-disk.c +10 -0
index ed7295b..5d3fb3c 100644
@@ -62,6 +62,7 @@ typedef struct SCSIDiskClass {
     DMAIOFunc       *dma_readv;
     DMAIOFunc       *dma_writev;
     bool            (*need_fua_emulation)(SCSICommand *cmd);
+    void            (*update_sense)(SCSIRequest *r);
 } SCSIDiskClass;
 
 typedef struct SCSIDiskReq {
@@ -438,6 +439,7 @@ static bool scsi_handle_rw_error(SCSIDiskReq *r, int error, bool acct_failed)
 {
     bool is_read = (r->req.cmd.mode == SCSI_XFER_FROM_DEV);
     SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev);
+    SCSIDiskClass *sdc = (SCSIDiskClass *) object_get_class(OBJECT(s));
     BlockErrorAction action = blk_get_error_action(s->qdev.conf.blk,
                                                    is_read, error);
 
@@ -456,6 +458,7 @@ static bool scsi_handle_rw_error(SCSIDiskReq *r, int error, bool acct_failed)
             if (error == ECANCELED || error == EAGAIN || error == ENOTCONN ||
                 error == 0)  {
                 /* These errors are handled by guest. */
+                sdc->update_sense(&r->req);
                 scsi_req_complete(&r->req, *r->status);
                 return true;
             }
@@ -2894,6 +2897,12 @@ static int scsi_block_parse_cdb(SCSIDevice *d, SCSICommand *cmd,
     }
 }
 
+static void scsi_block_update_sense(SCSIRequest *req)
+{
+    SCSIDiskReq *r = DO_UPCAST(SCSIDiskReq, req, req);
+    SCSIBlockReq *br = DO_UPCAST(SCSIBlockReq, req, r);
+    r->req.sense_len = MIN(br->io_header.sb_len_wr, sizeof(r->req.sense));
+}
 #endif
 
 static
@@ -3059,6 +3068,7 @@ static void scsi_block_class_initfn(ObjectClass *klass, void *data)
     sc->parse_cdb    = scsi_block_parse_cdb;
     sdc->dma_readv   = scsi_block_dma_readv;
     sdc->dma_writev  = scsi_block_dma_writev;
+    sdc->update_sense = scsi_block_update_sense;
     sdc->need_fua_emulation = scsi_block_no_fua;
     dc->desc = "SCSI block device passthrough";
     dc->props = scsi_block_properties;
Signature · 1 line
1.8.3.1
#2 lore raw

[Qemu-devel] [PULL 02/19] scsi: explicitly list guest-recoverable sense codes

In reply to Paolo Bonzini

It's not really possible to fit all sense codes into errno codes, especially in such a way that sense codes can be properly categorized as either guest-recoverable or host-handled. Create a new function that checks for guest recoverable sense, then scsi_sense_buf_to_errno only needs to be called for host handled sense codes.

---
 hw/scsi/scsi-disk.c  |  5 ++---
 include/scsi/utils.h |  1 +
 scsi/utils.c         | 43 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 46 insertions(+), 3 deletions(-)
hw/scsi/scsi-disk.c +2 -3
index 5d3fb3c..8e95e3e 100644
@@ -454,14 +454,13 @@ static bool scsi_handle_rw_error(SCSIDiskReq *r, int error, bool acct_failed)
              * pause the host.
              */
             assert(r->status && *r->status);
-            error = scsi_sense_buf_to_errno(r->req.sense, sizeof(r->req.sense));
-            if (error == ECANCELED || error == EAGAIN || error == ENOTCONN ||
-                error == 0)  {
+            if (scsi_sense_buf_is_guest_recoverable(r->req.sense, sizeof(r->req.sense))) {
                 /* These errors are handled by guest. */
                 sdc->update_sense(&r->req);
                 scsi_req_complete(&r->req, *r->status);
                 return true;
             }
+            error = scsi_sense_buf_to_errno(r->req.sense, sizeof(r->req.sense));
             break;
         case ENOMEDIUM:
             scsi_check_condition(r, SENSE_CODE(NO_MEDIUM));
include/scsi/utils.h +1 -0
index 9351b21..fbc5588 100644
@@ -106,6 +106,7 @@ extern const struct SCSISense sense_code_SPACE_ALLOC_FAILED;
 
 int scsi_sense_to_errno(int key, int asc, int ascq);
 int scsi_sense_buf_to_errno(const uint8_t *sense, size_t sense_size);
+bool scsi_sense_buf_is_guest_recoverable(const uint8_t *sense, size_t sense_size);
 
 int scsi_convert_sense(uint8_t *in_buf, int in_len,
                        uint8_t *buf, int len, bool fixed);
scsi/utils.c +43 -0

55 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#3 lore raw

[Qemu-devel] [PULL 05/19] iscsi: base all handling of check condition on scsi_sense_to_errno

In reply to Paolo Bonzini

Now that scsi-disk is not using scsi_sense_to_errno to separate guest-recoverable sense codes, we can modify it to simplify iscsi's own sense handling.

---
 block/iscsi.c | 29 ++++++++++++++---------------
 scsi/utils.c  |  5 ++---
 2 files changed, 16 insertions(+), 18 deletions(-)
block/iscsi.c +14 -15
index 6e238bf..506bf5f 100644
@@ -225,9 +225,9 @@ static inline unsigned exp_random(double mean)
 
 static int iscsi_translate_sense(struct scsi_sense *sense)
 {
-    return - scsi_sense_to_errno(sense->key,
-                                 (sense->ascq & 0xFF00) >> 8,
-                                 sense->ascq & 0xFF);
+    return scsi_sense_to_errno(sense->key,
+                               (sense->ascq & 0xFF00) >> 8,
+                               sense->ascq & 0xFF);
 }
 
 /* Called (via iscsi_service) with QemuMutex held.  */
@@ -244,13 +244,6 @@ iscsi_co_generic_cb(struct iscsi_context *iscsi, int status,
 
     if (status != SCSI_STATUS_GOOD) {
         if (iTask->retries++ < ISCSI_CMD_RETRIES) {
-            if (status == SCSI_STATUS_CHECK_CONDITION
-                && task->sense.key == SCSI_SENSE_UNIT_ATTENTION) {
-                error_report("iSCSI CheckCondition: %s",
-                             iscsi_get_error(iscsi));
-                iTask->do_retry = 1;
-                goto out;
-            }
             if (status == SCSI_STATUS_BUSY ||
                 status == SCSI_STATUS_TIMEOUT ||
                 status == SCSI_STATUS_TASK_SET_FULL) {
@@ -272,14 +265,20 @@ iscsi_co_generic_cb(struct iscsi_context *iscsi, int status,
                 timer_mod(&iTask->retry_timer,
                           qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + retry_time);
                 iTask->do_retry = 1;
-                goto out;
+            }
+        } else if (status == SCSI_STATUS_CHECK_CONDITION) {
+            int error = iscsi_translate_sense(&task->sense);
+            if (error == EAGAIN) {
+                error_report("iSCSI CheckCondition: %s",
+                             iscsi_get_error(iscsi));
+                iTask->do_retry = 1;
+            } else {
+                iTask->err_code = -error;
+                iTask->err_str = g_strdup(iscsi_get_error(iscsi));
             }
         }
-        iTask->err_code = iscsi_translate_sense(&task->sense);
-        iTask->err_str = g_strdup(iscsi_get_error(iscsi));
     }
 
-out:
     if (iTask->co) {
         aio_bh_schedule_oneshot(iTask->iscsilun->aio_context,
                                  iscsi_co_generic_bh_cb, iTask);
@@ -974,7 +973,7 @@ iscsi_aio_ioctl_cb(struct iscsi_context *iscsi, int status,
     if (status < 0) {
         error_report("Failed to ioctl(SG_IO) to iSCSI lun. %s",
                      iscsi_get_error(iscsi));
-        acb->status = iscsi_translate_sense(&acb->task->sense);
+        acb->status = -iscsi_translate_sense(&acb->task->sense);
     }
 
     acb->ioh->driver_status = 0;
scsi/utils.c +2 -3
index 873d49c..c50e81f 100644
@@ -379,8 +379,7 @@ int scsi_sense_to_errno(int key, int asc, int ascq)
     case NO_SENSE:
     case RECOVERED_ERROR:
     case UNIT_ATTENTION:
-        /* These sense keys are not errors */
-        return 0;
+        return EAGAIN;
     case ABORTED_COMMAND: /* COMMAND ABORTED */
         return ECANCELED;
     case NOT_READY:
@@ -409,7 +408,7 @@ int scsi_sense_to_errno(int key, int asc, int ascq)
     case 0x2700: /* WRITE PROTECTED */
         return EACCES;
     case 0x0401: /* NOT READY, IN PROGRESS OF BECOMING READY */
-        return EAGAIN;
+        return EINPROGRESS;
     case 0x0402: /* NOT READY, INITIALIZING COMMAND REQUIRED */
         return ENOTCONN;
     default:
Signature · 1 line
1.8.3.1
#4 lore raw

[Qemu-devel] [PULL 04/19] iscsi: fix busy/timeout/task set full

In reply to Paolo Bonzini

In this case, do_retry was set without calling aio_co_wake, thus never waking up the coroutine.

---
 block/iscsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block/iscsi.c +1 -1
index 267f160..6e238bf 100644
@@ -272,7 +272,7 @@ iscsi_co_generic_cb(struct iscsi_context *iscsi, int status,
                 timer_mod(&iTask->retry_timer,
                           qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + retry_time);
                 iTask->do_retry = 1;
-                return;
+                goto out;
             }
         }
         iTask->err_code = iscsi_translate_sense(&task->sense);
Signature · 1 line
1.8.3.1
#5 lore raw

[Qemu-devel] [PULL 03/19] scsi: add guest-recoverable ZBC errors

In reply to Paolo Bonzini

When running basic operations on zoned storage from the guest via scsi-block, the following ASCs are reported for write or read commands due to unexpected zone status or write pointer status:

21h 04h: UNALIGNED WRITE COMMAND
21h 05h: WRITE BOUNDARY VIOLATION
21h 06h: ATTEMPT TO READ INVALID DATA
55h 0Eh: INSUFFICIENT ZONE RESOURCES

Reporting these ASCs to the guest, the user applications can handle them to manage zone/write pointer status, or help the user application developers to understand the failure reason and fix bugs.

---
 scsi/utils.c | 5 +++++
 1 file changed, 5 insertions(+)
scsi/utils.c +5 -0
index ad243a9..873d49c 100644
@@ -360,6 +360,11 @@ static bool scsi_sense_is_guest_recoverable(int key, int asc, int ascq)
     case 0x2500: /* LOGICAL UNIT NOT SUPPORTED */
     case 0x2600: /* INVALID FIELD IN PARAMETER LIST */
 
+    case 0x2104: /* UNALIGNED WRITE COMMAND */
+    case 0x2105: /* WRITE BOUNDARY VIOLATION */
+    case 0x2106: /* ATTEMPT TO READ INVALID DATA */
+    case 0x550e: /* INSUFFICIENT ZONE RESOURCES */
+
     case 0x0401: /* NOT READY, IN PROGRESS OF BECOMING READY */
     case 0x0402: /* NOT READY, INITIALIZING COMMAND REQUIRED */
         return true;
Signature · 1 line
1.8.3.1
#6 lore raw

[Qemu-devel] [PULL 13/19] checkpatch: detect doubly-encoded UTF-8

In reply to Paolo Bonzini

Copy and pasting from Thunderbird's "view source" window results in double encoding of multibyte UTF-8 sequences. The appearance of those sequences is very peculiar, so detect it and give an error despite the (low) possibility of false positives.

As the major offender, I am also adding the same check to my applypatch-msg and commit-msg hooks, but this will also cause patchew to croak loudly when this mistake happens.

Message-Id: <[email protected]>

---
 scripts/checkpatch.pl | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
scripts/checkpatch.pl +16 -0
index 2f81371..d24c944 100755
@@ -262,6 +262,19 @@ our $UTF8	= qr{
 	| $NON_ASCII_UTF8
 }x;
 
+# some readers default to ISO-8859-1 when showing email source. detect
+# when UTF-8 is incorrectly interpreted as ISO-8859-1 and reencoded back.
+# False positives are possible but very unlikely.
+our $UTF8_MOJIBAKE = qr{
+	\xC3[\x82-\x9F] \xC2[\x80-\xBF]                    # c2-df 80-bf
+	| \xC3\xA0 \xC2[\xA0-\xBF] \xC2[\x80-\xBF]         # e0 a0-bf 80-bf
+	| \xC3[\xA1-\xAC\xAE\xAF] (?: \xC2[\x80-\xBF]){2}  # e1-ec/ee/ef 80-bf 80-bf
+	| \xC3\xAD \xC2[\x80-\x9F] \xC2[\x80-\xBF]         # ed 80-9f 80-bf
+	| \xC3\xB0 \xC2[\x90-\xBF] (?: \xC2[\x80-\xBF]){2} # f0 90-bf 80-bf 80-bf
+	| \xC3[\xB1-\xB3] (?: \xC2[\x80-\xBF]){3}          # f1-f3 80-bf 80-bf 80-bf
+	| \xC3\xB4 \xC2[\x80-\x8F] (?: \xC2[\x80-\xBF]){2} # f4 80-b8 80-bf 80-bf
+}x;
+
 # There are still some false positives, but this catches most
 # common cases.
 our $typeTypedefs = qr{(?x:
@@ -1506,6 +1519,9 @@ sub process {
 			ERROR("Invalid UTF-8, patch and commit message should be encoded in UTF-8\n" . $hereptr);
 		}
 
+		if ($rawline =~ m/$UTF8_MOJIBAKE/) {
+			ERROR("Doubly-encoded UTF-8\n" . $herecurr);
+		}
 # Check if it's the start of a commit log
 # (not a header line and we haven't seen the patch filename)
 		if ($in_header_lines && $realfile =~ /^$/ &&
Signature · 1 line
1.8.3.1
#7 lore raw

[Qemu-devel] [PULL 07/19] rdmacm-mux: fix strcpy string warning

In reply to Paolo Bonzini

From: Marc-André Lureau <[email protected]>

../contrib/rdmacm-mux/main.c: In function ‘parse_args’:
../contrib/rdmacm-mux/main.c:118:13: error: ‘strncpy’ specified bound 3835 equals destination size [-Werror=stringop-truncation]
118 | strncpy(unix_socket_path, optarg, SOCKET_PATH_MAX);

Message-Id: <[email protected]>

---
 contrib/rdmacm-mux/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
contrib/rdmacm-mux/main.c +1 -1
index 30c7052..de53048 100644
@@ -115,7 +115,7 @@ static void parse_args(int argc, char *argv[])
 
         case 's':
             /* This is temporary, final name will build below */
-            strncpy(unix_socket_path, optarg, SOCKET_PATH_MAX);
+            strncpy(unix_socket_path, optarg, SOCKET_PATH_MAX - 1);
             break;
 
         case 'p':
Signature · 1 line
1.8.3.1
#8 lore raw

[Qemu-devel] [PULL 08/19] hw/i386: turn off vmport if CONFIG_VMPORT is disabled

In reply to Paolo Bonzini

From: Julio Montes <[email protected]>

vmport device is not included when CONFIG_VMPORT is disabled, hence QEMU fails with the following error:

Unknown device 'vmport' for bus 'ISA': unknown.

v2: imply VMPORT (Paolo Bonzini )

Message-Id: <[email protected]>

---
 hw/i386/Kconfig | 4 ++--
 hw/i386/pc.c    | 5 +++++
 2 files changed, 7 insertions(+), 2 deletions(-)
hw/i386/Kconfig +2 -2
index 4ddf2a9..b9c96ac 100644
@@ -51,6 +51,7 @@ config PC_ACPI
 config I440FX
     bool
     imply E1000_PCI
+    imply VMPORT
     select PC_PCI
     select PC_ACPI
     select ACPI_SMBUS
@@ -58,7 +59,6 @@ config I440FX
     select IDE_PIIX
     select DIMM
     select SMBIOS
-    select VMPORT
     select VMMOUSE
     select FW_CFG_DMA
 
@@ -77,6 +77,7 @@ config Q35
     imply VTD
     imply AMD_IOMMU
     imply E1000E_PCI_EXPRESS
+    imply VMPORT
     select PC_PCI
     select PC_ACPI
     select PCI_EXPRESS_Q35
@@ -84,7 +85,6 @@ config Q35
     select AHCI_ICH9
     select DIMM
     select SMBIOS
-    select VMPORT
     select VMMOUSE
     select FW_CFG_DMA
 
hw/i386/pc.c +5 -0
index c33ce47..549c437 100644
@@ -83,6 +83,7 @@
 #include "hw/mem/memory-device.h"
 #include "sysemu/replay.h"
 #include "qapi/qmp/qerror.h"
+#include "config-devices.h"
 
 /* debug PC/ISA interrupts */
 //#define DEBUG_IRQ
@@ -2793,7 +2794,11 @@ static void pc_machine_initfn(Object *obj)
 
     pcms->max_ram_below_4g = 0; /* use default */
     pcms->smm = ON_OFF_AUTO_AUTO;
+#ifdef CONFIG_VMPORT
     pcms->vmport = ON_OFF_AUTO_AUTO;
+#else
+    pcms->vmport = ON_OFF_AUTO_OFF;
+#endif /* CONFIG_VMPORT */
     /* acpi build is enabled by default if machine supports it */
     pcms->acpi_build_enabled = PC_MACHINE_GET_CLASS(pcms)->has_acpi_build;
     pcms->smbus_enabled = true;
Signature · 1 line
1.8.3.1
#11 lore raw

[Qemu-devel] [PULL 06/19] build-sys: remove slirp cflags from main-loop.o

In reply to Paolo Bonzini

From: Marc-André Lureau <[email protected]>

Left over from c2d63650d962612cfa1b21302782d4cd12142c74.

Message-Id: <[email protected]>

---
 util/Makefile.objs | 1 -
 1 file changed, 1 deletion(-)
util/Makefile.objs +0 -1
index 3817820..68af3cd 100644
@@ -3,7 +3,6 @@ util-obj-y += bufferiszero.o
 util-obj-y += lockcnt.o
 util-obj-y += aiocb.o async.o aio-wait.o thread-pool.o qemu-timer.o
 util-obj-y += main-loop.o iohandler.o
-main-loop.o-cflags := $(SLIRP_CFLAGS)
 util-obj-$(call lnot,$(CONFIG_ATOMIC64)) += atomic64.o
 util-obj-$(CONFIG_POSIX) += aio-posix.o
 util-obj-$(CONFIG_POSIX) += compatfd.o
Signature · 1 line
1.8.3.1
#12 lore raw

[Qemu-devel] [PULL 09/19] memory: unref the memory region in simplify flatview

In reply to Paolo Bonzini

From: King Wang <[email protected]>

The memory region reference is increased when insert a range into flatview range array, then decreased by destroy flatview. If some flat range merged by flatview_simplify, the memory region reference can not be decreased by destroy flatview any more.

In this case, start virtual machine by the command line:
qemu-system-x86_64
-name guest=ubuntu,debug-threads=on
-machine pc,accel=kvm,usb=off,dump-guest-core=off
-cpu host
-m 16384
-realtime mlock=off
-smp 8,sockets=2,cores=4,threads=1
-object memory-backend-file,id=ram-node0,prealloc=yes,mem-path=/dev/hugepages,share=yes,size=8589934592 -numa node,nodeid=0,cpus=0-3,memdev=ram-node0
-object memory-backend-file,id=ram-node1,prealloc=yes,mem-path=/dev/hugepages,share=yes,size=8589934592 -numa node,nodeid=1,cpus=4-7,memdev=ram-node1
-no-user-config
-nodefaults
-rtc base=utc
-no-shutdown
-boot strict=on
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2
-device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x2
-device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x3
-drive file=ubuntu.qcow2,format=qcow2,if=none,id=drive-virtio-disk0,cache=none,aio=native -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -chardev pty,id=charserial0
-device isa-serial,chardev=charserial0,id=serial0
-device usb-tablet,id=input0,bus=usb.0,port=1
-vnc 0.0.0.0:0
-device VGA,id=video0,vgamem_mb=16,bus=pci.0,addr=0x5
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6
-msg timestamp=on

And run the script in guest OS:
while true
do

    setpci -s 00:06.0 04.b=03
	setpci -s 00:06.0 04.b=07

done

I found the reference of node0 HostMemoryBackendFile is a big one. (gdb) p numa_info[0]->node_memdev->parent.ref
$6 = 1636278
(gdb)

Message-Id: <[email protected]>

---
 memory.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
memory.c +4 -1
index 480f3d9..d8d42bd 100644
@@ -321,7 +321,7 @@ static bool can_merge(FlatRange *r1, FlatRange *r2)
 /* Attempt to simplify a view by merging adjacent ranges */
 static void flatview_simplify(FlatView *view)
 {
-    unsigned i, j;
+    unsigned i, j, k;
 
     i = 0;
     while (i < view->nr) {
@@ -332,6 +332,9 @@ static void flatview_simplify(FlatView *view)
             ++j;
         }
         ++i;
+        for (k = i; k < j; k++) {
+            memory_region_unref(view->ranges[k].mr);
+        }
         memmove(&view->ranges[i], &view->ranges[j],
                 (view->nr - j) * sizeof(view->ranges[j]));
         view->nr -= j - i;
Signature · 1 line
1.8.3.1
#13 lore raw

[Qemu-devel] [PULL 11/19] util: merge main-loop.c and iohandler.c

In reply to Paolo Bonzini

main-loop.c has a dependency on iohandler.c, and everything breaks if that dependency is instead satisfied by stubs/iohandler.c. Just put everything in the same file to avoid strange dependencies on the order of files in util-obj-y.

Message-Id: <[email protected]>

---
 util/Makefile.objs |   2 +-
 util/iohandler.c   | 135 -----------------------------------------------------
 util/main-loop.c   | 110 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 111 insertions(+), 136 deletions(-)
 delete mode 100644 util/iohandler.c
util/Makefile.objs +1 -1
index 68af3cd..41bf59d 100644
@@ -2,7 +2,7 @@ util-obj-y = osdep.o cutils.o unicode.o qemu-timer-common.o
 util-obj-y += bufferiszero.o
 util-obj-y += lockcnt.o
 util-obj-y += aiocb.o async.o aio-wait.o thread-pool.o qemu-timer.o
-util-obj-y += main-loop.o iohandler.o
+util-obj-y += main-loop.o
 util-obj-$(call lnot,$(CONFIG_ATOMIC64)) += atomic64.o
 util-obj-$(CONFIG_POSIX) += aio-posix.o
 util-obj-$(CONFIG_POSIX) += compatfd.o
util/iohandler.c deleted +0 -135

135 lines not on this page · raw message

util/main-loop.c +110 -0

119 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#14 lore raw

[Qemu-devel] [PULL 12/19] hw/lm32/Kconfig: Milkymist One provides a USB 1.1 Controller

In reply to Paolo Bonzini

From: Philippe Mathieu-Daudé <[email protected]>

The Milkymist SoftUSB block provides the OHCI USB standard (missed in 0858746b835).

Message-Id: <[email protected]>

---
 hw/lm32/Kconfig | 1 +
 1 file changed, 1 insertion(+)
hw/lm32/Kconfig +1 -0
index 3d09c2d..ed2e306 100644
@@ -11,3 +11,4 @@ config MILKYMIST
     select PFLASH_CFI01
     select FRAMEBUFFER
     select SD
+    select USB_OHCI
Signature · 1 line
1.8.3.1
#15 lore raw

[Qemu-devel] [PULL 10/19] Fix broken build with WHPX enabled

In reply to Paolo Bonzini

From: Stefan Weil <[email protected]>

Message-Id: <[email protected]>

---
 target/i386/whpx-all.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
target/i386/whpx-all.c +2 -2
index 31d4732..ed95105 100644
@@ -1396,7 +1396,7 @@ static int whpx_accel_init(MachineState *ms)
     }
 
     memset(&prop, 0, sizeof(WHV_PARTITION_PROPERTY));
-    prop.ProcessorCount = smp_cpus;
+    prop.ProcessorCount = ms->smp.cpus;
     hr = whp_dispatch.WHvSetPartitionProperty(
         whpx->partition,
         WHvPartitionPropertyCodeProcessorCount,
@@ -1405,7 +1405,7 @@ static int whpx_accel_init(MachineState *ms)
 
     if (FAILED(hr)) {
         error_report("WHPX: Failed to set partition core count to %d,"
-                     " hr=%08lx", smp_cores, hr);
+                     " hr=%08lx", ms->smp.cores, hr);
         ret = -EINVAL;
         goto error;
     }
Signature · 1 line
1.8.3.1
#16 lore raw

[Qemu-devel] [PULL 14/19] target/i386: sev: Do not unpin ram device memory region

In reply to Paolo Bonzini

From: Alex Williamson <[email protected]>

The commit referenced below skipped pinning ram device memory when ram blocks are added, we need to do the same when they're removed.

Cc Brijesh Singh <[email protected]>
Cc Paolo Bonzini <[email protected]>
Fixes cedc0ad539af ("target/i386: sev: Do not pin the ram device memory region")

Message-Id: <[email protected]>

---
 target/i386/sev.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
target/i386/sev.c +11 -0
index 6dbdc3c..5ba1384 100644
@@ -161,6 +161,17 @@ sev_ram_block_removed(RAMBlockNotifier *n, void *host, size_t size)
 {
     int r;
     struct kvm_enc_region range;
+    ram_addr_t offset;
+    MemoryRegion *mr;
+
+    /*
+     * The RAM device presents a memory region that should be treated
+     * as IO region and should not have been pinned.
+     */
+    mr = memory_region_from_host(host, &offset);
+    if (mr && memory_region_is_ram_device(mr)) {
+        return;
+    }
 
     range.addr = (__u64)(unsigned long)host;
     range.size = size;
Signature · 1 line
1.8.3.1
#17 lore raw

[Qemu-devel] [PULL 15/19] hw/usb/Kconfig: Add CONFIG_USB_EHCI_PCI

In reply to Paolo Bonzini

From: Philippe Mathieu-Daudé <[email protected]>

The USB_EHCI entry currently include PCI code. Since the EHCI implementation is already split in sysbus/PCI, add a new USB_EHCI_PCI. There are no logical changes, but the Kconfig dependencies tree is cleaner.

---
 hw/usb/Kconfig       | 9 ++++++---
 hw/usb/Makefile.objs | 5 +++--
 2 files changed, 9 insertions(+), 5 deletions(-)
hw/usb/Kconfig +6 -3
index 564305e..495c6f2 100644
@@ -19,13 +19,16 @@ config USB_OHCI_PCI
 
 config USB_EHCI
     bool
-    default y if PCI_DEVICES
-    depends on PCI
     select USB
 
+config USB_EHCI_PCI
+    bool
+    default y if PCI_DEVICES
+    select USB_EHCI
+
 config USB_EHCI_SYSBUS
     bool
-    select USB
+    select USB_EHCI
 
 config USB_XHCI
     bool
hw/usb/Makefile.objs +3 -2
index 81688f6..303ac08 100644
@@ -6,8 +6,9 @@ common-obj-$(CONFIG_USB) += desc.o desc-msos.o
 common-obj-$(CONFIG_USB_UHCI) += hcd-uhci.o
 common-obj-$(CONFIG_USB_OHCI) += hcd-ohci.o
 common-obj-$(CONFIG_USB_OHCI_PCI) += hcd-ohci-pci.o
-common-obj-$(CONFIG_USB_EHCI) += hcd-ehci.o hcd-ehci-pci.o
-common-obj-$(CONFIG_USB_EHCI_SYSBUS) += hcd-ehci.o hcd-ehci-sysbus.o
+common-obj-$(CONFIG_USB_EHCI) += hcd-ehci.o
+common-obj-$(CONFIG_USB_EHCI_PCI) += hcd-ehci-pci.o
+common-obj-$(CONFIG_USB_EHCI_SYSBUS) += hcd-ehci-sysbus.o
 common-obj-$(CONFIG_USB_XHCI) += hcd-xhci.o
 common-obj-$(CONFIG_USB_XHCI_NEC) += hcd-xhci-nec.o
 common-obj-$(CONFIG_USB_MUSB) += hcd-musb.o
Signature · 1 line
1.8.3.1
#18 lore raw

[Qemu-devel] [PULL 19/19] vl: make sure char-pty message displayed by moving setbuf to the beginning

In reply to Paolo Bonzini

From: Wei Yang <[email protected]>

Recently we found a behavior change after commit 6ade45f2ac93611 ('char-pty: Print "char device redirected" message to stdout').

When we redirect output to a file, the message "char device redirected to PTY_NAME (label LABEL)" would not be seen at the beginning of the file. Instead, the message is displayed after QEMU quit. This will block test automation.

The reason is this message is printed after we set line buffer mode. So move this to the beginning.

---
 vl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
vl.c +2 -2
index 5089fce..a5808f9 100644
@@ -2890,6 +2890,8 @@ int main(int argc, char **argv, char **envp)
     char *dir, **dirs;
     BlockdevOptionsQueue bdo_queue = QSIMPLEQ_HEAD_INITIALIZER(bdo_queue);
 
+    os_set_line_buffering();
+
     error_init(argv[0]);
     module_call_init(MODULE_INIT_TRACE);
 
@@ -4246,8 +4248,6 @@ int main(int argc, char **argv, char **envp)
         semihosting_arg_fallback(kernel_filename, kernel_cmdline);
     }
 
-    os_set_line_buffering();
-
     /* spice needs the timers to be initialized by this point */
     qemu_spice_init();
 
Signature · 1 line
1.8.3.1
#19 lore raw

[Qemu-devel] [PULL 18/19] create_config: remove $(CONFIG_SOFTMMU) hack

In reply to Paolo Bonzini

CONFIG_TPM is defined to a rather weird $(CONFIG_SOFTMMU) so that it expands to the right thing in hw/Makefile.objs. This however is not needed anymore and it has a corresponding hack in create_config to turn it into "#define CONFIG_TPM 1". Clean up.

---
 configure             | 2 +-
 scripts/create_config | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
configure +1 -1
index 4983c8b..eb635c3 100755
@@ -7159,7 +7159,7 @@ if test "$live_block_migration" = "yes" ; then
 fi
 
 if test "$tpm" = "yes"; then
-  echo 'CONFIG_TPM=$(CONFIG_SOFTMMU)' >> $config_host_mak
+  echo 'CONFIG_TPM=y' >> $config_host_mak
 fi
 
 echo "TRACE_BACKENDS=$trace_backends" >> $config_host_mak
scripts/create_config +1 -1
index 00e86c8..6d8f08b 100755
@@ -54,7 +54,7 @@ case $line in
     done
     echo "    NULL"
     ;;
- CONFIG_*='$(CONFIG_SOFTMMU)'|CONFIG_*=y) # configuration
+ CONFIG_*=y) # configuration
     name=${line%=*}
     echo "#define $name 1"
     ;;
Signature · 1 line
1.8.3.1
#20 lore raw

[Qemu-devel] [PULL 16/19] hw/usb/Kconfig: USB_XHCI_NEC requires USB_XHCI

In reply to Paolo Bonzini

From: Philippe Mathieu-Daudé <[email protected]>

TYPE_NEC_XHCI is child of TYPE_XHCI. Add the missing Kconfig dependency.

---
 hw/usb/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/usb/Kconfig +1 -1
index 495c6f2..555e093 100644
@@ -40,7 +40,7 @@ config USB_XHCI_NEC
     bool
     default y if PCI_DEVICES
     depends on PCI
-    select USB
+    select USB_XHCI
 
 config USB_MUSB
     bool
Signature · 1 line
1.8.3.1
#21 lore raw

[Qemu-devel] [PULL 17/19] Makefile: do not repeat $(CONFIG_SOFTMMU) in hw/Makefile.objs

In reply to Paolo Bonzini

The device directories must be included only for softmmu builds. Instead of repeating $(CONFIG_SOFTMMU), use an "if".

---
 hw/Makefile.objs | 61 +++++++++++++++++++++++++++++---------------------------
 1 file changed, 32 insertions(+), 29 deletions(-)
hw/Makefile.objs +32 -29
index d770926..ece6cc3 100644
@@ -1,42 +1,45 @@
+devices-dirs-y = core/
+ifeq ($(CONFIG_SOFTMMU), y)
 devices-dirs-$(call lor,$(CONFIG_VIRTIO_9P),$(call land,$(CONFIG_VIRTFS),$(CONFIG_XEN))) += 9pfs/
-devices-dirs-$(CONFIG_SOFTMMU) += acpi/
-devices-dirs-$(CONFIG_SOFTMMU) += adc/
-devices-dirs-$(CONFIG_SOFTMMU) += audio/
-devices-dirs-$(CONFIG_SOFTMMU) += block/
-devices-dirs-$(CONFIG_SOFTMMU) += bt/
-devices-dirs-$(CONFIG_SOFTMMU) += char/
-devices-dirs-$(CONFIG_SOFTMMU) += cpu/
-devices-dirs-$(CONFIG_SOFTMMU) += display/
-devices-dirs-$(CONFIG_SOFTMMU) += dma/
-devices-dirs-$(CONFIG_SOFTMMU) += gpio/
+devices-dirs-y += acpi/
+devices-dirs-y += adc/
+devices-dirs-y += audio/
+devices-dirs-y += block/
+devices-dirs-y += bt/
+devices-dirs-y += char/
+devices-dirs-y += cpu/
+devices-dirs-y += display/
+devices-dirs-y += dma/
+devices-dirs-y += gpio/
 devices-dirs-$(CONFIG_HYPERV) += hyperv/
 devices-dirs-$(CONFIG_I2C) += i2c/
-devices-dirs-$(CONFIG_SOFTMMU) += ide/
-devices-dirs-$(CONFIG_SOFTMMU) += input/
-devices-dirs-$(CONFIG_SOFTMMU) += intc/
+devices-dirs-y += ide/
+devices-dirs-y += input/
+devices-dirs-y += intc/
 devices-dirs-$(CONFIG_IPACK) += ipack/
 devices-dirs-$(CONFIG_IPMI) += ipmi/
-devices-dirs-$(CONFIG_SOFTMMU) += isa/
-devices-dirs-$(CONFIG_SOFTMMU) += misc/
-devices-dirs-$(CONFIG_SOFTMMU) += net/
-devices-dirs-$(CONFIG_SOFTMMU) += rdma/
-devices-dirs-$(CONFIG_SOFTMMU) += nvram/
-devices-dirs-$(CONFIG_SOFTMMU) += pci/
+devices-dirs-y += isa/
+devices-dirs-y += misc/
+devices-dirs-y += net/
+devices-dirs-y += rdma/
+devices-dirs-y += nvram/
+devices-dirs-y += pci/
 devices-dirs-$(CONFIG_PCI) += pci-bridge/ pci-host/
-devices-dirs-$(CONFIG_SOFTMMU) += pcmcia/
+devices-dirs-y += pcmcia/
 devices-dirs-$(CONFIG_SCSI) += scsi/
-devices-dirs-$(CONFIG_SOFTMMU) += sd/
-devices-dirs-$(CONFIG_SOFTMMU) += ssi/
-devices-dirs-$(CONFIG_SOFTMMU) += timer/
+devices-dirs-y += sd/
+devices-dirs-y += ssi/
+devices-dirs-y += timer/
 devices-dirs-$(CONFIG_TPM) += tpm/
-devices-dirs-$(CONFIG_SOFTMMU) += usb/
+devices-dirs-y += usb/
 devices-dirs-$(CONFIG_VFIO) += vfio/
-devices-dirs-$(CONFIG_SOFTMMU) += virtio/
-devices-dirs-$(CONFIG_SOFTMMU) += watchdog/
-devices-dirs-$(CONFIG_SOFTMMU) += xen/
+devices-dirs-y += virtio/
+devices-dirs-y += watchdog/
+devices-dirs-y += xen/
 devices-dirs-$(CONFIG_MEM_DEVICE) += mem/
-devices-dirs-$(CONFIG_SOFTMMU) += smbios/
 devices-dirs-y += semihosting/
-devices-dirs-y += core/
+devices-dirs-y += smbios/
+endif
+
 common-obj-y += $(devices-dirs-y)
 obj-y += $(devices-dirs-y)
Signature · 1 line
1.8.3.1
#22 lore raw
In reply to Paolo Bonzini
Patchew URL: https://patchew.org/QEMU/[email protected]/

Patchew URL: https://patchew.org/QEMU/[email protected]/

Hi,

This series seems to have some coding style problems. See output below for more information:

Subject: [Qemu-devel] [PULL 00/19] Bugfix/cleanup patches for 2019-07-16
Type: series
Message-id: [email protected]

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
* [new tag] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'
db7c8bd vl: make sure char-pty message displayed by moving setbuf to the beginning 8f48c9a create_config: remove $(CONFIG_SOFTMMU) hack
ca11419 Makefile: do not repeat $(CONFIG_SOFTMMU) in hw/Makefile.objs 0131f11 hw/usb/Kconfig: USB_XHCI_NEC requires USB_XHCI
fd8977c hw/usb/Kconfig: Add CONFIG_USB_EHCI_PCI
1c7aad6 target/i386: sev: Do not unpin ram device memory region 6e17e8f checkpatch: detect doubly-encoded UTF-8
df73f94 hw/lm32/Kconfig: Milkymist One provides a USB 1.1 Controller 0538f34 util: merge main-loop.c and iohandler.c
8112363 Fix broken build with WHPX enabled
9ac7907 memory: unref the memory region in simplify flatview
15913c5 hw/i386: turn off vmport if CONFIG_VMPORT is disabled
e97ff84 rdmacm-mux: fix strcpy string warning
41bec64 build-sys: remove slirp cflags from main-loop.o
bf28a5e iscsi: base all handling of check condition on scsi_sense_to_errno ed55acf iscsi: fix busy/timeout/task set full
378b9f0 scsi: add guest-recoverable ZBC errors
0e2ded1 scsi: explicitly list guest-recoverable sense codes
6aaa445 scsi-disk: pass sense correctly for guest-recoverable errors

=== OUTPUT BEGIN ===
1/19 Checking commit 6aaa44542e0a (scsi-disk: pass sense correctly for guest-recoverable errors) 2/19 Checking commit 0e2ded152b3a (scsi: explicitly list guest-recoverable sense codes)
WARNING: line over 80 characters
#27: FILE: hw/scsi/scsi-disk.c:457:
+ if (scsi_sense_buf_is_guest_recoverable(r->req.sense, sizeof(r->req.sense))) {

WARNING: line over 80 characters
#45: FILE: include/scsi/utils.h:109:
+bool scsi_sense_buf_is_guest_recoverable(const uint8_t *sense, size_t sense_size);

total: 0 errors, 2 warnings, 78 lines checked

Patch 2/19 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
3/19 Checking commit 378b9f03db84 (scsi: add guest-recoverable ZBC errors)
4/19 Checking commit ed55acfce974 (iscsi: fix busy/timeout/task set full)
5/19 Checking commit bf28a5e8685d (iscsi: base all handling of check condition on scsi_sense_to_errno)
ERROR: return of an errno should typically be -ve (return -EAGAIN)
#88: FILE: scsi/utils.c:382:
+ return EAGAIN;

ERROR: return of an errno should typically be -ve (return -EINPROGRESS) #97: FILE: scsi/utils.c:411:
+ return EINPROGRESS;

total: 2 errors, 0 warnings, 74 lines checked

Patch 5/19 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

6/19 Checking commit 41bec64cc2c7 (build-sys: remove slirp cflags from main-loop.o) 7/19 Checking commit e97ff84ebcfc (rdmacm-mux: fix strcpy string warning) 8/19 Checking commit 15913c50a392 (hw/i386: turn off vmport if CONFIG_VMPORT is disabled) 9/19 Checking commit 9ac79075636c (memory: unref the memory region in simplify flatview) 10/19 Checking commit 8112363187e0 (Fix broken build with WHPX enabled) 11/19 Checking commit 0538f34bd405 (util: merge main-loop.c and iohandler.c)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #32:
deleted file mode 100644

WARNING: Block comments use a leading /* on a separate line #237: FILE: util/main-loop.c:578:
+/* reaping of zombies. right now we're not passing the status to

WARNING: Block comments use * on subsequent lines
#238: FILE: util/main-loop.c:579:
+/* reaping of zombies. right now we're not passing the status to
+ anyone, but it would be possible to add a callback. */

WARNING: Block comments use a trailing */ on a separate line #238: FILE: util/main-loop.c:579:
+ anyone, but it would be possible to add a callback. */

total: 0 errors, 4 warnings, 127 lines checked

Patch 11/19 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
12/19 Checking commit df73f94a7149 (hw/lm32/Kconfig: Milkymist One provides a USB 1.1 Controller) 13/19 Checking commit 6e17e8f7434a (checkpatch: detect doubly-encoded UTF-8)
WARNING: line over 80 characters
#35: FILE: scripts/checkpatch.pl:271:
+ | \xC3[\xA1-\xAC\xAE\xAF] (?: \xC2[\x80-\xBF]){2} # e1-ec/ee/ef 80-bf 80-bf

WARNING: line over 80 characters
#37: FILE: scripts/checkpatch.pl:273:
+ | \xC3\xB0 \xC2[\x90-\xBF] (?: \xC2[\x80-\xBF]){2} # f0 90-bf 80-bf 80-bf

WARNING: line over 80 characters
#38: FILE: scripts/checkpatch.pl:274:
+ | \xC3[\xB1-\xB3] (?: \xC2[\x80-\xBF]){3} # f1-f3 80-bf 80-bf 80-bf

WARNING: line over 80 characters
#39: FILE: scripts/checkpatch.pl:275:
+ | \xC3\xB4 \xC2[\x80-\x8F] (?: \xC2[\x80-\xBF]){2} # f4 80-b8 80-bf 80-bf

total: 0 errors, 4 warnings, 28 lines checked

Patch 13/19 has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
14/19 Checking commit 1c7aad662155 (target/i386: sev: Do not unpin ram device memory region) 15/19 Checking commit fd8977ce486f (hw/usb/Kconfig: Add CONFIG_USB_EHCI_PCI)
16/19 Checking commit 0131f1107c96 (hw/usb/Kconfig: USB_XHCI_NEC requires USB_XHCI)
17/19 Checking commit ca1141992871 (Makefile: do not repeat $(CONFIG_SOFTMMU) in hw/Makefile.objs) 18/19 Checking commit 8f48c9a92462 (create_config: remove $(CONFIG_SOFTMMU) hack)
19/19 Checking commit db7c8bd2b12b (vl: make sure char-pty message displayed by moving setbuf to the beginning) === OUTPUT END ===

Test command exited with code: 1

The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]

#23 lore raw
In reply to Paolo Bonzini
Quoted 24 lines · Paolo Bonzini

The following changes since commit 46cd24e7ed38191b5ab5c40a836d6c5b6b604f8a:

Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2019-07-12 17:34:13 +0100)

are available in the git repository at:

git://github.com/bonzini/qemu.git tags/for-upstream

for you to fetch changes up to 45d8bc3adedeceaf449d758aee1810bfbe6feff4:

vl: make sure char-pty message displayed by moving setbuf to the beginning (2019-07-16 09:27:16 +0200)

----------------------------------------------------------------
* VFIO bugfix for AMD SEV (Alex)
* Kconfig improvements (Julio, Philippe)
* MemoryRegion reference counting bugfix (King Wang)
* Build system cleanups (Marc-André, myself)
* rdmacm-mux off-by-one (Marc-André)
* ZBC passthrough fixes (Shinichiro, myself)
* WHPX build fix (Stefan)
* char-pty fix (Wei Yang)

Quoted 1 line

----------------------------------------------------------------

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/4.1
for any user-visible changes.

-- PMM

#9 lore raw

Re: [Qemu-devel] [PULL 08/19] hw/i386: turn off vmport if CONFIG_VMPORT is disabled

In reply to Paolo Bonzini

Hi,

Quoted 68 lines · Paolo Bonzini

From: Julio Montes <[email protected]>

vmport device is not included when CONFIG_VMPORT is disabled, hence QEMU fails with the following error:

Unknown device 'vmport' for bus 'ISA': unknown.

v2: imply VMPORT (Paolo Bonzini )

Message-Id: <[email protected]>

---
 hw/i386/Kconfig | 4 ++--
 hw/i386/pc.c    | 5 +++++
 2 files changed, 7 insertions(+), 2 deletions(-)
hw/i386/Kconfig +2 -2
index 4ddf2a9..b9c96ac 100644
@@ -51,6 +51,7 @@ config PC_ACPI
 config I440FX
     bool
     imply E1000_PCI
+    imply VMPORT
     select PC_PCI
     select PC_ACPI
     select ACPI_SMBUS
@@ -58,7 +59,6 @@ config I440FX
     select IDE_PIIX
     select DIMM
     select SMBIOS
-    select VMPORT
     select VMMOUSE
     select FW_CFG_DMA
 
@@ -77,6 +77,7 @@ config Q35
     imply VTD
     imply AMD_IOMMU
     imply E1000E_PCI_EXPRESS
+    imply VMPORT
     select PC_PCI
     select PC_ACPI
     select PCI_EXPRESS_Q35
@@ -84,7 +85,6 @@ config Q35
     select AHCI_ICH9
     select DIMM
     select SMBIOS
-    select VMPORT
     select VMMOUSE
     select FW_CFG_DMA
 
hw/i386/pc.c +1 -0
index c33ce47..549c437 100644
@@ -83,6 +83,7 @@
 #include "hw/mem/memory-device.h"
 #include "sysemu/replay.h"
 #include "qapi/qmp/qerror.h"
+#include "config-devices.h"
 
 /* debug PC/ISA interrupts */
 //#define DEBUG_IRQ
@@ -2793,7 +2794,11 @@ static void pc_machine_initfn(Object *obj)
 

hw/i386/pc.c static void pc_machine_initfn(Object *obj) · line 2804

Quoted 10 lines
hw/i386/pc.c +4 -0
     pcms->max_ram_below_4g = 0; /* use default */
     pcms->smm = ON_OFF_AUTO_AUTO;
+#ifdef CONFIG_VMPORT
     pcms->vmport = ON_OFF_AUTO_AUTO;
+#else
+    pcms->vmport = ON_OFF_AUTO_OFF;
+#endif /* CONFIG_VMPORT */
     /* acpi build is enabled by default if machine supports it */
     pcms->acpi_build_enabled = PC_MACHINE_GET_CLASS(pcms)->has_acpi_build;
     pcms->smbus_enabled = true;

Testing v4.1.0-rc1, this commit breaks ./configure --without-default-devices:

GEN i386-softmmu/config-devices.mak.tmp
select VMMOUSE if I440FX
select VMMOUSE if Q35
config VMMOUSE depends on VMPORT
Traceback (most recent call last):
File "scripts/minikconf.py", line 703, in <module>
config = data.compute_config()
File "scripts/minikconf.py", line 253, in compute_config
clause.process()
File "scripts/minikconf.py", line 188, in process
self.dest.set_value(False, self)
File "scripts/minikconf.py", line 118, in set_value
raise KconfigDataError('contradiction between clauses when setting
%s' % self)
__main__.KconfigDataError: contradiction between clauses when setting VMMOUSE

97fd1ea8c1065839ae4c19bfdc3590033a5b9788 is the first bad commit commit 97fd1ea8c1065839ae4c19bfdc3590033a5b9788

Author: Julio Montes <[email protected]>
Date:   Fri Jul 12 16:02:57 2019 +0000

hw/i386: turn off vmport if CONFIG_VMPORT is disabled

vmport device is not included when CONFIG_VMPORT is disabled, hence QEMU fails with the following error:

Unknown device 'vmport' for bus 'ISA': unknown.

v2: imply VMPORT (Paolo Bonzini )

Message-Id: <[email protected]>

#10 lore raw

Re: [Qemu-devel] [PULL 08/19] hw/i386: turn off vmport if CONFIG_VMPORT is disabled

Should VMMOUSE also be implied?

Paolo

Il mar 16 lug 2019, 20:55 Philippe Mathieu-Daudé <[email protected]> ha scritto:

Quoted 121 lines

Hi,

Quoted 66 lines · Paolo Bonzini

From: Julio Montes <[email protected]>

vmport device is not included when CONFIG_VMPORT is disabled, hence QEMU fails with the following error:

Unknown device 'vmport' for bus 'ISA': unknown.

v2: imply VMPORT (Paolo Bonzini )

Message-Id: <[email protected]>

---
 hw/i386/Kconfig | 4 ++--
 hw/i386/pc.c    | 5 +++++
 2 files changed, 7 insertions(+), 2 deletions(-)
hw/i386/Kconfig +2 -2
index 4ddf2a9..b9c96ac 100644
@@ -51,6 +51,7 @@ config PC_ACPI
 config I440FX
     bool
     imply E1000_PCI
+    imply VMPORT
     select PC_PCI
     select PC_ACPI
     select ACPI_SMBUS
@@ -58,7 +59,6 @@ config I440FX
     select IDE_PIIX
     select DIMM
     select SMBIOS
-    select VMPORT
     select VMMOUSE
     select FW_CFG_DMA
 
@@ -77,6 +77,7 @@ config Q35
     imply VTD
     imply AMD_IOMMU
     imply E1000E_PCI_EXPRESS
+    imply VMPORT
     select PC_PCI
     select PC_ACPI
     select PCI_EXPRESS_Q35
@@ -84,7 +85,6 @@ config Q35
     select AHCI_ICH9
     select DIMM
     select SMBIOS
-    select VMPORT
     select VMMOUSE
     select FW_CFG_DMA
 
hw/i386/pc.c +1 -0
index c33ce47..549c437 100644
@@ -83,6 +83,7 @@
 #include "hw/mem/memory-device.h"
 #include "sysemu/replay.h"
 #include "qapi/qmp/qerror.h"
+#include "config-devices.h"
 
 /* debug PC/ISA interrupts */
 //#define DEBUG_IRQ

hw/i386/pc.c static void pc_machine_initfn(Object *obj) · line 2803

Quoted 10 lines
hw/i386/pc.c +4 -0
@@ -2793,7 +2794,11 @@ static void pc_machine_initfn(Object *obj)
 
     pcms->max_ram_below_4g = 0; /* use default */
     pcms->smm = ON_OFF_AUTO_AUTO;
+#ifdef CONFIG_VMPORT
     pcms->vmport = ON_OFF_AUTO_AUTO;
+#else
+    pcms->vmport = ON_OFF_AUTO_OFF;
+#endif /* CONFIG_VMPORT */
     /* acpi build is enabled by default if machine supports it */
     pcms->acpi_build_enabled =

PC_MACHINE_GET_CLASS(pcms)->has_acpi_build;

hw/i386/pc.c static void pc_machine_initfn(Object *obj) · line 2804

Quoted 2 lines
hw/i386/pc.c +0 -0
     pcms->smbus_enabled = true;

Testing v4.1.0-rc1, this commit breaks ./configure --without-default-devices:

GEN i386-softmmu/config-devices.mak.tmp
select VMMOUSE if I440FX
select VMMOUSE if Q35
config VMMOUSE depends on VMPORT
Traceback (most recent call last):
File "scripts/minikconf.py", line 703, in <module>
config = data.compute_config()
File "scripts/minikconf.py", line 253, in compute_config
clause.process()
File "scripts/minikconf.py", line 188, in process
self.dest.set_value(False, self)
File "scripts/minikconf.py", line 118, in set_value
raise KconfigDataError('contradiction between clauses when setting
%s' % self)
__main__.KconfigDataError: contradiction between clauses when setting VMMOUSE

97fd1ea8c1065839ae4c19bfdc3590033a5b9788 is the first bad commit commit 97fd1ea8c1065839ae4c19bfdc3590033a5b9788

Author: Julio Montes <[email protected]>
Date:   Fri Jul 12 16:02:57 2019 +0000

hw/i386: turn off vmport if CONFIG_VMPORT is disabled

vmport device is not included when CONFIG_VMPORT is disabled, hence QEMU fails with the following error:

Unknown device 'vmport' for bus 'ISA': unknown.

v2: imply VMPORT (Paolo Bonzini )

Message-Id: <[email protected]>

#24 lore raw
In reply to Paolo Bonzini
Quoted 14 lines · Paolo Bonzini

The following changes since commit 46cd24e7ed38191b5ab5c40a836d6c5b6b604f8a:

Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2019-07-12 17:34:13 +0100)

are available in the git repository at:

git://github.com/bonzini/qemu.git tags/for-upstream

for you to fetch changes up to 45d8bc3adedeceaf449d758aee1810bfbe6feff4:

vl: make sure char-pty message displayed by moving setbuf to the beginning (2019-07-16 09:27:16 +0200)

Quoted 9 lines

----------------------------------------------------------------
* VFIO bugfix for AMD SEV (Alex)
* Kconfig improvements (Julio, Philippe)
* MemoryRegion reference counting bugfix (King Wang)
* Build system cleanups (Marc-André, myself)
* rdmacm-mux off-by-one (Marc-André)
* ZBC passthrough fixes (Shinichiro, myself)
* WHPX build fix (Stefan)
* char-pty fix (Wei Yang)

Hi Paolo -- it looks like this may have broken the travis config "--without-default-devices":

Here's a sample failing build:
https://travis-ci.org/qemu/qemu/jobs/559509325

minikconf barfs with "contradiction between clauses"

Traceback (most recent call last):
File "/home/travis/build/qemu/qemu/scripts/minikconf.py", line 703,
in <module>
config = data.compute_config()
File "/home/travis/build/qemu/qemu/scripts/minikconf.py", line 253,
in compute_config
clause.process()
File "/home/travis/build/qemu/qemu/scripts/minikconf.py", line 188, in process
self.dest.set_value(False, self)
File "/home/travis/build/qemu/qemu/scripts/minikconf.py", line 118,
in set_value
raise KconfigDataError('contradiction between clauses when setting
%s' % self)
__main__.KconfigDataError: contradiction between clauses when setting VMMOUSE

I guess this is Julio's commit 97fd1ea8c10658?

thanks
-- PMM

#25 lore raw
Quoted 2 lines · Peter Maydell

Hi Paolo -- it looks like this may have broken the travis config "--without-default-devices":

Alex Bennée already has a queued patch for this (and I did too but I removed it in favor of his). You can apply it directly from message-id <[email protected]>.

Paolo

Quoted 26 lines

Here's a sample failing build:
https://travis-ci.org/qemu/qemu/jobs/559509325

minikconf barfs with "contradiction between clauses"

Traceback (most recent call last):
File "/home/travis/build/qemu/qemu/scripts/minikconf.py", line 703,
in <module>
config = data.compute_config()
File "/home/travis/build/qemu/qemu/scripts/minikconf.py", line 253,
in compute_config
clause.process()
File "/home/travis/build/qemu/qemu/scripts/minikconf.py", line 188, in process
self.dest.set_value(False, self)
File "/home/travis/build/qemu/qemu/scripts/minikconf.py", line 118,
in set_value
raise KconfigDataError('contradiction between clauses when setting
%s' % self)
__main__.KconfigDataError: contradiction between clauses when setting VMMOUSE

I guess this is Julio's commit 97fd1ea8c10658?

thanks
-- PMM