xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: Tim Deegan <tim@xen.org>
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>
Subject: Re: [PATCH 3/18 V2]: PVH xen: create domctl_memory_mapping() function
Date: Fri, 22 Mar 2013 14:02:22 -0700	[thread overview]
Message-ID: <20130322140222.502c9f89@mantra.us.oracle.com> (raw)
In-Reply-To: <20130321150433.GK12338@ocelot.phlegethon.org>

On Thu, 21 Mar 2013 15:04:33 +0000
Tim Deegan <tim@xen.org> wrote:

> At 17:26 -0700 on 15 Mar (1363368383), Mukesh Rathor wrote:
> > In this patch, XEN_DOMCTL_memory_mapping code is put into a
> > function so it can be shared later for PVH. There is no change in
> > it's functionality.
> > 
>limit is an unsigned long, so 'int' doesn't seem right. 
> 
> > @@ -628,68 +690,13 @@ long arch_do_domctl(
> >          unsigned long mfn = domctl->u.memory_mapping.first_mfn;
> >          unsigned long nr_mfns = domctl->u.memory_mapping.nr_mfns;
> >          int add = domctl->u.memory_mapping.add_mapping;
> > -        unsigned long i;
> > -
> > -        ret = -EINVAL;
> > -        if ( (mfn + nr_mfns - 1) < mfn || /* wrap? */
> > -             ((mfn | (mfn + nr_mfns - 1)) >> (paddr_bits -
> > PAGE_SHIFT)) ||
> > -             (gfn + nr_mfns - 1) < gfn ) /* wrap? */
> > -            break;
> >  
> >          ret = -EPERM;
> >          if ( !IS_PRIV(current->domain) &&
> >               !iomem_access_permitted(current->domain, mfn, mfn +
> > nr_mfns - 1) ) break;
> 
> Why is this privilege check not being moved along with the rest of it?
> Execially given that the two other IS_PRIV()s below are taken?

Because, the other caller is construct_dom0, so not really needed. But
I'll move it anyways.

thanks,
Mukesh

      reply	other threads:[~2013-03-22 21:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-16  0:26 [PATCH 3/18 V2]: PVH xen: create domctl_memory_mapping() function Mukesh Rathor
2013-03-21 15:04 ` Tim Deegan
2013-03-22 21:02   ` Mukesh Rathor [this message]

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=20130322140222.502c9f89@mantra.us.oracle.com \
    --to=mukesh.rathor@oracle.com \
    --cc=Xen-devel@lists.xensource.com \
    --cc=tim@xen.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).