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-devel

Re: [Xen-devel] question about page_to_phys

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] question about page_to_phys
From: Xiaofeng Ling <xiaofeng.ling@xxxxxxxxx>
Date: Thu, 01 Sep 2005 17:56:54 +0800
Delivery-date: Thu, 01 Sep 2005 09:57:49 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <ca96cc44c40fb9aea95586126b73ecc5@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4316598E.4010108@xxxxxxxxx> <b3724dd9284b81be265c6a1abc3c8dfd@xxxxxxxxxxxx> <4316C793.4080501@xxxxxxxxx> <ca96cc44c40fb9aea95586126b73ecc5@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510
Keir Fraser wrote:

On 1 Sep 2005, at 10:19, Xiaofeng Ling wrote:

If a guest is in translate mode it should have no concept of pseudophys
vs machine. That translation is hidden from it. Hence there should be
no need to hack the virtual drivers -- page_to_phys() should naturally
translate to pseudophys if SHADOW_TRANSLATE is configured.

  -- Keir

so we need such a patch? but how to deal with virt_to_mfn in blkfront.c?

diff -r 9092486cc4b3 linux-2.6-xen-sparse/include/asm-xen/asm-i386/io.h
--- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/io.h
+++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/io.h
@@ -101,7 +101,11 @@
  * Change "struct page" to physical address.
  */
#define page_to_pseudophys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT)
+#ifndef CONFIG_SHADOW_TRANSLATE
#define page_to_phys(page) (phys_to_machine(page_to_pseudophys(page)))
+#else
+#define page_to_phys(page)      (page_to_pseudophys(page))
+#endif

 #define bio_to_pseudophys(bio)  (page_to_pseudophys(bio_page((bio))) + \
                                  (unsigned long) bio_offset((bio)))

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

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