From: Michael Tokarev <mjt@tls.msk.ru>
To: qemu-devel <qemu-devel@nongnu.org>
Cc: Kevin Wolf <kwolf@redhat.com>, Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] Bug#757927: [qemu-kvm] TRIM (discard=unmap) broken in 2.1
Date: Wed, 13 Aug 2014 10:41:31 +0400 [thread overview]
Message-ID: <53EB089B.6080906@msgid.tls.msk.ru> (raw)
In-Reply-To: <53EB003F.9000303@msgid.tls.msk.ru>
[dropping debian bugreport]
13.08.2014 10:05, Michael Tokarev wrote:
> [This is http://bugs.debian.org/757927 -- trim stopped working in qemu 2.1]
>
> 12.08.2014 18:46, Michael Tokarev wrote:
>> 12.08.2014 17:35, Roman Mamedov wrote:
>>> Package: qemu-kvm
>>> Version: 2.1+dfsg-2~bpo70+2
>>> Severity: normal
>>>
>>> Hello,
>>>
>>> I was able to successfully use the passthrough TRIM support with an IDE
>>> interface virtual disk in Qemu-KVM version 2.0.
>>>
>>> However after upgrading to 2.1 and restarting my VM, TRIM now fails in it with
>>> messages like those quoted below (dmesg from the guest). There are no messages
>>> in dmesg related to that on the host.
>
> BTW, I found a system here with an SSD which supports discard, and tried my
> guests against it -- everything works fine when I use sata/ahci, but it breaks
> indeed when using the default IDE interface.
>
> But applying the oneliner:
>
>> It is the same as 2.1+dfsg-1~bpo70+2 but with a one-line patch
>> added:
>>
>> diff --git a/hw/ide/core.c b/hw/ide/core.c
>> index db191a6..7256592 100644
>> --- a/hw/ide/core.c
>> +++ b/hw/ide/core.c
>> @@ -688,7 +688,8 @@ void ide_dma_cb(void *opaque, int ret)
>> sector_num, n, s->dma_cmd);
>> #endif
>>
>> - if (!ide_sect_range_ok(s, sector_num, n)) {
>> + if ((s->dma_cmd == IDE_DMA_READ || s->dma_cmd == IDE_DMA_WRITE) &&
>> + !ide_sect_range_ok(s, sector_num, n)) {
>> dma_buf_commit(s);
>> ide_dma_error(s);
>> return;
>
> fixes the prob for me. So apparently kwolf was right pointing to that
> commit 58ac3211.
But this makes me wonder: why the issue only exists with ide, but not
with ahci/sata? The two should be sufficiently similar to trigger this
check the same way. Maybe we have another bug somewhere, like adding
an extra sector in some path, which is triggered by 58ac3211? Maybe
even in the guest kernel (but in this case, since it works with real
hw, we should ignore it).
Thanks,
/mjt
next prev parent reply other threads:[~2014-08-13 6:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20140812193530.70d0aa63@natsu>
[not found] ` <53EA28DB.8060807@msgid.tls.msk.ru>
2014-08-13 6:05 ` [Qemu-devel] Bug#757927: [qemu-kvm] TRIM (discard=unmap) broken in 2.1 Michael Tokarev
2014-08-13 6:16 ` Roman Mamedov
2014-08-13 6:23 ` Michael Tokarev
2014-08-13 6:41 ` Michael Tokarev [this message]
2014-08-13 10:06 ` Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53EB089B.6080906@msgid.tls.msk.ru \
--to=mjt@tls.msk.ru \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.