From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiaofeng Ling Subject: Re: question about page_to_phys Date: Thu, 01 Sep 2005 17:56:54 +0800 Message-ID: <4316D066.8010708@intel.com> References: <4316598E.4010108@intel.com> <4316C793.4080501@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser , xen-devel List-Id: xen-devel@lists.xenproject.org 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)))