* Using mini-os ioremap()
@ 2011-01-05 19:24 Matthew Fioravante
2011-01-05 22:55 ` Samuel Thibault
0 siblings, 1 reply; 4+ messages in thread
From: Matthew Fioravante @ 2011-01-05 19:24 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 307 bytes --]
I'm trying to map some mmio pages into my mini-os domain to use a
hardware device. The device is at address fed40000. I'm calling
ioremap() on this address but its failing, telling me that mfn fed40 is
in ram space. (Its failing the mfn_is_ram() check.)
What am I doing wrong here?
Thanks!
[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 2518 bytes --]
[-- Attachment #2: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Using mini-os ioremap()
2011-01-05 19:24 Using mini-os ioremap() Matthew Fioravante
@ 2011-01-05 22:55 ` Samuel Thibault
2011-01-06 17:00 ` Matthew Fioravante
0 siblings, 1 reply; 4+ messages in thread
From: Samuel Thibault @ 2011-01-05 22:55 UTC (permalink / raw)
To: Matthew Fioravante; +Cc: xen-devel
Matthew Fioravante, le Wed 05 Jan 2011 14:24:55 -0500, a écrit :
> I'm trying to map some mmio pages into my mini-os domain to use a
> hardware device. The device is at address fed40000. I'm calling
> ioremap() on this address but its failing, telling me that mfn fed40 is
> in ram space. (Its failing the mfn_is_ram() check.)
>
> What am I doing wrong here?
Mmm, I don't think anything you're doing is wrong. Notice the comment:
static long system_ram_end_mfn;
int mfn_is_ram(unsigned long mfn)
{
/* very crude check if a given MFN is memory or not. Probably should
* make this a little more sophisticated ;) */
return (mfn <= system_ram_end_mfn) ? 1 : 0;
}
Do you have more than 4GiB memory, i.e. 0xfed40000 is actually between
two RAM areas? In such case mfn_is_ram has to really get more
sophisticated.
(In the interim you could just comment the mfn_is_ram() test from
do_ioremap to make things work)
Samuel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Using mini-os ioremap()
2011-01-05 22:55 ` Samuel Thibault
@ 2011-01-06 17:00 ` Matthew Fioravante
2011-01-06 17:19 ` Samuel Thibault
0 siblings, 1 reply; 4+ messages in thread
From: Matthew Fioravante @ 2011-01-06 17:00 UTC (permalink / raw)
To: Samuel Thibault; +Cc: xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 1482 bytes --]
My box doesn't have more than 4GB. I've tried this on 32 bit and 64 bit.
I tried nuking the mfn_is_ram check. When I do that the call returns a
virtual memory address but when I try to read and write to it, it
appears to act just like a normal page of memory and not the device.
Does anyone know offhand of a mini-os project that either tested the
ioremap() call or actually does some memory mapped io operations?
On 01/05/2011 05:55 PM, Samuel Thibault wrote:
> Matthew Fioravante, le Wed 05 Jan 2011 14:24:55 -0500, a écrit :
>> I'm trying to map some mmio pages into my mini-os domain to use a
>> hardware device. The device is at address fed40000. I'm calling
>> ioremap() on this address but its failing, telling me that mfn fed40 is
>> in ram space. (Its failing the mfn_is_ram() check.)
>>
>> What am I doing wrong here?
> Mmm, I don't think anything you're doing is wrong. Notice the comment:
>
> static long system_ram_end_mfn;
> int mfn_is_ram(unsigned long mfn)
> {
> /* very crude check if a given MFN is memory or not. Probably should
> * make this a little more sophisticated ;) */
> return (mfn<= system_ram_end_mfn) ? 1 : 0;
> }
>
> Do you have more than 4GiB memory, i.e. 0xfed40000 is actually between
> two RAM areas? In such case mfn_is_ram has to really get more
> sophisticated.
>
> (In the interim you could just comment the mfn_is_ram() test from
> do_ioremap to make things work)
>
> Samuel
[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 2518 bytes --]
[-- Attachment #2: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Using mini-os ioremap()
2011-01-06 17:00 ` Matthew Fioravante
@ 2011-01-06 17:19 ` Samuel Thibault
0 siblings, 0 replies; 4+ messages in thread
From: Samuel Thibault @ 2011-01-06 17:19 UTC (permalink / raw)
To: Matthew Fioravante; +Cc: Rolf Neugebauer, xen-devel
Matthew Fioravante, le Thu 06 Jan 2011 12:00:04 -0500, a écrit :
> My box doesn't have more than 4GB. I've tried this on 32 bit and 64 bit.
How much does it have? Could you post the memory map recorded in xm
dmesg?
> I tried nuking the mfn_is_ram check. When I do that the call returns a
> virtual memory address but when I try to read and write to it, it
> appears to act just like a normal page of memory and not the device.
Mmm... I wonder how that can be possible if your address is really an IO
area.
> Does anyone know offhand of a mini-os project that either tested the
> ioremap() call or actually does some memory mapped io operations?
It was implemeted by Rolf Neugebauer <rolf.neugebauer@netronome.com>,
Cc-ed.
Samuel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-01-06 17:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-05 19:24 Using mini-os ioremap() Matthew Fioravante
2011-01-05 22:55 ` Samuel Thibault
2011-01-06 17:00 ` Matthew Fioravante
2011-01-06 17:19 ` Samuel Thibault
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.