All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hollis Blanchard <hollisb@us.ibm.com>
To: Isaku Yamahata <yamahata@valinux.co.jp>
Cc: xen-ppc-devel <xen-ppc-devel@lists.xensource.com>,
	xen-devel@lists.xensource.com,
	Alex Williamson <alex.williamson@hp.com>,
	xen-ia64-devel@lists.xensource.com
Subject: Re: [PATCH] [xen, xencomm] various xencomm fixes (was Re: [XenPPC] Re: [Xen-ia64-devel] [PATCH 1/2] remove xencomm page size limit(xen side))
Date: Fri, 10 Aug 2007 13:54:47 -0500	[thread overview]
Message-ID: <1186772087.7073.26.camel@basalt> (raw)
In-Reply-To: <20070807084454.GB20189%yamahata@valinux.co.jp>

On Tue, 2007-08-07 at 17:44 +0900, Isaku Yamahata wrote:
> 
> +/* get_page() to prevent from another vcpu freeing the page */
> +static int
> +xencomm_paddr_to_maddr(unsigned long paddr, unsigned long *maddr,
> +        struct page_info **page)
> +{
> +    *maddr = paddr_to_maddr(paddr);
> +    if (*maddr == 0)
> +        return -EFAULT;
> +
> +    *page = virt_to_page(*maddr);
> +    if (get_page(*page, current->domain) == 0) {
> +        if (page_get_owner(*page) != current->domain)
> +            /* This page might be a page granted by another domain  */
> +            panic_domain(NULL, "copy_from_guest from foreign domain\n");
> +
> +        /* Try again. */
> +        return -EAGAIN;
> +    }
> +
> +    return 0;
> +} 

PPC doesn't implement panic_domain(), so this doesn't build for me.

I don't see how we'd ever hit this case though, nor why we'd panic the
domain. How could paddr_to_maddr() ever return an maddr that doesn't
belong to the current domain? If paddr is invalid, an error should be
returned from there and propagated up, which is better than killing the
whole domain IMHO...

> +    *page = virt_to_page(*maddr);
This line doesn't make sense. Is it an maddr or a vaddr? If it's an
maddr, we shouldn't be passing it as "virt" to virt_to_page().

-- 
Hollis Blanchard
IBM Linux Technology Center

  reply	other threads:[~2007-08-10 18:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20070731061019.GB6039%yamahata@valinux.co.jp>
     [not found] ` <1185913517.6802.74.camel@bling>
     [not found]   ` <20070801063654.GD14448%yamahata@valinux.co.jp>
     [not found]     ` <1185995274.15389.21.camel@basalt>
     [not found]       ` <20070802024439.GB6395%yamahata@valinux.co.jp>
     [not found]         ` <1186066846.27484.7.camel@basalt>
     [not found]           ` <20070803021242.GB17231%yamahata@valinux.co.jp>
     [not found]             ` <1186152196.17978.1.camel@diesel>
2007-08-07  8:44               ` [PATCH] [xen, xencomm] various xencomm fixes (was Re: [XenPPC] Re: [Xen-ia64-devel] [PATCH 1/2] remove xencomm page size limit(xen side)) Isaku Yamahata
2007-08-10 18:54                 ` Hollis Blanchard [this message]
2007-08-13  2:46                   ` Isaku Yamahata

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=1186772087.7073.26.camel@basalt \
    --to=hollisb@us.ibm.com \
    --cc=alex.williamson@hp.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=xen-ia64-devel@lists.xensource.com \
    --cc=xen-ppc-devel@lists.xensource.com \
    --cc=yamahata@valinux.co.jp \
    /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.