diff options
Diffstat (limited to 'hw')
-rw-r--r-- | hw/Makefile.objs | 61 | ||||
-rw-r--r-- | hw/i386/Kconfig | 4 | ||||
-rw-r--r-- | hw/i386/pc.c | 5 | ||||
-rw-r--r-- | hw/lm32/Kconfig | 1 | ||||
-rw-r--r-- | hw/scsi/scsi-disk.c | 15 | ||||
-rw-r--r-- | hw/usb/Kconfig | 11 | ||||
-rw-r--r-- | hw/usb/Makefile.objs | 5 |
7 files changed, 62 insertions, 40 deletions
diff --git a/hw/Makefile.objs b/hw/Makefile.objs index d770926ba9..ece6cc3755 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 4ddf2a9c55..b9c96ac361 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 c33ce47578..549c437050 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 3d09c2dd6f..ed2e3060b0 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 ed7295bfd7..8e95e3e38d 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 564305e283..555e09377b 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 81688f6e70..303ac084a0 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 |