Re: Fpage mapping in L4 Pistachio

Espen Skoglund <[email protected]>
Newsgroups gmane.comp.micro-kernel.l4.l4ka.general
Message-ID <[email protected]>
[Katsumi Maruyama]
> $B#D#e#a#r!!#s#i#r!'(B
> For inter-process data copying,
> I am using Flex page mapping conveniently.

> However, I noticed copy failure when the Fpage is large.

> My program outline is as follows:
> (Code is only explanatory, not real one)

> Let me call the mapping side process as Mapper,
> and mapped side process as Mappee.

> ==== (1) Mappee ==================

> (1-1) Receive window
> Fpage:
> mappeefpage: L4_Fpage(0x40000000, 0x100000)
> i.e. 1 mega bytes recv window from 1 Giga

> ==== (2) Mapper ===================

> (2-1) Buffer to send/receive data
> char xbuf[XSIZE];
> // This buffer happened being allocated at 0xA26820.

> The Flex page which cover this buffer is used for mapping.
> strncpy() is used for string copying.


> ====== (3) Situation ========

> (3-1) WHEN XSIZE <= 6112: No problem

> Fpage of Mapper:
> mapperfpage: L4_Fpage(0xA26000, 0x2000) with R/W permissions

> MapItem:
> mapitem: L4_MapItem(mapperfpage, 0)
> i.e. send-base is 0.

> Fpage is mapped, and data is rightly copyed from Mappee to Mapper.

>From mapper to mappee you mean, right?

And the xbuf[] array is accessible at address 0x40000820 of mappee.
BTW, saying "copied" here can be confusing.  Copying and mapping are
not the same thing.


> (3-2) WHEN XSIZE > 6112: COPY FAILED

> Fpage of Mapper:
> mapperfpage: L4_Fpage(0xA20000, 0x10000) with R/W permissions
> // To cover the buffer, Fpage becomes large !
> // as the buffer happened to be at 0xA26820 !
> MapItem:
> mapitem: L4_MapItem(mapperfpage, 0)
> i.e. send-base is 0.

And the xbuf[] array should now be accessible at address 0x40006820 of
mappee.  Is this not happening?

> ==> NO DATA COPIED.

> ( Cf. 0xA26820 + 6112 == 0xA28000.
> &xbuf[6112] is 0xA28000)

> ===== (4) Question ======

> Am I misunderstanding the fpage mapping usage, or
> are there some restriction or limitation in L4 flex page mapping ?

I don't know if you misunderstood it because I don't know what you
expect to happen.  The limitation of mapping is that pages not present
in the mapper will (obviously) not be mapped to the mappee.  Also,
mapper can not map its own KIP or UTCB memory, and mappee can not
receive mappings in its own KIP and UTCB memory.

	eSk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.