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][RFC] embed memory map in domain pseudo phys

To: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Subject: Re: [Xen-ia64-devel] [PATCH][RFC] embed memory map in domain pseudo physical address space
From: Alex Williamson <alex.williamson@xxxxxx>
Date: Thu, 01 Feb 2007 15:47:32 -0700
Cc: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 01 Feb 2007 14:46:52 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20070201131521.GD14993%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: HP OSLO R&D
References: <20070201131521.GD14993%yamahata@xxxxxxxxxxxxx>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi Isaku,

   A few comments inline.  Thanks,

        Alex

On Thu, 2007-02-01 at 22:15 +0900, Isaku Yamahata wrote:
> +static void
> +setup_dom0_memmap_info(struct domain *d, struct fw_tables *tables,
> +                      int *num_mds)
> +{
> +       int i;
> +       efi_memory_desc_t *md;
> +       efi_memory_desc_t *last_mem_md = NULL;
> +       xen_ia64_memmap_info_t* memmap_info;
> +       unsigned long paddr_start;
> +       unsigned long paddr_end;
> +
> +       for (i = 0; i < *num_mds; i++) {
> +               md = &tables->efi_memmap[i];
> +               if (md->attribute == EFI_MEMORY_WB &&
> +                   md->type == EFI_CONVENTIONAL_MEMORY &&
> +                   md->num_pages > (1UL << (PAGE_SHIFT -
> EFI_PAGE_SHIFT)))
> +                       last_mem_md = md;
> +       }
> +       if (last_mem_md == NULL) {
> +               printk("%s: warning: "
> +                      "no dom0 contiguous memory to hold memory map
> \n",
> +                      __func__);
> +               return;
> +       }

   Looks like you could search the array starting from the end as a
minor optimization.


> +       paddr_end = last_mem_md->phys_addr +
> +               (last_mem_md->num_pages << EFI_PAGE_SHIFT);
> +       paddr_start = paddr_end - (1UL << (PAGE_SHIFT -
> EFI_PAGE_SHIFT));

   This doesn't look right.  We're not multiplying by the EFI page size.

> +       paddr_start &= PAGE_MASK;

   Seems like it's possible this mask could make (paddr_start <
last_mem_md->phys_addr)


-- 
Alex Williamson                             HP Open Source & Linux Org.


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