How to debug >2GB memory issues (and 3ware)

Vinod Kashyap vkashyap at amcc.com
Mon Nov 8 23:53:43 GMT 2004



> -----Original Message-----
> From: James R. Van Artsalen [mailto:james at jrv.org]
> Sent: Monday, November 08, 2004 3:42 PM
> To: Vinod Kashyap
> Cc: Michael R. Wayne; freebsd-amd64 at freebsd.org
> Subject: Re: How to debug >2GB memory issues (and 3ware)
> 
> 
> Vinod Kashyap wrote:
> 
> >The 3ware driver (twe) for 7xxx/8xxx controllers can handle upto
> >4 GB memory on FreeBSD 4.x, and beyond 4 GB on FreeBSD 5.x.  The
> >driver (twa) for 9xxx controllers can handle memory beyond 4 GB
> >on both 4.x and 5.x.
> >  
> >
> 
> The twe driver in MAIN seems to be limited to direct access 
> to the lower 
> 4GB.  Am I misinterpreting the significance of this code in 
> twe_freebsd.c?
> 
>     /*
>      * Allocate the parent bus DMA tag appropriate for PCI.
>      */
>     if (bus_dma_tag_create(NULL, 				
> /* parent */
> 			   1, 0, 				
> /* alignment, boundary */
> 			   BUS_SPACE_MAXADDR_32BIT, 		
> /* lowaddr */
> 			   BUS_SPACE_MAXADDR, 			
> /* highaddr */
> 			   NULL, NULL, 				
> /* filter, filterarg */
> 			   MAXBSIZE, TWE_MAX_SGL_LENGTH,	
> /* maxsize, nsegments */
> 			   BUS_SPACE_MAXSIZE_32BIT,		
> /* maxsegsize */
> 			   BUS_DMA_ALLOCNOW,			
> /* flags */
> 			   NULL,				
> /* lockfunc */
> 			   NULL,				
> /* lockarg */
> 
> 

What this piece of code does is, it lets busdma know that the driver
cannot be passed addresses beyond 4 GB.  So, busdma maps any addresses
beyond 4 GB to the range (< 4 GB) requested by the driver, and so, the
driver is effectively able to "handle" more than 4 GB memory.

All this because the underlying controller cannot access > 4 GB addresses.
The 9xxx controllers, however, can access > 4 GB addresses, and so, the
driver does not request for a smaller range of addresses.





More information about the freebsd-amd64 mailing list