Skip to contentSkip to conversation

ioremap failing in linux guest

DISCUSSION Anish Bhatt 3 participants 6 messages Oct 7, 2008 – Oct 9, 2008

lore
Share & tools
lore
#0 lore raw

I'm trying to map some memory reserved with the mem= & memap = parameters (in guest) in a module in the guest. ioremap keeps failing with xend dmesg displaying this error :
/ mm.c:710:d2 Error getting mfn 20000 (pfn 2584e) from L1 entry 0000000020000263 for dom3275/

Anyone know why this is happening, or what I'm doing wrong ? -Anish

Signature · 1 line
As long as the music's loud enough, we won't hear the world falling apart.
#1 lore raw
Quoted 8 lines · Anish Bhatt

I'm trying to map some memory reserved with the mem= & memap = parameters (in guest) in a module in the guest. ioremap keeps failing with xend dmesg displaying this error :
/ mm.c:710:d2 Error getting mfn 20000 (pfn 2584e) from L1 entry 0000000020000263 for dom3275/

Anyone know why this is happening, or what I'm doing wrong ? -Anish

ioremap() takes machine addresses when running on Xen; not pseudophysical addresses.

-- Keir

#2 lore raw

Is there an API for converting pseudophysical addresses to machine addresses or possibly sample code somewhere ? -Anish

Quoted 25 lines · Keir Fraser
Quoted 9 lines · Anish Bhatt

I'm trying to map some memory reserved with the mem= & memap = parameters (in guest) in a module in the guest. ioremap keeps failing with xend dmesg displaying this error :
/ mm.c:710:d2 Error getting mfn 20000 (pfn 2584e) from L1 entry 0000000020000263 for dom3275/

Anyone know why this is happening, or what I'm doing wrong ? -Anish

ioremap() takes machine addresses when running on Xen; not pseudophysical addresses.

-- Keir

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Signature · 1 line
As long as the music's loud enough, we won't hear the world falling apart.
#3 lore raw
Quoted 1 line · Anish Bhatt

Is there an API for converting pseudophysical addresses to machine addresses or possibly sample code somewhere ?

What are you trying to achieve? ioremap is only valid to use on device memory anyway, so you shouldn't be in a position to use it unless you've already got machine addresses in hand (and they're going to be machine addresses with no existing pfn translation).

J

#4 lore raw

The driver for the network processor that I am using does an ioremap call to map memory previously reserved using the mem & memap kernel parameters. for eg. if I reserve memory using memmap=384M$512M, it is calling ioremap(384,512) (with appropriate conversion to bytes) and later using the returned address to setup its queues. -Anish

Quoted 6 lines · Jeremy Fitzhardinge
Quoted 1 line · Anish Bhatt

Is there an API for converting pseudophysical addresses to machine addresses or possibly sample code somewhere ?

What are you trying to achieve? ioremap is only valid to use on device memory anyway, so you shouldn't be in a position to use it unless you've already got machine addresses in hand (and they're going to be machine addresses with no existing pfn translation).

J

Signature · 1 line
As long as the music's loud enough, we won't hear the world falling apart.
#5 lore raw

Sounds like a 'bigphysarea' kind of hack. That won't work on Xen without modifying the driver. Quite a part from anything else the driver probably expects the memory range to be machine contiguous, and it almost certainly won't be.

-- Keir

Quoted 19 lines · Anish Bhatt

The driver for the network processor that I am using does an ioremap call to map memory previously reserved using the mem & memap kernel parameters. for eg. if I reserve memory using memmap=384M$512M, it is calling ioremap(384,512) (with appropriate conversion to bytes) and later using the returned address to setup its queues. -Anish

Quoted 10 lines · Jeremy Fitzhardinge
Quoted 2 lines · Anish Bhatt

Is there an API for converting pseudophysical addresses to machine addresses or possibly sample code somewhere ?

What are you trying to achieve? ioremap is only valid to use on device memory anyway, so you shouldn't be in a position to use it unless you've already got machine addresses in hand (and they're going to be machine addresses with no existing pfn translation).

J