All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Ian Jackson <ian.jackson@eu.citrix.com>,
	Paul Durrant <paul.durrant@citrix.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wei.liu2@citrix.com>
Subject: Re: [PATCH v2 3/5] tools/libxendevicemodel: extract functions and add a compat layer
Date: Wed, 22 Feb 2017 14:33:40 +0000	[thread overview]
Message-ID: <1b6bac16-ce48-9a86-a696-88726073ef27@citrix.com> (raw)
In-Reply-To: <22701.40486.327235.432509@mariner.uk.xensource.com>

On 22/02/17 14:20, Ian Jackson wrote:
> Paul Durrant writes ("[PATCH v2 3/5] tools/libxendevicemodel: extract functions and add a compat layer"):
>> This patch extracts all functions resulting in a dm_op hypercall from
>> libxenctrl and moves them into libxendevicemodel. It also adds a compat
>> layer into libxenctrl, which can be selected by defining
>> XC_WANT_COMPAT_DEVICEMODEL_API to 1 before including xenctrl.h.
>>
>> With this patch the core of libxendevicemodel still uses libxencall to
>> issue the dm_op hypercalls, but this is done by calling through code that
>> can be modified on a per-OS basis. A subsequent patch will add a Linux-
>> specific variant.
> ...
>> +int xendevicemodel_track_dirty_vram(
>> +    xendevicemodel_handle *dmod, domid_t domid, uint64_t first_pfn,
>> +    uint32_t nr, unsigned long *dirty_bitmap)
>> +{
>> +    struct xen_dm_op op;
>> +    struct xen_dm_op_track_dirty_vram *data;
>> +
>> +    memset(&op, 0, sizeof(op));
>> +
>> +    op.op = XEN_DMOP_track_dirty_vram;
>> +    data = &op.u.track_dirty_vram;
>> +
>> +    data->first_pfn = first_pfn;
>> +    data->nr = nr;
>> +
>> +    return xendevicemodel_op(dmod, domid, 2, &op, sizeof(op),
>> +                             dirty_bitmap, (size_t)(nr + 7) / 8);
>> +}
> As I think we discussed some time last week (?), this function cannot
> be a DMOP.  This is because enabling track_dirty_vram causes the
> hypervisor to remember the memory referred to by dirty_bitmap, but the
> dmop privcmd restriction mechanism only guarantees that the memory is
> valid and belonging to this guest _during the hypercall_.

Sorry to jump in here, but what?  Since when?

track-dirty-vram stashes where the DM thinks the vram is in guest
physical address space, so if a new range is requested, we can set
appropriate bits in the dirty map.

However, the interesting pointer for the DMOP (i.e. where the DM would
like Xen to write the bitmap to) is not stored across distinct calls at
all.  It is stored as part of a continuation, but that is still
logically part of a single invocation.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-02-22 14:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-22 13:27 [PATCH v2 0/5] tools/libxendevicemodel Paul Durrant
2017-02-22 13:27 ` [PATCH v2 1/5] tools/libxenctrl: fix error check after opening libxenforeignmemory Paul Durrant
2017-02-22 14:09   ` Wei Liu
2017-04-05 13:25     ` Ian Jackson
2017-02-22 14:09   ` Ian Jackson
2017-02-22 13:27 ` [PATCH v2 2/5] tools/libxendevicemodel: introduce the new library Paul Durrant
2017-02-22 14:11   ` Ian Jackson
2017-02-22 13:27 ` [PATCH v2 3/5] tools/libxendevicemodel: extract functions and add a compat layer Paul Durrant
2017-02-22 14:20   ` Ian Jackson
2017-02-22 14:33     ` Andrew Cooper [this message]
2017-02-22 14:37       ` Ian Jackson
2017-02-22 14:41         ` Andrew Cooper
2017-02-22 15:04           ` Ian Jackson
2017-02-22 15:27             ` Andrew Cooper
2017-02-22 13:27 ` [PATCH v2 4/5] tools/libxendevicemodel: introduce a Linux-specific implementation Paul Durrant
2017-02-22 14:22   ` Ian Jackson
2017-02-22 13:27 ` [PATCH v2 5/5] tools/libxendevicemodel: add a call to restrict the handle Paul Durrant
2017-02-22 14:22   ` Ian Jackson

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=1b6bac16-ce48-9a86-a696-88726073ef27@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=paul.durrant@citrix.com \
    --cc=wei.liu2@citrix.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 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.