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 regarding behavior of virt_to_bus ....

To: "Himanshu Raj" <rhim@xxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] Question regarding behavior of virt_to_bus ....
From: "Ian Pratt" <m+Ian.Pratt@xxxxxxxxxxxx>
Date: Tue, 4 Oct 2005 11:10:21 +0100
Delivery-date: Tue, 04 Oct 2005 10:07:53 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcXIuYrRRz7g6R1xQMykbPYmE3xMlgAEZ9qA
Thread-topic: [Xen-devel] Question regarding behavior of virt_to_bus ....
> I need some large chunk of physical memory, so I allocate it 
> early using alloc_bootmem_low_pages and use it later (akin to 
> bigphysarea patch). 

If it needs to be machine contiguous this won't work on its own.

You need to use xen_create_contiguous_region to attempt to change the
pages backing the region into a contigous extent. 

See dma_alloc

Ian

> The trouble I am having is the following. Suppose the virtual 
> address for the memory area is 0xc14d6000. After 
> xen_create_contiguous_region call, I do a virt_to_bus and the 
> bus address comes out to be 0x18000000. 
> So far so good. However, later when I try to use this memory 
> in a device driver, the call to virt_to_bus returns 
> 0x14d6000. This result is baffling me, since that's what it 
> would look like in a normal 32-bit
> i386 world, and not in xenified world.
> 
> Am I doing something stupid, or is there some technicality of 
> memory subsystem that I don't get. Ofcourse, if I just use 
> pci_alloc_consistent (for a small buffer), everything works 
> fine, since there is no bootmem related contortion involved.
> 
> I will highly appreciate any input on this.
> 
> --Himanshu
> --------------------------------------------------------------
> -----------
> Himanshu Raj
> PhD Student, GaTech (www.cc.gatech.edu/~rhim) I prefer to 
> receive attachments in an open, non-proprietary format.
> --------------------------------------------------------------
> -----------
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel
> 

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

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