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] buildconfigs of supportingSPARSEMEM

To: Alex Williamson <alex.williamson@xxxxxx>, Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Subject: Re: [Xen-ia64-devel] [Patch][RFC] buildconfigs of supportingSPARSEMEM
From: Akio Takebe <takebe_akio@xxxxxxxxxxxxxx>
Date: Thu, 01 Feb 2007 17:04:33 +0900
Cc: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 01 Feb 2007 00:06:29 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <1170271033.10792.210.camel@bling>
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>
References: <FDC7444E6F1932takebe_akio@xxxxxxxxxxxxxx> <1170271033.10792.210.camel@bling>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi, Alex and Isaku

I'm trying to fix the warning caused by setting SPARSEMEM. 

In the case of x86 code, the following check is used instead of pfn_valid().

static inline unsigned long mfn_to_local_pfn(unsigned long mfn)
{
        unsigned long pfn = mfn_to_pfn(mfn);
        if ((pfn < end_pfn)
            && !xen_feature(XENFEAT_auto_translated_physmap)
            && (phys_to_machine_mapping[pfn] != mfn))
                return end_pfn; /* force !pfn_valid() */
        return pfn;
}

mfn_to_local_pfn() is called only by in_swiotlb_aperture().
in_swiotlb_aperture() check pfn_valid(),
so I fix by the following way, what do you think?

diff -r ef646312685f linux-2.6-xen-sparse/include/asm-ia64/maddr.h
--- a/linux-2.6-xen-sparse/include/asm-ia64/maddr.h     Wed Jan 31 10:59:56 
2007 -0700
+++ b/linux-2.6-xen-sparse/include/asm-ia64/maddr.h     Fri Feb 02 01:08:01 
2007 +0900
@@ -69,8 +69,11 @@ mfn_to_local_pfn(unsigned long mfn)
 mfn_to_local_pfn(unsigned long mfn)
 {
        unsigned long pfn = mfn_to_pfn_for_dma(mfn);
+#ifndef CONFIG_SPARSEMEM
        if (!pfn_valid(pfn))
                return INVALID_P2M_ENTRY;
+#endif
+/* we should pfn_valid() in caller function if SARSEMEM. */
        return pfn;
 }
 

Best Regards,

Akio Takeeb

>Hi Akio,
>
>   These end with a build error for me, so I think they should be
>cleaned up before this goes in the tree.  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>