aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2019-07-16 15:08:29 +0100
committerPeter Maydell <peter.maydell@linaro.org>2019-07-16 15:08:29 +0100
commit697f59243f5a28b8a243ff5ad59e34bbecffcae1 (patch)
tree2fc3d16a3c39aa3576cc7fd65a208a43ad6e5e92 /hw
parentd7179eca739f52457ae08822cc7f414d3ddea3f8 (diff)
parent45d8bc3adedeceaf449d758aee1810bfbe6feff4 (diff)
downloadqemu-697f59243f5a28b8a243ff5ad59e34bbecffcae1.zip
qemu-697f59243f5a28b8a243ff5ad59e34bbecffcae1.tar.gz
qemu-697f59243f5a28b8a243ff5ad59e34bbecffcae1.tar.bz2
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
* 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) # gpg: Signature made Tue 16 Jul 2019 08:31:27 BST # gpg: using RSA key BFFBD25F78C7AE83 # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full] # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" [full] # 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: vl: make sure char-pty message displayed by moving setbuf to the beginning create_config: remove $(CONFIG_SOFTMMU) hack Makefile: do not repeat $(CONFIG_SOFTMMU) in hw/Makefile.objs hw/usb/Kconfig: USB_XHCI_NEC requires USB_XHCI hw/usb/Kconfig: Add CONFIG_USB_EHCI_PCI target/i386: sev: Do not unpin ram device memory region checkpatch: detect doubly-encoded UTF-8 hw/lm32/Kconfig: Milkymist One provides a USB 1.1 Controller util: merge main-loop.c and iohandler.c Fix broken build with WHPX enabled memory: unref the memory region in simplify flatview hw/i386: turn off vmport if CONFIG_VMPORT is disabled rdmacm-mux: fix strcpy string warning build-sys: remove slirp cflags from main-loop.o iscsi: base all handling of check condition on scsi_sense_to_errno iscsi: fix busy/timeout/task set full scsi: add guest-recoverable ZBC errors scsi: explicitly list guest-recoverable sense codes scsi-disk: pass sense correctly for guest-recoverable errors Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/Makefile.objs61
-rw-r--r--hw/i386/Kconfig4
-rw-r--r--hw/i386/pc.c5
-rw-r--r--hw/lm32/Kconfig1
-rw-r--r--hw/scsi/scsi-disk.c15
-rw-r--r--hw/usb/Kconfig11
-rw-r--r--hw/usb/Makefile.objs5
7 files changed, 62 insertions, 40 deletions
diff --git a/hw/Makefile.objs b/hw/Makefile.objs
index d770926..ece6cc3 100644
--- a/hw/Makefile.objs
+++ b/hw/Makefile.objs
@@ -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)
diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig
index 4ddf2a9..b9c96ac 100644
--- a/hw/i386/Kconfig
+++ b/hw/i386/Kconfig
@@ -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
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index c33ce47..549c437 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -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;
diff --git a/hw/lm32/Kconfig b/hw/lm32/Kconfig
index 3d09c2d..ed2e306 100644
--- a/hw/lm32/Kconfig
+++ b/hw/lm32/Kconfig
@@ -11,3 +11,4 @@ config MILKYMIST
select PFLASH_CFI01
select FRAMEBUFFER
select SD
+ select USB_OHCI
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index ed7295b..8e95e3e 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -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);
@@ -452,13 +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));
@@ -2894,6 +2896,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 +3067,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;
diff --git a/hw/usb/Kconfig b/hw/usb/Kconfig
index 564305e..555e093 100644
--- a/hw/usb/Kconfig
+++ b/hw/usb/Kconfig
@@ -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
@@ -37,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
diff --git a/hw/usb/Makefile.objs b/hw/usb/Makefile.objs
index 81688f6..303ac08 100644
--- a/hw/usb/Makefile.objs
+++ b/hw/usb/Makefile.objs
@@ -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