xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Christoph Egger <chegger@amazon.de>,
	suravee.suthikulpanit@amd.com
Subject: Re: [PATCH v3] nested SVM: adjust guest handling of structure mappings
Date: Mon, 11 Nov 2013 14:40:43 +0000	[thread overview]
Message-ID: <5280EC6B.4080108@citrix.com> (raw)
In-Reply-To: <5280EB290200007800101E07@nat28.tlf.novell.com>

On 11/11/13 13:35, Jan Beulich wrote:
>>>> On 11.11.13 at 14:16, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>> On 11/11/13 12:53, Jan Beulich wrote:
>>> +    for ( io_bitmap = hvm_map_guest_frame_ro(gfn, 0); ; )
>>> +    {
>>> +        enabled = io_bitmap && test_bit(port, io_bitmap);
>>> +        if ( !enabled || !--size )
>>> +            break;
>>> +        if ( unlikely(++port == 8 * PAGE_SIZE) )
>>> +        {
>>> +            hvm_unmap_guest_frame(io_bitmap, 0);
>>> +            io_bitmap = hvm_map_guest_frame_ro(++gfn, 0);
>>> +            port -= 8 * PAGE_SIZE;
>>> +        }
>>>      }
>> Ok - this safe now, but I don't understand the reasoning for introducing
>> this loop?
>>
>> The ioio exit value gives us a single port, and the size of access on
>> that specific port.
>>
>> The switch statement tells us exactly which gfn the relevant bit refers
>> to, surely a single hvm_map_guest_frame_ro() is sufficient?
> When the operation spans multiple ports (INW, INL, etc), multiple
> bits need to be looked at. And when the access is misaligned and
> crosses a 32k (port number) boundary, more than one page needs
> looking at.
>
> Jan
>

Ah of course.

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

  reply	other threads:[~2013-11-11 14:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-11  8:33 [PATCH] nested SVM: adjust guest handling of structure mappings Jan Beulich
2013-11-11 11:07 ` [PATCH v2] " Jan Beulich
2013-11-11 11:25   ` Andrew Cooper
2013-11-11 12:29     ` Jan Beulich
2013-11-11 12:53     ` [PATCH v3] " Jan Beulich
2013-11-11 13:16       ` Andrew Cooper
2013-11-11 13:35         ` Jan Beulich
2013-11-11 14:40           ` Andrew Cooper [this message]
2013-11-11 13:22       ` Egger, Christoph
2013-11-12  3:57       ` Suravee Suthikulpanit

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=5280EC6B.4080108@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=chegger@amazon.de \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=xen-devel@lists.xenproject.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 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).