* [Qemu-devel] [PULL v2 0/6] Misc patches for 2016-09-22
@ 2016-09-22 18:21 Paolo Bonzini
2016-09-22 18:21 ` [Qemu-devel] [PULL 3/6] iscsi: Fix divide-by-zero regression on raw SG devices Paolo Bonzini
2016-09-23 12:09 ` [Qemu-devel] [PULL v2 0/6] Misc patches for 2016-09-22 Peter Maydell
0 siblings, 2 replies; 3+ messages in thread
From: Paolo Bonzini @ 2016-09-22 18:21 UTC (permalink / raw)
To: qemu-devel
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
--
2.7.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Qemu-devel] [PULL 3/6] iscsi: Fix divide-by-zero regression on raw SG devices
2016-09-22 18:21 [Qemu-devel] [PULL v2 0/6] Misc patches for 2016-09-22 Paolo Bonzini
@ 2016-09-22 18:21 ` Paolo Bonzini
2016-09-23 12:09 ` [Qemu-devel] [PULL v2 0/6] Misc patches for 2016-09-22 Peter Maydell
1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2016-09-22 18:21 UTC (permalink / raw)
To: qemu-devel; +Cc: Eric Blake, qemu-stable
From: Eric Blake <eblake@redhat.com>
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).
Reported-by: Holger Schranz <holger@fam-schranz.de>
Signed-off-by: Eric Blake <eblake@redhat.com>
CC: qemu-stable@nongnu.org
Message-Id: <1473283640-15756-1-git-send-email-eblake@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
block/iscsi.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/block/iscsi.c b/block/iscsi.c
index 95ce9e1..b2b4e5d 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -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);
}
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PULL v2 0/6] Misc patches for 2016-09-22
2016-09-22 18:21 [Qemu-devel] [PULL v2 0/6] Misc patches for 2016-09-22 Paolo Bonzini
2016-09-22 18:21 ` [Qemu-devel] [PULL 3/6] iscsi: Fix divide-by-zero regression on raw SG devices Paolo Bonzini
@ 2016-09-23 12:09 ` Peter Maydell
1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2016-09-23 12:09 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: QEMU Developers
On 22 September 2016 at 19:21, Paolo Bonzini <pbonzini@redhat.com> wrote:
> 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
>
> ----------------------------------------------------------------
Applied, thanks.
-- PMM
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-09-23 12:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-22 18:21 [Qemu-devel] [PULL v2 0/6] Misc patches for 2016-09-22 Paolo Bonzini
2016-09-22 18:21 ` [Qemu-devel] [PULL 3/6] iscsi: Fix divide-by-zero regression on raw SG devices Paolo Bonzini
2016-09-23 12:09 ` [Qemu-devel] [PULL v2 0/6] Misc patches for 2016-09-22 Peter Maydell
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).