Skip to contentSkip to conversation

Abusing region 0

DISCUSSION Menyhart, Zoltan 3 participants 3 messages Feb 3, 2005

lore
Share & tools
lore
#0 lore raw

I am going to do some experiments: I am going to map some of the virtual address ranges of a process into the address space of another one. They are real 64 bit processes, i.e. the region 0 is not used. Can I abuse this region 0 for mapping the addresses of the neighbor process into this region ? E.g. if process A has got an address at 0x6000000000001000, then I am going to map it for B at address 0x0000000000001000 ? Wont anything break ?

(I need this trick because the source address can correspond to anything, like initialized data, BSS, anonymous allocation, etc, i.e. some SHM just wont work.)

Any advice will be appreciated.

Zoltan Menyhart

#1 lore raw
Quoted 8 lines · Zoltan

I am going to do some experiments: I am going to map some of the virtual address ranges of a process into the address space of another one. They are real 64 bit processes, i.e. the region 0 is not used. Can I abuse this region 0 for mapping the addresses of the neighbor process into this region ? E.g. if process A has got an address at 0x6000000000001000, then I am going to map it for B at address 0x0000000000001000 ? Wont anything break ?

Quoted 5 lines

(I need this trick because the source address can correspond to anything, like initialized data, BSS, anonymous allocation, etc, i.e. some SHM just wont work.)

Any advice will be appreciated.

FWIW, I have done the same thing that you are trying except that I used address 0x0000000010000000 instead of 0x0000000000001000. No problems.

Quoted 8 lines

Zoltan Menyhart

-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 4 lines
Thanks

Jack Steiner ([email protected])          651-683-5302
Principal Engineer                      SGI - Silicon Graphics, Inc.
#2 lore raw
In reply to Menyhart, Zoltan
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Zoltan

Zoltan> I am going to do some experiments: I am going to map some of Zoltan> the virtual address ranges of a process into the address Zoltan> space of another one. They are real 64 bit processes, Zoltan> i.e. the region 0 is not used. Can I abuse this region 0 Zoltan> for mapping the addresses of the neighbor process into this Zoltan> region ? E.g. if process A has got an address at Zoltan> 0x6000000000001000, then I am going to map it for B at Zoltan> address 0x0000000000001000 ? Wont anything break ?

Zoltan> (I need this trick because the source address can correspond Zoltan> to anything, like initialized data, BSS, anonymous Zoltan> allocation, etc, i.e. some SHM just wont work.)

Zoltan> Any advice will be appreciated.

Yes, you can do this. There is nothing special about region 0 as far as the kernel is concerned. Well, I'm lying: the one thing that's special is that there is a NaT page mapped at address 0 to catch speculative accesses through a NULL-pointer. Because of that, I'd recommend to use an address greater than 64KB (the largest base page-size supported by Linux).

	--david