* [Qemu-devel] [PULL v3 00/31] Misc changes for 2016-05-27 @ 2016-05-27 16:11 Paolo Bonzini 2016-05-27 16:11 ` [Qemu-devel] [PULL 23/31] scsi-disk: introduce dma_readv and dma_writev Paolo Bonzini 2016-05-27 16:38 ` [Qemu-devel] [PULL v3 00/31] Misc changes for 2016-05-27 Peter Maydell 0 siblings, 2 replies; 9+ messages in thread From: Paolo Bonzini @ 2016-05-27 16:11 UTC (permalink / raw) To: qemu-devel The following changes since commit 2c56d06bafd8933d2a9c6e0aeb5d45f7c1fb5616: Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (2016-05-26 14:29:30 +0100) are available in the git repository at: git://github.com/bonzini/qemu.git tags/for-upstream for you to fetch changes up to 05d158af4bb817b05074a3846dce74466aea8d39: exec: hide mr->ram_addr from qemu_get_ram_ptr users (2016-05-27 18:09:13 +0200) ---------------------------------------------------------------- * docs/atomics fixes and atomic_rcu_* optimization (Emilio) * NBD bugfix (Eric) * Memory fixes and cleanups (Paolo, Paul) * scsi-block support for SCSI status, including persistent reservations (Paolo) * linuxboot support for fw_cfg DMA (Marc, Richard Jones) * kvm_stat moves to the Linux repository * SCSI bug fixes (Peter, Prasad) * Killing qemu_char_get_next_serial, non-ARM parts (Xiaoqiang) ---------------------------------------------------------------- Emilio G. Cota (3): docs/atomics: update atomic_read/set comparison with Linux atomics: emit an smp_read_barrier_depends() barrier only for Alpha and Thread Sanitizer atomics: do not emit consume barrier for atomic_rcu_read Eric Blake (1): nbd: Don't trim unrequested bytes Fam Zheng (1): scsi-generic: Merge block max xfer len in INQUIRY response Marc Marí (1): Add optionrom compatible with fw_cfg DMA version Paolo Bonzini (13): Revert "memory: Drop FlatRange.romd_mode" kvm_stat: Remove bt: rewrite csrhci_write to avoid out-of-bounds writes docs/atomics: update comparison with Linux scsi-disk: introduce a common base class scsi-disk: introduce dma_readv and dma_writev scsi-disk: add need_fua_emulation to SCSIDiskClass scsi-disk: introduce scsi_disk_req_check_error scsi-block: always use SG_IO memory: remove qemu_get_ram_fd, qemu_set_ram_fd, qemu_ram_block_host_ptr exec: remove ram_addr argument from qemu_ram_block_from_host memory: split memory_region_from_host from qemu_ram_addr_from_host exec: hide mr->ram_addr from qemu_get_ram_ptr users Paul Durrant (1): xen-hvm: ignore background I/O sections Peter Lieven (1): block/iscsi: avoid potential overflow of acb->task->cdb Prasad J Pandit (5): scsi: pvscsi: check command descriptor ring buffer size (CVE-2016-4952) scsi: mptsas: infinite loop while fetching requests scsi: megasas: use appropriate property buffer size scsi: megasas: initialise local configuration data buffer scsi: megasas: check 'read_queue_head' index value xiaoqiang zhao (5): hw/char: QOM'ify escc.c hw/char: QOM'ify etraxfs_ser.c hw/char: QOM'ify lm32_juart.c hw/char: QOM'ify lm32_uart.c hw/char: QOM'ify milkymist-uart.c .gitignore | 4 + Makefile | 11 +- block/iscsi.c | 7 + configure | 20 + cputlb.c | 3 +- docs/atomics.txt | 38 +- exec.c | 110 ++--- hw/bt/hci-csr.c | 67 +++- hw/char/escc.c | 30 +- hw/char/etraxfs_ser.c | 27 +- hw/char/lm32_juart.c | 17 +- hw/char/lm32_uart.c | 28 +- hw/char/milkymist-uart.c | 10 +- hw/cris/axis_dev88.c | 4 +- hw/i386/pc.c | 10 +- hw/lm32/lm32.h | 19 +- hw/lm32/lm32_boards.c | 9 +- hw/lm32/milkymist-hw.h | 4 +- hw/lm32/milkymist.c | 4 +- hw/misc/ivshmem.c | 5 +- hw/nvram/fw_cfg.c | 2 +- hw/scsi/megasas.c | 6 +- hw/scsi/mptsas.c | 9 +- hw/scsi/scsi-disk.c | 415 +++++++++++++------ hw/scsi/scsi-generic.c | 12 + hw/scsi/vmw_pvscsi.c | 24 +- hw/virtio/vhost-user.c | 25 +- include/exec/cpu-common.h | 4 +- include/exec/memory.h | 36 +- include/exec/ram_addr.h | 3 - include/hw/cris/etraxfs.h | 16 + include/hw/nvram/fw_cfg.h | 1 + include/qemu/atomic.h | 25 +- memory.c | 43 +- migration/postcopy-ram.c | 3 +- nbd/server.c | 20 +- pc-bios/optionrom/Makefile | 20 +- pc-bios/optionrom/code16gcc.h | 3 + pc-bios/optionrom/linuxboot_dma.c | 292 ++++++++++++++ scripts/dump-guest-memory.py | 19 +- scripts/kvm/kvm_stat | 825 -------------------------------------- scripts/kvm/kvm_stat.texi | 55 --- target-i386/kvm.c | 6 +- xen-hvm.c | 14 +- 44 files changed, 1057 insertions(+), 1248 deletions(-) create mode 100644 pc-bios/optionrom/code16gcc.h create mode 100644 pc-bios/optionrom/linuxboot_dma.c delete mode 100755 scripts/kvm/kvm_stat delete mode 100644 scripts/kvm/kvm_stat.texi -- 2.5.5 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [Qemu-devel] [PULL 23/31] scsi-disk: introduce dma_readv and dma_writev 2016-05-27 16:11 [Qemu-devel] [PULL v3 00/31] Misc changes for 2016-05-27 Paolo Bonzini @ 2016-05-27 16:11 ` Paolo Bonzini 2016-05-27 16:38 ` [Qemu-devel] [PULL v3 00/31] Misc changes for 2016-05-27 Peter Maydell 1 sibling, 0 replies; 9+ messages in thread From: Paolo Bonzini @ 2016-05-27 16:11 UTC (permalink / raw) To: qemu-devel These are replacements for blk_aio_readv and blk_aio_writev that allow customization of the data path. They reuse the DMA helpers' DMAIOFunc callback type, so that the same function can be used in either the QEMUSGList or the bounce-buffered case. This customization will be needed in the next patch to do zero-copy SG_IO on scsi-block. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> --- hw/scsi/scsi-disk.c | 67 +++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 52 insertions(+), 15 deletions(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 2d9dcde..6506257 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -55,7 +55,18 @@ do { printf("scsi-disk: " fmt , ## __VA_ARGS__); } while (0) #define TYPE_SCSI_DISK_BASE "scsi-disk-base" -typedef struct SCSIDiskState SCSIDiskState; +#define SCSI_DISK_BASE(obj) \ + OBJECT_CHECK(SCSIDiskState, (obj), TYPE_SCSI_DISK_BASE) +#define SCSI_DISK_BASE_CLASS(klass) \ + OBJECT_CLASS_CHECK(SCSIDiskClass, (klass), TYPE_SCSI_DISK_BASE) +#define SCSI_DISK_BASE_GET_CLASS(obj) \ + OBJECT_GET_CLASS(SCSIDiskClass, (obj), TYPE_SCSI_DISK_BASE) + +typedef struct SCSIDiskClass { + SCSIDeviceClass parent_class; + DMAIOFunc *dma_readv; + DMAIOFunc *dma_writev; +} SCSIDiskClass; typedef struct SCSIDiskReq { SCSIRequest req; @@ -73,7 +84,7 @@ typedef struct SCSIDiskReq { #define SCSI_DISK_F_DPOFUA 1 #define SCSI_DISK_F_NO_REMOVABLE_DEVOPS 2 -struct SCSIDiskState +typedef struct SCSIDiskState { SCSIDevice qdev; uint32_t features; @@ -90,7 +101,7 @@ struct SCSIDiskState char *product; bool tray_open; bool tray_locked; -}; +} SCSIDiskState; static int scsi_handle_rw_error(SCSIDiskReq *r, int error, bool acct_failed); @@ -317,6 +328,7 @@ done: static void scsi_do_read(SCSIDiskReq *r, int ret) { SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev); + SCSIDiskClass *sdc = (SCSIDiskClass *) object_get_class(OBJECT(s)); assert (r->req.aiocb == NULL); @@ -337,16 +349,16 @@ static void scsi_do_read(SCSIDiskReq *r, int ret) if (r->req.sg) { dma_acct_start(s->qdev.conf.blk, &r->acct, r->req.sg, BLOCK_ACCT_READ); r->req.resid -= r->req.sg->size; - r->req.aiocb = dma_blk_read(s->qdev.conf.blk, r->req.sg, - r->sector << BDRV_SECTOR_BITS, - scsi_dma_complete, r); + r->req.aiocb = dma_blk_io(blk_get_aio_context(s->qdev.conf.blk), + r->req.sg, r->sector << BDRV_SECTOR_BITS, + sdc->dma_readv, r, scsi_dma_complete, r, + DMA_DIRECTION_FROM_DEVICE); } else { scsi_init_iovec(r, SCSI_DMA_BUF_SIZE); block_acct_start(blk_get_stats(s->qdev.conf.blk), &r->acct, r->qiov.size, BLOCK_ACCT_READ); - r->req.aiocb = blk_aio_preadv(s->qdev.conf.blk, - r->sector << BDRV_SECTOR_BITS, &r->qiov, - 0, scsi_read_complete, r); + r->req.aiocb = sdc->dma_readv(r->sector, &r->qiov, + scsi_read_complete, r, r); } done: @@ -506,6 +518,7 @@ static void scsi_write_data(SCSIRequest *req) { SCSIDiskReq *r = DO_UPCAST(SCSIDiskReq, req, req); SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev); + SCSIDiskClass *sdc = (SCSIDiskClass *) object_get_class(OBJECT(s)); /* No data transfer may already be in progress */ assert(r->req.aiocb == NULL); @@ -542,15 +555,15 @@ static void scsi_write_data(SCSIRequest *req) if (r->req.sg) { dma_acct_start(s->qdev.conf.blk, &r->acct, r->req.sg, BLOCK_ACCT_WRITE); r->req.resid -= r->req.sg->size; - r->req.aiocb = dma_blk_write(s->qdev.conf.blk, r->req.sg, - r->sector << BDRV_SECTOR_BITS, - scsi_dma_complete, r); + r->req.aiocb = dma_blk_io(blk_get_aio_context(s->qdev.conf.blk), + r->req.sg, r->sector << BDRV_SECTOR_BITS, + sdc->dma_writev, r, scsi_dma_complete, r, + DMA_DIRECTION_TO_DEVICE); } else { block_acct_start(blk_get_stats(s->qdev.conf.blk), &r->acct, r->qiov.size, BLOCK_ACCT_WRITE); - r->req.aiocb = blk_aio_pwritev(s->qdev.conf.blk, - r->sector << BDRV_SECTOR_BITS, &r->qiov, - 0, scsi_write_complete, r); + r->req.aiocb = sdc->dma_writev(r->sector << BDRV_SECTOR_BITS, &r->qiov, + scsi_write_complete, r, r); } } @@ -2658,12 +2671,35 @@ static int scsi_block_parse_cdb(SCSIDevice *d, SCSICommand *cmd, #endif +static +BlockAIOCB *scsi_dma_readv(int64_t offset, QEMUIOVector *iov, + BlockCompletionFunc *cb, void *cb_opaque, + void *opaque) +{ + SCSIDiskReq *r = opaque; + SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev); + return blk_aio_preadv(s->qdev.conf.blk, offset, iov, 0, cb, cb_opaque); +} + +static +BlockAIOCB *scsi_dma_writev(int64_t offset, QEMUIOVector *iov, + BlockCompletionFunc *cb, void *cb_opaque, + void *opaque) +{ + SCSIDiskReq *r = opaque; + SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev); + return blk_aio_pwritev(s->qdev.conf.blk, offset, iov, 0, cb, cb_opaque); +} + static void scsi_disk_base_class_initfn(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); + SCSIDiskClass *sdc = SCSI_DISK_BASE_CLASS(klass); dc->fw_name = "disk"; dc->reset = scsi_disk_reset; + sdc->dma_readv = scsi_dma_readv; + sdc->dma_writev = scsi_dma_writev; } static const TypeInfo scsi_disk_base_info = { @@ -2671,6 +2707,7 @@ static const TypeInfo scsi_disk_base_info = { .parent = TYPE_SCSI_DEVICE, .class_init = scsi_disk_base_class_initfn, .instance_size = sizeof(SCSIDiskState), + .class_size = sizeof(SCSIDiskClass), }; #define DEFINE_SCSI_DISK_PROPERTIES() \ -- 2.5.5 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PULL v3 00/31] Misc changes for 2016-05-27 2016-05-27 16:11 [Qemu-devel] [PULL v3 00/31] Misc changes for 2016-05-27 Paolo Bonzini 2016-05-27 16:11 ` [Qemu-devel] [PULL 23/31] scsi-disk: introduce dma_readv and dma_writev Paolo Bonzini @ 2016-05-27 16:38 ` Peter Maydell 2016-05-28 16:49 ` Paolo Bonzini 1 sibling, 1 reply; 9+ messages in thread From: Peter Maydell @ 2016-05-27 16:38 UTC (permalink / raw) To: Paolo Bonzini; +Cc: QEMU Developers On 27 May 2016 at 17:11, Paolo Bonzini <pbonzini@redhat.com> wrote: > The following changes since commit 2c56d06bafd8933d2a9c6e0aeb5d45f7c1fb5616: > > Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (2016-05-26 14:29:30 +0100) > > are available in the git repository at: > > git://github.com/bonzini/qemu.git tags/for-upstream > > for you to fetch changes up to 05d158af4bb817b05074a3846dce74466aea8d39: > > exec: hide mr->ram_addr from qemu_get_ram_ptr users (2016-05-27 18:09:13 +0200) > > ---------------------------------------------------------------- > * docs/atomics fixes and atomic_rcu_* optimization (Emilio) > * NBD bugfix (Eric) > * Memory fixes and cleanups (Paolo, Paul) > * scsi-block support for SCSI status, including persistent > reservations (Paolo) > * linuxboot support for fw_cfg DMA (Marc, Richard Jones) > * kvm_stat moves to the Linux repository > * SCSI bug fixes (Peter, Prasad) > * Killing qemu_char_get_next_serial, non-ARM parts (Xiaoqiang) > > ---------------------------------------------------------------- Doesn't build on clang :-( CC optionrom/linuxboot_dma.o clang: error: unknown argument: '-fno-toplevel-reorder' clang: error: unknown argument: '-fno-toplevel-reorder' thanks -- PMM ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PULL v3 00/31] Misc changes for 2016-05-27 2016-05-27 16:38 ` [Qemu-devel] [PULL v3 00/31] Misc changes for 2016-05-27 Peter Maydell @ 2016-05-28 16:49 ` Paolo Bonzini 2016-05-31 8:28 ` Peter Maydell 0 siblings, 1 reply; 9+ messages in thread From: Paolo Bonzini @ 2016-05-28 16:49 UTC (permalink / raw) To: Peter Maydell; +Cc: QEMU Developers ----- Original Message ----- > From: "Peter Maydell" <peter.maydell@linaro.org> > To: "Paolo Bonzini" <pbonzini@redhat.com> > Cc: "QEMU Developers" <qemu-devel@nongnu.org> > Sent: Friday, May 27, 2016 6:38:10 PM > Subject: Re: [Qemu-devel] [PULL v3 00/31] Misc changes for 2016-05-27 > > On 27 May 2016 at 17:11, Paolo Bonzini <pbonzini@redhat.com> wrote: > > The following changes since commit > > 2c56d06bafd8933d2a9c6e0aeb5d45f7c1fb5616: > > > > Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into > > staging (2016-05-26 14:29:30 +0100) > > > > are available in the git repository at: > > > > git://github.com/bonzini/qemu.git tags/for-upstream > > > > for you to fetch changes up to 05d158af4bb817b05074a3846dce74466aea8d39: > > > > exec: hide mr->ram_addr from qemu_get_ram_ptr users (2016-05-27 18:09:13 > > +0200) > > > > ---------------------------------------------------------------- > > * docs/atomics fixes and atomic_rcu_* optimization (Emilio) > > * NBD bugfix (Eric) > > * Memory fixes and cleanups (Paolo, Paul) > > * scsi-block support for SCSI status, including persistent > > reservations (Paolo) > > * linuxboot support for fw_cfg DMA (Marc, Richard Jones) > > * kvm_stat moves to the Linux repository > > * SCSI bug fixes (Peter, Prasad) > > * Killing qemu_char_get_next_serial, non-ARM parts (Xiaoqiang) > > > > ---------------------------------------------------------------- > > Doesn't build on clang :-( > > CC optionrom/linuxboot_dma.o > clang: error: unknown argument: '-fno-toplevel-reorder' > clang: error: unknown argument: '-fno-toplevel-reorder' Either there's a bug in the detection of -m16, or your clang version is too old. What does config.log say? (Unfortunately I have clang here but it's broken---it fails to link anything). Paolo ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PULL v3 00/31] Misc changes for 2016-05-27 2016-05-28 16:49 ` Paolo Bonzini @ 2016-05-31 8:28 ` Peter Maydell 2016-05-31 11:45 ` Paolo Bonzini 0 siblings, 1 reply; 9+ messages in thread From: Peter Maydell @ 2016-05-31 8:28 UTC (permalink / raw) To: Paolo Bonzini; +Cc: QEMU Developers On 28 May 2016 at 17:49, Paolo Bonzini <pbonzini@redhat.com> wrote: > > > ----- Original Message ----- >> From: "Peter Maydell" <peter.maydell@linaro.org> >> To: "Paolo Bonzini" <pbonzini@redhat.com> >> Cc: "QEMU Developers" <qemu-devel@nongnu.org> >> Sent: Friday, May 27, 2016 6:38:10 PM >> Subject: Re: [Qemu-devel] [PULL v3 00/31] Misc changes for 2016-05-27 >> >> On 27 May 2016 at 17:11, Paolo Bonzini <pbonzini@redhat.com> wrote: >> > The following changes since commit >> > 2c56d06bafd8933d2a9c6e0aeb5d45f7c1fb5616: >> > >> > Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into >> > staging (2016-05-26 14:29:30 +0100) >> > >> > are available in the git repository at: >> > >> > git://github.com/bonzini/qemu.git tags/for-upstream >> > >> > for you to fetch changes up to 05d158af4bb817b05074a3846dce74466aea8d39: >> > >> > exec: hide mr->ram_addr from qemu_get_ram_ptr users (2016-05-27 18:09:13 >> > +0200) >> > >> > ---------------------------------------------------------------- >> > * docs/atomics fixes and atomic_rcu_* optimization (Emilio) >> > * NBD bugfix (Eric) >> > * Memory fixes and cleanups (Paolo, Paul) >> > * scsi-block support for SCSI status, including persistent >> > reservations (Paolo) >> > * linuxboot support for fw_cfg DMA (Marc, Richard Jones) >> > * kvm_stat moves to the Linux repository >> > * SCSI bug fixes (Peter, Prasad) >> > * Killing qemu_char_get_next_serial, non-ARM parts (Xiaoqiang) >> > >> > ---------------------------------------------------------------- >> >> Doesn't build on clang :-( >> >> CC optionrom/linuxboot_dma.o >> clang: error: unknown argument: '-fno-toplevel-reorder' >> clang: error: unknown argument: '-fno-toplevel-reorder' > > Either there's a bug in the detection of -m16, or your clang version is > too old. What does config.log say? The only mention of m16 in the config.log is where it says: clang -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fsanitize=undefined -Werror -Wno-string-plus-int -Wno-initializer-overrides -Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-definition -Wtype-limits -fstack-protector-all -m16 -o config-temp/qemu-conf.exe config-temp/qemu-conf.c -m64 -g clang: error: unknown argument: '-m16' thanks -- PMM ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PULL v3 00/31] Misc changes for 2016-05-27 2016-05-31 8:28 ` Peter Maydell @ 2016-05-31 11:45 ` Paolo Bonzini 2016-05-31 11:52 ` Peter Maydell 0 siblings, 1 reply; 9+ messages in thread From: Paolo Bonzini @ 2016-05-31 11:45 UTC (permalink / raw) To: Peter Maydell; +Cc: QEMU Developers On 31/05/2016 10:28, Peter Maydell wrote: >> > Either there's a bug in the detection of -m16, or your clang version is >> > too old. What does config.log say? > The only mention of m16 in the config.log is where it says: > > clang -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE > -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings > -Wmissing-prototypes -fno-strict-aliasing -fno-common > -fsanitize=undefined -Werror -Wno-string-plus-int > -Wno-initializer-overrides -Wendif-labels -Wmissing-include-dirs > -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k > -Winit-self -Wignored-qualifiers -Wold-style-definition -Wtype-limits > -fstack-protector-all -m16 -o config-temp/qemu-conf.exe > config-temp/qemu-conf.c -m64 -g > clang: error: unknown argument: '-m16' Then I suppose your clang version is too old, what is it? Thanks, Paolo ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PULL v3 00/31] Misc changes for 2016-05-27 2016-05-31 11:45 ` Paolo Bonzini @ 2016-05-31 11:52 ` Peter Maydell 2016-05-31 12:07 ` Paolo Bonzini 0 siblings, 1 reply; 9+ messages in thread From: Peter Maydell @ 2016-05-31 11:52 UTC (permalink / raw) To: Paolo Bonzini; +Cc: QEMU Developers On 31 May 2016 at 12:45, Paolo Bonzini <pbonzini@redhat.com> wrote: > Then I suppose your clang version is too old, what is it? Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4) Target: x86_64-pc-linux-gnu Thread model: posix (which is the default clang for Ubuntu Trusty). thanks -- PMM ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PULL v3 00/31] Misc changes for 2016-05-27 2016-05-31 11:52 ` Peter Maydell @ 2016-05-31 12:07 ` Paolo Bonzini 0 siblings, 0 replies; 9+ messages in thread From: Paolo Bonzini @ 2016-05-31 12:07 UTC (permalink / raw) To: Peter Maydell; +Cc: QEMU Developers On 31/05/2016 13:52, Peter Maydell wrote: >> > Then I suppose your clang version is too old, what is it? > Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4) > Target: x86_64-pc-linux-gnu > Thread model: posix > > (which is the default clang for Ubuntu Trusty). Yeah, that is too old. We'll have to do one of this: - figure out whether the compiler has at least one of -m16 or -fno-toplevel-reorder, and if not disable building the ROMs - figure out a way to build the ROMs with cross compilers, in which case I think it's acceptable to make that cross compiler be GCC. Paolo ^ permalink raw reply [flat|nested] 9+ messages in thread
* [Qemu-devel] [PULL 00/31] Misc changes for 2016-05-27 @ 2016-05-27 10:06 Paolo Bonzini 2016-05-27 10:06 ` [Qemu-devel] [PULL 23/31] scsi-disk: introduce dma_readv and dma_writev Paolo Bonzini 0 siblings, 1 reply; 9+ messages in thread From: Paolo Bonzini @ 2016-05-27 10:06 UTC (permalink / raw) To: qemu-devel The following changes since commit b75536c9fa742f887304769d0608557bb8e3a27f: blockjob: Remove BlockJob.bs (2016-05-25 19:04:21 +0200) are available in the git repository at: git://github.com/bonzini/qemu.git tags/for-upstream for you to fetch changes up to 7052033834d4c2d7ade147cf5b045be6eaf07113: exec: hide mr->ram_addr from qemu_get_ram_ptr users (2016-05-27 11:55:23 +0200) ---------------------------------------------------------------- * docs/atomics fixes and atomic_rcu_* optimization (Emilio) * NBD bugfix (Eric) * Memory fixes and cleanups (Paolo, Paul) * scsi-block support for SCSI status, including persistent reservations (Paolo) * linuxboot support for fw_cfg DMA (Marc, Richard Jones) * kvm_stat moves to the Linux repository * SCSI bug fixes (Peter, Prasad) * Killing qemu_char_get_next_serial, non-ARM parts (Xiaoqiang) ---------------------------------------------------------------- Emilio G. Cota (3): docs/atomics: update atomic_read/set comparison with Linux atomics: emit an smp_read_barrier_depends() barrier only for Alpha and Thread Sanitizer atomics: do not emit consume barrier for atomic_rcu_read Eric Blake (1): nbd: Don't trim unrequested bytes Fam Zheng (1): scsi-generic: Merge block max xfer len in INQUIRY response Marc Marí (1): Add optionrom compatible with fw_cfg DMA version Paolo Bonzini (13): Revert "memory: Drop FlatRange.romd_mode" kvm_stat: Remove bt: rewrite csrhci_write to avoid out-of-bounds writes docs/atomics: update comparison with Linux scsi-disk: introduce a common base class scsi-disk: introduce dma_readv and dma_writev scsi-disk: add need_fua_emulation to SCSIDiskClass scsi-disk: introduce scsi_disk_req_check_error scsi-block: always use SG_IO memory: remove qemu_get_ram_fd, qemu_set_ram_fd, qemu_ram_block_host_ptr exec: remove ram_addr argument from qemu_ram_block_from_host memory: split memory_region_from_host from qemu_ram_addr_from_host exec: hide mr->ram_addr from qemu_get_ram_ptr users Paul Durrant (1): xen-hvm: ignore background I/O sections Peter Lieven (1): block/iscsi: avoid potential overflow of acb->task->cdb Prasad J Pandit (5): scsi: pvscsi: check command descriptor ring buffer size (CVE-2016-4952) scsi: mptsas: infinite loop while fetching requests scsi: megasas: use appropriate property buffer size scsi: megasas: initialise local configuration data buffer scsi: megasas: check 'read_queue_head' index value xiaoqiang zhao (5): hw/char: QOM'ify escc.c hw/char: QOM'ify etraxfs_ser.c hw/char: QOM'ify lm32_juart.c hw/char: QOM'ify lm32_uart.c hw/char: QOM'ify milkymist-uart.c .gitignore | 4 + Makefile | 11 +- block/iscsi.c | 7 + configure | 20 + cputlb.c | 3 +- docs/atomics.txt | 38 +- exec.c | 110 ++--- hw/bt/hci-csr.c | 67 +++- hw/char/escc.c | 30 +- hw/char/etraxfs_ser.c | 27 +- hw/char/lm32_juart.c | 17 +- hw/char/lm32_uart.c | 28 +- hw/char/milkymist-uart.c | 10 +- hw/cris/axis_dev88.c | 4 +- hw/i386/pc.c | 10 +- hw/lm32/lm32.h | 19 +- hw/lm32/lm32_boards.c | 9 +- hw/lm32/milkymist-hw.h | 4 +- hw/lm32/milkymist.c | 4 +- hw/misc/ivshmem.c | 5 +- hw/nvram/fw_cfg.c | 2 +- hw/scsi/megasas.c | 6 +- hw/scsi/mptsas.c | 9 +- hw/scsi/scsi-disk.c | 412 +++++++++++++------ hw/scsi/scsi-generic.c | 12 + hw/scsi/vmw_pvscsi.c | 24 +- hw/virtio/vhost-user.c | 25 +- include/exec/cpu-common.h | 4 +- include/exec/memory.h | 36 +- include/exec/ram_addr.h | 3 - include/hw/cris/etraxfs.h | 16 + include/hw/nvram/fw_cfg.h | 1 + include/qemu/atomic.h | 25 +- memory.c | 43 +- migration/postcopy-ram.c | 3 +- nbd/server.c | 20 +- pc-bios/optionrom/Makefile | 19 +- pc-bios/optionrom/code16gcc.h | 3 + pc-bios/optionrom/linuxboot_dma.c | 291 ++++++++++++++ scripts/dump-guest-memory.py | 19 +- scripts/kvm/kvm_stat | 825 -------------------------------------- scripts/kvm/kvm_stat.texi | 55 --- target-i386/kvm.c | 6 +- xen-hvm.c | 14 +- 44 files changed, 1055 insertions(+), 1245 deletions(-) create mode 100644 pc-bios/optionrom/code16gcc.h create mode 100644 pc-bios/optionrom/linuxboot_dma.c delete mode 100755 scripts/kvm/kvm_stat delete mode 100644 scripts/kvm/kvm_stat.texi -- 2.5.5 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [Qemu-devel] [PULL 23/31] scsi-disk: introduce dma_readv and dma_writev 2016-05-27 10:06 [Qemu-devel] [PULL " Paolo Bonzini @ 2016-05-27 10:06 ` Paolo Bonzini 0 siblings, 0 replies; 9+ messages in thread From: Paolo Bonzini @ 2016-05-27 10:06 UTC (permalink / raw) To: qemu-devel These are replacements for blk_aio_readv and blk_aio_writev that allow customization of the data path. They reuse the DMA helpers' DMAIOFunc callback type, so that the same function can be used in either the QEMUSGList or the bounce-buffered case. This customization will be needed in the next patch to do zero-copy SG_IO on scsi-block. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> --- hw/scsi/scsi-disk.c | 64 +++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 52 insertions(+), 12 deletions(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 2d9dcde..040d0c3 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -55,7 +55,21 @@ do { printf("scsi-disk: " fmt , ## __VA_ARGS__); } while (0) #define TYPE_SCSI_DISK_BASE "scsi-disk-base" +#define SCSI_DISK_BASE(obj) \ + OBJECT_CHECK(SCSIDiskState, (obj), TYPE_SCSI_DISK_BASE) +#define SCSI_DISK_BASE_CLASS(klass) \ + OBJECT_CLASS_CHECK(SCSIDiskClass, (klass), TYPE_SCSI_DISK_BASE) +#define SCSI_DISK_BASE_GET_CLASS(obj) \ + OBJECT_GET_CLASS(SCSIDiskClass, (obj), TYPE_SCSI_DISK_BASE) + typedef struct SCSIDiskState SCSIDiskState; +typedef struct SCSIDiskClass SCSIDiskClass; + +typedef struct SCSIDiskClass { + SCSIDeviceClass parent_class; + DMAIOFunc *dma_readv; + DMAIOFunc *dma_writev; +} SCSIDiskClass; typedef struct SCSIDiskReq { SCSIRequest req; @@ -317,6 +331,7 @@ done: static void scsi_do_read(SCSIDiskReq *r, int ret) { SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev); + SCSIDiskClass *sdc = (SCSIDiskClass *) object_get_class(OBJECT(s)); assert (r->req.aiocb == NULL); @@ -337,16 +352,16 @@ static void scsi_do_read(SCSIDiskReq *r, int ret) if (r->req.sg) { dma_acct_start(s->qdev.conf.blk, &r->acct, r->req.sg, BLOCK_ACCT_READ); r->req.resid -= r->req.sg->size; - r->req.aiocb = dma_blk_read(s->qdev.conf.blk, r->req.sg, - r->sector << BDRV_SECTOR_BITS, - scsi_dma_complete, r); + r->req.aiocb = dma_blk_io(blk_get_aio_context(s->qdev.conf.blk), + r->req.sg, r->sector << BDRV_SECTOR_BITS, + sdc->dma_readv, r, scsi_dma_complete, r, + DMA_DIRECTION_FROM_DEVICE); } else { scsi_init_iovec(r, SCSI_DMA_BUF_SIZE); block_acct_start(blk_get_stats(s->qdev.conf.blk), &r->acct, r->qiov.size, BLOCK_ACCT_READ); - r->req.aiocb = blk_aio_preadv(s->qdev.conf.blk, - r->sector << BDRV_SECTOR_BITS, &r->qiov, - 0, scsi_read_complete, r); + r->req.aiocb = sdc->dma_readv(r->sector, &r->qiov, + scsi_read_complete, r, r); } done: @@ -506,6 +521,7 @@ static void scsi_write_data(SCSIRequest *req) { SCSIDiskReq *r = DO_UPCAST(SCSIDiskReq, req, req); SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev); + SCSIDiskClass *sdc = (SCSIDiskClass *) object_get_class(OBJECT(s)); /* No data transfer may already be in progress */ assert(r->req.aiocb == NULL); @@ -542,15 +558,15 @@ static void scsi_write_data(SCSIRequest *req) if (r->req.sg) { dma_acct_start(s->qdev.conf.blk, &r->acct, r->req.sg, BLOCK_ACCT_WRITE); r->req.resid -= r->req.sg->size; - r->req.aiocb = dma_blk_write(s->qdev.conf.blk, r->req.sg, - r->sector << BDRV_SECTOR_BITS, - scsi_dma_complete, r); + r->req.aiocb = dma_blk_io(blk_get_aio_context(s->qdev.conf.blk), + r->req.sg, r->sector << BDRV_SECTOR_BITS, + sdc->dma_writev, r, scsi_dma_complete, r, + DMA_DIRECTION_TO_DEVICE); } else { block_acct_start(blk_get_stats(s->qdev.conf.blk), &r->acct, r->qiov.size, BLOCK_ACCT_WRITE); - r->req.aiocb = blk_aio_pwritev(s->qdev.conf.blk, - r->sector << BDRV_SECTOR_BITS, &r->qiov, - 0, scsi_write_complete, r); + r->req.aiocb = sdc->dma_writev(r->sector << BDRV_SECTOR_BITS, &r->qiov, + scsi_write_complete, r, r); } } @@ -2658,12 +2674,35 @@ static int scsi_block_parse_cdb(SCSIDevice *d, SCSICommand *cmd, #endif +static +BlockAIOCB *scsi_dma_readv(int64_t offset, QEMUIOVector *iov, + BlockCompletionFunc *cb, void *cb_opaque, + void *opaque) +{ + SCSIDiskReq *r = opaque; + SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev); + return blk_aio_preadv(s->qdev.conf.blk, offset, iov, 0, cb, cb_opaque); +} + +static +BlockAIOCB *scsi_dma_writev(int64_t offset, QEMUIOVector *iov, + BlockCompletionFunc *cb, void *cb_opaque, + void *opaque) +{ + SCSIDiskReq *r = opaque; + SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev); + return blk_aio_pwritev(s->qdev.conf.blk, offset, iov, 0, cb, cb_opaque); +} + static void scsi_disk_base_class_initfn(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); + SCSIDiskClass *sdc = SCSI_DISK_BASE_CLASS(klass); dc->fw_name = "disk"; dc->reset = scsi_disk_reset; + sdc->dma_readv = scsi_dma_readv; + sdc->dma_writev = scsi_dma_writev; } static const TypeInfo scsi_disk_base_info = { @@ -2671,6 +2710,7 @@ static const TypeInfo scsi_disk_base_info = { .parent = TYPE_SCSI_DEVICE, .class_init = scsi_disk_base_class_initfn, .instance_size = sizeof(SCSIDiskState), + .class_size = sizeof(SCSIDiskClass), }; #define DEFINE_SCSI_DISK_PROPERTIES() \ -- 2.5.5 ^ permalink raw reply related [flat|nested] 9+ messages in thread
end of thread, other threads:[~2016-05-31 12:07 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-05-27 16:11 [Qemu-devel] [PULL v3 00/31] Misc changes for 2016-05-27 Paolo Bonzini 2016-05-27 16:11 ` [Qemu-devel] [PULL 23/31] scsi-disk: introduce dma_readv and dma_writev Paolo Bonzini 2016-05-27 16:38 ` [Qemu-devel] [PULL v3 00/31] Misc changes for 2016-05-27 Peter Maydell 2016-05-28 16:49 ` Paolo Bonzini 2016-05-31 8:28 ` Peter Maydell 2016-05-31 11:45 ` Paolo Bonzini 2016-05-31 11:52 ` Peter Maydell 2016-05-31 12:07 ` Paolo Bonzini -- strict thread matches above, loose matches on Subject: below -- 2016-05-27 10:06 [Qemu-devel] [PULL " Paolo Bonzini 2016-05-27 10:06 ` [Qemu-devel] [PULL 23/31] scsi-disk: introduce dma_readv and dma_writev Paolo Bonzini
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).