WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ia64-devel

Re: [Xen-ia64-devel] [PATCH 2/3] p2m table expsosure linux side

To: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Subject: Re: [Xen-ia64-devel] [PATCH 2/3] p2m table expsosure linux side
From: Alex Williamson <alex.williamson@xxxxxx>
Date: Tue, 03 Oct 2006 16:33:59 -0600
Cc: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 03 Oct 2006 15:36:09 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20061003094131.GA23182%yamahata@xxxxxxxxxxxxx>
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: OSLO R&D
References: <20061003094131.GA23182%yamahata@xxxxxxxxxxxxx>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi Isaku,

   A few more comments...

On Tue, 2006-10-03 at 18:41 +0900, Isaku Yamahata wrote:

>         BUG_ON(privcmd_resource_min >= privcmd_resource_max);
> +
> +       // XXX this should be somewhere appropriate
> +       (void)p2m_expose_init();
> +

   Maybe it's own initcall?  Perhaps a device_initcall() or
subsys_initcall() would work(?)

> +#ifdef notyet
> +void
> +p2m_expose_cleanup(void)
> +{
> +       BUG_ON(!p2m_initialized);
> +       release_resrouce(&p2m_resource);
                  ^^^^^^^^ typo

> +       if (likely(__get_user(pteval, (unsigned long __user *)pte) ==
> 0) &&
> +           likely(pte_present(__pte(pteval))) &&
> +           likely(pte_pfn(__pte(pteval)) != (INVALID_MFN >>
> PAGE_SHIFT)))
> +               mfn = (pteval & _PFN_MASK) >> PAGE_SHIFT;

   I don't think the compiler is going to be able to figure this out
like you intend it to.  It should probably be:

if (likely(_get_user(pteval, (unsigned long __user *)pte) == 0 &&
           pte_present(__pte(pteval)) &&
           pte_pfn(__pte(pteval)) != (INVALID_MFN >> PAGE_SHIFT))

> +static inline unsigned long
> +HYPERVISOR_expose_p2m(unsigned long conv_start_gpfn,
> +                     unsigned long assign_start_gpfn,
> +                     unsigned long expose_size, unsigned long
> granule_pfn)
> +{
> +       unsigned long ret = 0;
> +       if (is_running_on_xen()) {

   This seems like a strange place for a is_running_on_xen() check.
Shouldn't the caller of this be the one aware of running on xen or not?

   Why is p2m_expose_init() exported?  Only for the test module?  The
test module seems like a nice benchmarking utility, but it doesn't seem
like something that would get into the upstream kernel.  Do we really
want to expose this level of detail of the p2m operations to everyone
via these exports?  Thanks,

        Alex

-- 
Alex Williamson                             HP Open Source & Linux Org.


_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel

<Prev in Thread] Current Thread [Next in Thread>