From: Adin Scannell <adin@scannell.ca>
To: xen-devel@lists.xensource.com
Cc: konrad@darnok.org, andres@gridcentric.ca, adin@gridcentric.com,
olaf@aepfle.de, JBeulich@suse.com, linux-kernel@vger.kernel.org,
Adin Scannell <adin@scannell.ca>
Subject: [PATCH 2/3] Small fix-ups for the xen/privcmd ioctls
Date: Tue, 20 Dec 2011 01:36:52 -0500 [thread overview]
Message-ID: <1324363013-11031-3-git-send-email-adin@scannell.ca> (raw)
In-Reply-To: <1324363013-11031-1-git-send-email-adin@scannell.ca>
In implementing the mmap_batch_v2 ioctl, some of the feedback included small
fixups that were also relevant to the existing mmap_batch ioctl. Prior to the
mmap_batch_v2 patch, this adds those small fixups to the existing code.
The const addition for gather_array is necessary for the implementation of
mmap_batch_v2 and does not affect correctness.
Signed-off-by: Adin Scannell <adin@scannell.ca>
---
drivers/xen/privcmd.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
index ccee0f1..161681f 100644
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -76,7 +76,7 @@ static void free_page_list(struct list_head *pages)
*/
static int gather_array(struct list_head *pagelist,
unsigned nelem, size_t size,
- void __user *data)
+ const void __user *data)
{
unsigned pageidx;
void *pagedata;
@@ -246,7 +246,7 @@ struct mmap_batch_state {
domid_t domain;
unsigned long va;
struct vm_area_struct *vma;
- int err;
+ unsigned long err;
xen_pfn_t __user *user;
};
@@ -256,6 +256,8 @@ static int mmap_batch_fn(void *data, void *state)
xen_pfn_t *mfnp = data;
struct mmap_batch_state *st = state;
+ BUG_ON(st == NULL || st->vma == NULL);
+
if (xen_remap_domain_mfn_range(st->vma, st->va & PAGE_MASK, *mfnp, 1,
st->vma->vm_page_prot, st->domain) < 0) {
*mfnp |= 0xf0000000U;
--
1.6.2.5
next prev parent reply other threads:[~2011-12-20 6:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-20 6:36 [PATCH 0/3] Add kernel bits necessary to suport Xen paging Adin Scannell
2011-12-20 6:36 ` [PATCH 1/3] Make xen_remap_domain_mfn_range return value meaningful in case of error Adin Scannell
2011-12-20 18:21 ` Konrad Rzeszutek Wilk
2011-12-20 6:36 ` Adin Scannell [this message]
2011-12-20 6:36 ` [PATCH 3/3] Port of mmap_batch_v2 to support paging in Xen Adin Scannell
2011-12-20 18:11 ` Konrad Rzeszutek Wilk
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=1324363013-11031-3-git-send-email-adin@scannell.ca \
--to=adin@scannell.ca \
--cc=JBeulich@suse.com \
--cc=adin@gridcentric.com \
--cc=andres@gridcentric.ca \
--cc=konrad@darnok.org \
--cc=linux-kernel@vger.kernel.org \
--cc=olaf@aepfle.de \
--cc=xen-devel@lists.xensource.com \
/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).