diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/hw/boards.h | 10 | ||||
-rw-r--r-- | include/hw/virtio/virtio-scsi.h | 16 | ||||
-rw-r--r-- | include/qemu/queue.h | 11 | ||||
-rw-r--r-- | include/standard-headers/linux/virtio_scsi.h | 12 | ||||
-rw-r--r-- | include/sysemu/kvm.h | 2 |
5 files changed, 31 insertions, 20 deletions
diff --git a/include/hw/boards.h b/include/hw/boards.h index 3ddc449bb6..f44d6f542a 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -66,6 +66,13 @@ MachineClass *find_default_machine(void); extern MachineState *current_machine; bool machine_usb(MachineState *machine); +bool machine_iommu(MachineState *machine); +bool machine_kernel_irqchip_allowed(MachineState *machine); +bool machine_kernel_irqchip_required(MachineState *machine); +int machine_kvm_shadow_mem(MachineState *machine); +int machine_phandle_start(MachineState *machine); +bool machine_dump_guest_core(MachineState *machine); +bool machine_mem_merge(MachineState *machine); /** * MachineClass: @@ -124,7 +131,8 @@ struct MachineState { /*< public >*/ char *accel; - bool kernel_irqchip; + bool kernel_irqchip_allowed; + bool kernel_irqchip_required; int kvm_shadow_mem; char *dtb; char *dumpdtb; diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scsi.h index de2c739d22..f93b57d3e9 100644 --- a/include/hw/virtio/virtio-scsi.h +++ b/include/hw/virtio/virtio-scsi.h @@ -14,6 +14,9 @@ #ifndef _QEMU_VIRTIO_SCSI_H #define _QEMU_VIRTIO_SCSI_H +/* Override CDB/sense data size: they are dynamic (guest controlled) in QEMU */ +#define VIRTIO_SCSI_CDB_SIZE 0 +#define VIRTIO_SCSI_SENSE_SIZE 0 #include "standard-headers/linux/virtio_scsi.h" #include "hw/virtio/virtio.h" #include "hw/pci/pci.h" @@ -30,8 +33,6 @@ OBJECT_CHECK(VirtIOSCSI, (obj), TYPE_VIRTIO_SCSI) #define VIRTIO_SCSI_VQ_SIZE 128 -#define VIRTIO_SCSI_CDB_SIZE 32 -#define VIRTIO_SCSI_SENSE_SIZE 96 #define VIRTIO_SCSI_MAX_CHANNEL 0 #define VIRTIO_SCSI_MAX_TARGET 255 #define VIRTIO_SCSI_MAX_LUN 16383 @@ -108,8 +109,7 @@ typedef struct VirtIOSCSIReq { /* Note: * - fields before elem are initialized by virtio_scsi_init_req; * - elem is uninitialized at the time of allocation. - * - fields after elem (except the ending cdb[]) are zeroed by - * virtio_scsi_init_req. + * - fields after elem are zeroed by virtio_scsi_init_req. * */ VirtQueueElement elem; @@ -134,18 +134,12 @@ typedef struct VirtIOSCSIReq { VirtIOSCSIEvent event; } resp; union { - struct { - VirtIOSCSICmdReq cmd; - uint8_t cdb[]; - } QEMU_PACKED; + VirtIOSCSICmdReq cmd; VirtIOSCSICtrlTMFReq tmf; VirtIOSCSICtrlANReq an; } req; } VirtIOSCSIReq; -QEMU_BUILD_BUG_ON(offsetof(VirtIOSCSIReq, req.cdb) != - offsetof(VirtIOSCSIReq, req.cmd) + sizeof(VirtIOSCSICmdReq)); - #define DEFINE_VIRTIO_SCSI_PROPERTIES(_state, _conf_field) \ DEFINE_PROP_UINT32("num_queues", _state, _conf_field.num_queues, 1), \ DEFINE_PROP_UINT32("max_sectors", _state, _conf_field.max_sectors, 0xFFFF),\ diff --git a/include/qemu/queue.h b/include/qemu/queue.h index 80941506ce..f781aa20a8 100644 --- a/include/qemu/queue.h +++ b/include/qemu/queue.h @@ -197,11 +197,12 @@ struct { \ (head)->slh_first = (elm); \ } while (/*CONSTCOND*/0) -#define QSLIST_INSERT_HEAD_ATOMIC(head, elm, field) do { \ - do { \ - (elm)->field.sle_next = (head)->slh_first; \ - } while (atomic_cmpxchg(&(head)->slh_first, (elm)->field.sle_next, \ - (elm)) != (elm)->field.sle_next); \ +#define QSLIST_INSERT_HEAD_ATOMIC(head, elm, field) do { \ + typeof(elm) save_sle_next; \ + do { \ + save_sle_next = (elm)->field.sle_next = (head)->slh_first; \ + } while (atomic_cmpxchg(&(head)->slh_first, save_sle_next, (elm)) != \ + save_sle_next); \ } while (/*CONSTCOND*/0) #define QSLIST_MOVE_ATOMIC(dest, src) do { \ diff --git a/include/standard-headers/linux/virtio_scsi.h b/include/standard-headers/linux/virtio_scsi.h index 78ba9d3635..ab66166b6a 100644 --- a/include/standard-headers/linux/virtio_scsi.h +++ b/include/standard-headers/linux/virtio_scsi.h @@ -29,8 +29,16 @@ #include "standard-headers/linux/virtio_types.h" -#define VIRTIO_SCSI_CDB_SIZE 32 -#define VIRTIO_SCSI_SENSE_SIZE 96 +/* Default values of the CDB and sense data size configuration fields */ +#define VIRTIO_SCSI_CDB_DEFAULT_SIZE 32 +#define VIRTIO_SCSI_SENSE_DEFAULT_SIZE 96 + +#ifndef VIRTIO_SCSI_CDB_SIZE +#define VIRTIO_SCSI_CDB_SIZE VIRTIO_SCSI_CDB_DEFAULT_SIZE +#endif +#ifndef VIRTIO_SCSI_SENSE_SIZE +#define VIRTIO_SCSI_SENSE_SIZE VIRTIO_SCSI_SENSE_DEFAULT_SIZE +#endif /* SCSI command request, followed by data-out */ struct virtio_scsi_cmd_req { diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 30cb84d2b8..3792463080 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -259,7 +259,7 @@ int kvm_arch_get_registers(CPUState *cpu); int kvm_arch_put_registers(CPUState *cpu, int level); -int kvm_arch_init(KVMState *s); +int kvm_arch_init(MachineState *ms, KVMState *s); int kvm_arch_init_vcpu(CPUState *cpu); |