All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Michael Tokarev <mjt@tls.msk.ru>, qemu-devel <qemu-devel@nongnu.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
	Chris Boot <bootc@bootc.net>,
	qemu-stable <qemu-stable@nongnu.org>,
	Peter Maydell <peter.maydell@linaro.org>
Subject: Re: [Qemu-devel] commit a87f39543a92 'memory: fix limiting of translation at a page boundary' breaks virtio-scsi for windows 64
Date: Fri, 11 Apr 2014 14:38:24 +0200	[thread overview]
Message-ID: <5347E240.9040306@redhat.com> (raw)
In-Reply-To: <5347DFA4.50802@redhat.com>

On 04/11/14 14:27, Laszlo Ersek wrote:
> On 04/11/14 14:02, Michael Tokarev wrote:

>> More, the same issue exists on 2.0-tobe as well, but in this case, reverting
>> the same commit from there -- a87f39543a9259f671c5413723311180ee2ad2a8 --
>> does NOT fix the problem.  I'm bisecting between 1.7.0 and 2.0 now.
>>
>> This is just a heads-up for now, dunno how important this use case is.
> 
> Disclaimer: I don't know what I'm talking about.
> 
> This hunk in 819ddf7d:
> 
>> @@ -295,6 +307,11 @@ MemoryRegion *address_space_translate(AddressSpace *as, hwaddr addr,
>>          as = iotlb.target_as;
>>      }
>>  
>> +    if (memory_access_is_direct(mr, is_write)) {
>> +        hwaddr page = ((addr & TARGET_PAGE_MASK) + TARGET_PAGE_SIZE) - addr;
>> +        len = MIN(page, len);
>> +    }
>> +
>>      *plen = len;
>>      *xlat = addr;
>>      return mr;
> 
> limits "len" at the *first* page boundary that is strictly above "addr".
> Is that the intent? The commit subject says "at *a* page boundary".
> 
> Shouldn't it go like:
> 
>     if (memory_access_is_direct(mr, is_write)) {
>         hwaddr page = (((addr + len) & TARGET_PAGE_MASK) + TARGET_PAGE_SIZE) - addr;
>         len = MIN(page, len);
>     }
> 
> This would drop only the trailing portion beyond the last page boundary covered.

Ugh, no it wouldn't. What I suggested was crazy. I should probably just
shut up. Sorry.

Laszlo

  reply	other threads:[~2014-04-11 12:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-11 12:02 [Qemu-devel] commit a87f39543a92 'memory: fix limiting of translation at a page boundary' breaks virtio-scsi for windows 64 Michael Tokarev
2014-04-11 12:27 ` Laszlo Ersek
2014-04-11 12:38   ` Laszlo Ersek [this message]
2014-04-11 12:49 ` Michael Tokarev

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=5347E240.9040306@redhat.com \
    --to=lersek@redhat.com \
    --cc=bootc@bootc.net \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=mjt@tls.msk.ru \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@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.