Skip to contentSkip to conversation

pci_map_single() on IA64

DISCUSSION Adhiraj 3 participants 3 messages Jun 7, 2006

lore
Share & tools
lore

Adhiraj

author
#0 lore raw

Hi all,

How is it possible that on an IA64 machine, the address returned by pci_map_single() is above 4G (32 bits) when I have only 2G of physical memory?

The DMA mask is set to 64 bits (using pci_set_dma_mask()). When I change it to 32 bit DMA mask, the problem goes away.

This problem does not appear on i388/x86_64 machines.

Thanks,
Adhiraj.

#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Adhiraj" == Adhiraj <[email protected]> writes:

Adhiraj> Hi all, How is it possible that on an IA64 machine, the Adhiraj> address returned by pci_map_single() is above 4G (32 bits) Adhiraj> when I have only 2G of physical memory?

Depends on how the physical memory is located on the system and how the PCI bridge sees it.

Adhiraj> The DMA mask is set to 64 bits (using
Adhiraj> pci_set_dma_mask()). When I change it to 32 bit DMA mask, the Adhiraj> problem goes away.

Forcing it to a 32 bit mask may force the box to use the IOMMU if it has one, which not all IA64 systems do have. However, since you have set the DMA mask to 64 bits then you're getting exactly what you are asking for, so why is this a 'problem'? A 64 bit DMA mask means the adapter can do 64 bit addressing, it has nothing to do with the width of the databus.

Jes

#2 lore raw
In reply to Adhiraj
Quoted 10 lines · Adhiraj

Hi all,

How is it possible that on an IA64 machine, the address returned by pci_map_single() is above 4G (32 bits) when I have only 2G of physical memory?

The DMA mask is set to 64 bits (using pci_set_dma_mask()). When I change it to 32 bit DMA mask, the problem goes away.

This problem does not appear on i388/x86_64 machines.

What is the physical layout of that 2GB of memory? You can't count
on memory being contiguous, especially on IA64 systems. If the address you get back is within the DMA mask of the device, then the DMA mapping is valid. You can run 'grep "System RAM" /proc/iomem' to get some idea of the physical memory address map. Thanks,

Alex

Signature · 1 line
Alex Williamson                             HP Open Source & Linux Org.