Misc patches for 2016-09-22
The following changes since commit a008535b9fa396226ff9cf78b8ac5f3584bda58e:
build-sys: fix make install regression (2016-09-20 11:32:43 +0100)
are available in the git repository at:
git://github.com/bonzini/qemu.git tags/for-upstream
for you to fetch changes up to 68c6efe07a4729b54947658df4fceed84f3d0fef:
kvm: fix events.flags (KVM_VCPUEVENT_VALID_SMM) overwritten by 0 (2016-09-22 20:20:53 +0200)
----------------------------------------------------------------
* More KVM LAPIC fixes
* fix divide-by-zero regression on libiscsi SG devices
* fix qemu-char segfault
* add scripts/show-fixed-bugs.sh
----------------------------------------------------------------
Dr. David Alan Gilbert (1):
kvm: apic: set APIC base as part of kvm_apic_put
Eric Blake (1):
iscsi: Fix divide-by-zero regression on raw SG devices
Herongguang (Stephen) (1):
kvm: fix events.flags (KVM_VCPUEVENT_VALID_SMM) overwritten by 0
Lin Ma (1):
msmouse: Fix segfault caused by free the chr before chardev cleanup.
Paolo Bonzini (1):
target-i386: introduce kvm_put_one_msr
Thomas Huth (1):
scripts: Add a script to check for bug URLs in the git log
backends/msmouse.c | 1 - block/iscsi.c | 13 ++++--- hw/i386/kvm/apic.c | 2 + scripts/show-fixed-bugs.sh | 91 ++++++++++++++++++++++++++++++++++++++++++++++ target-i386/kvm.c | 30 ++++++++++----- target-i386/kvm_i386.h | 2 + 6 files changed, 123 insertions(+), 16 deletions(-) create mode 100755 scripts/show-fixed-bugs.sh
Signature · 1 line
2.7.4
[Qemu-devel] [PULL 3/6] iscsi: Fix divide-by-zero regression on raw SG devices
From: Eric Blake <[email protected]>
When qemu uses iscsi devices in sg mode, iscsilun->block_size is left at 0. Prior to commits cf081fca and similar, when block limits were tracked in sectors, this did not matter:
various block limits were just left at 0. But when we started scaling by block size, this caused SIGFPE.
Then, in a later patch, commit a5b8dd2c added an assertion to bdrv_open_common() that request_alignment is always non-zero; which was not true for SG mode. Rather than relax that assertion, we can just provide a sane value (we don't know of any SG device with a block size smaller than qemu's default sizing of 512 bytes).
One possible solution for SG mode is to just blindly skip ALL of iscsi_refresh_limits(), since we already short circuit so many other things in sg mode. But this patch takes a slightly more conservative approach, and merely guarantees that scaling will succeed, while still using multiples of the original size where possible. Resulting limits may still be zero in SG mode (that is, we mostly only fix block_size used as a denominator or which affect assertions, not all uses).
Message-Id: <[email protected]>
--- block/iscsi.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
block/iscsi.c +8 -5
@@ -1813,19 +1813,22 @@ static void iscsi_refresh_limits(BlockDriverState *bs, Error **errp)IscsiLun *iscsilun = bs->opaque;uint64_t max_xfer_len = iscsilun->use_16_for_rw ?0xffffffff :0xffff ; +unsigned int block_size =MAX (BDRV_SECTOR_SIZE , iscsilun->block_size); - bs->bl.request_alignment = iscsilun->block_size; +assert (iscsilun->block_size >=BDRV_SECTOR_SIZE || bs->sg); + + bs->bl.request_alignment = block_size;if (iscsilun->bl.max_xfer_len) { max_xfer_len =MIN (max_xfer_len, iscsilun->bl.max_xfer_len); } -if (max_xfer_len * iscsilun->block_size <INT_MAX ) { +if (max_xfer_len * block_size <INT_MAX ) { bs->bl.max_transfer = max_xfer_len * iscsilun->block_size; }if (iscsilun->lbp.lbpu) { -if (iscsilun->bl.max_unmap <0xffffffff / iscsilun->block_size) { +if (iscsilun->bl.max_unmap <0xffffffff / block_size) { bs->bl.max_pdiscard = iscsilun->bl.max_unmap * iscsilun->block_size; }
@@ -1835,7 +1838,7 @@ static void iscsi_refresh_limits(BlockDriverState *bs, Error **errp) bs->bl.pdiscard_alignment = iscsilun->block_size; } -if (iscsilun->bl.max_ws_len <0xffffffff / iscsilun->block_size) { +if (iscsilun->bl.max_ws_len <0xffffffff / block_size) { bs->bl.max_pwrite_zeroes = iscsilun->bl.max_ws_len * iscsilun->block_size; }
@@ -1846,7 +1849,7 @@ static void iscsi_refresh_limits(BlockDriverState *bs, Error **errp) bs->bl.pwrite_zeroes_alignment = iscsilun->block_size; }if (iscsilun->bl.opt_xfer_len && - iscsilun->bl.opt_xfer_len <INT_MAX / iscsilun->block_size) { + iscsilun->bl.opt_xfer_len <INT_MAX / block_size) { bs->bl.opt_transfer =pow2floor (iscsilun->bl.opt_xfer_len * iscsilun->block_size); }
Signature · 1 line
2.7.4
Peter Maydell
AppliedQuoted 12 lines · Paolo Bonzini
The following changes since commit
a008535b9fa396226ff9cf78b8ac5f3584bda58e:build-sys: fix make install regression (2016-09-20 11:32:43 +0100)
are available in the git repository at:
git://github.com/bonzini/qemu.gittags/for-upstreamfor you to fetch changes up to
68c6efe07a4729b54947658df4fceed84f3d0fef:kvm: fix events.flags (
KVM_VCPUEVENT_VALID_SMM) overwritten by 0 (2016-09-22 20:20:53 +0200)
Quoted 7 lines
----------------------------------------------------------------
* More KVM LAPIC fixes
* fix divide-by-zero regression on libiscsi SG devices
* fix qemu-char segfault
* addscripts/show-fixed-bugs.sh----------------------------------------------------------------
Applied, thanks.
-- PMM