From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Tim Deegan <tim@xen.org>
Cc: xen-devel@lists.xenproject.org, Jan Beulich <jbeulich@suse.com>,
Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH v6 4/4] xen: rework paging_log_dirty_op to work with hvm guests
Date: Thu, 14 May 2015 12:58:33 +0200 [thread overview]
Message-ID: <55547FD9.4040808@citrix.com> (raw)
In-Reply-To: <20150514095317.GD81528@deinos.phlegethon.org>
El 14/05/15 a les 11.53, Tim Deegan ha escrit:
> At 16:25 +0200 on 11 May (1431361528), Roger Pau Monne wrote:
>> When the caller of paging_log_dirty_op is a hvm guest Xen would choke when
>> trying to copy the dirty bitmap to the guest because the paging lock is
>> already held.
>>
>> Fix this by independently mapping each page of the guest bitmap as needed
>> without the paging lock held.
>>
>> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
>
> This looks mostly correct, but OTOH we now seem to have two nested
> stop-and-retry mechsnisms in one function. I think this would be
> cleaner if here:
>
>> + if ( pages >> (3 + PAGE_SHIFT) !=
>> + index_mapped >> (3 + PAGE_SHIFT) )
>> {
>> - rv = -EFAULT;
>> - goto out;
>> + /* We need to map next page */
>> + d->arch.paging.preempt.log_dirty.i4 = i4;
>> + d->arch.paging.preempt.log_dirty.i3 = i3;
>> + d->arch.paging.preempt.log_dirty.i2 = i2;
>> + d->arch.paging.preempt.log_dirty.done = pages;
>> + paging_unlock(d);
>> + unmap_dirty_bitmap(dirty_bitmap, page);
>
> we set the rest of the preempt state, like so:
>
> d->arch.paging.preempt.dom = current->domain;
> d->arch.paging.preempt.op = sc->op;
> resuming = 1;
>
> and bailed to the very top of the function. I think we might also
> need a hypercall_preempt_check() here as well, so that this restart
> path doesn't stop us ever reaching the preempt_checks below.
OK, I don't mind adding a preempt check here, although I think we would
hit the ones below anyway as we go scanning the dirty bitmap even if we
have to restart.
Roger.
next prev parent reply other threads:[~2015-05-14 10:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-11 14:25 [PATCH v6 0/4] xen/pvh: enable migration on PVH Dom0 Roger Pau Monne
2015-05-11 14:25 ` [PATCH v6 1/4] xen: introduce a helper to allocate non-contiguous memory Roger Pau Monne
2015-05-14 9:38 ` Tim Deegan
2015-05-11 14:25 ` [PATCH v6 2/4] xen/shadow: fix shadow_track_dirty_vram to work on hvm guests Roger Pau Monne
2015-05-14 9:41 ` Tim Deegan
2015-05-11 14:25 ` [PATCH v6 3/4] xen/hap: make hap_track_dirty_vram use non-contiguous memory for temporary map Roger Pau Monne
2015-05-11 14:25 ` [PATCH v6 4/4] xen: rework paging_log_dirty_op to work with hvm guests Roger Pau Monne
2015-05-14 9:53 ` Tim Deegan
2015-05-14 10:58 ` Roger Pau Monné [this message]
2015-05-14 11:35 ` Tim Deegan
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=55547FD9.4040808@citrix.com \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=tim@xen.org \
--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 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.