|
From: Tom H. <to...@co...> - 2005-07-31 15:17:37
|
Does anybody know why we map the whole of the shadow space at startup using PROT_NONE and then just change the protection on pages as they are required rather than just allocating them as required? Tom -- Tom Hughes (to...@co...) http://www.compton.nu/ |
|
From: Nicholas N. <nj...@cs...> - 2005-07-31 19:20:22
|
On Sun, 31 Jul 2005, Tom Hughes wrote: > Does anybody know why we map the whole of the shadow space at startup > using PROT_NONE and then just change the protection on pages as they > are required rather than just allocating them as required? Isn't it to prevent anything else being put in the shadow memory area? N |
|
From: Tom H. <to...@co...> - 2005-07-31 20:04:41
|
In message <Pin...@ch...>
Nicholas Nethercote <nj...@cs...> wrote:
> On Sun, 31 Jul 2005, Tom Hughes wrote:
>
> > Does anybody know why we map the whole of the shadow space at startup
> > using PROT_NONE and then just change the protection on pages as they
> > are required rather than just allocating them as required?
>
> Isn't it to prevent anything else being put in the shadow memory area?
Maybe, but the address space manager already forces all memory mappings
to a fixed address inside the client address space anyway.
The valgrind part of the address space (above the shadow space) is not
protected in the same way, and we don't have any problems with client
mappings widing up there.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|
|
From: Nicholas N. <nj...@cs...> - 2005-08-01 15:38:04
|
On Sun, 31 Jul 2005, Tom Hughes wrote: >>> Does anybody know why we map the whole of the shadow space at startup >>> using PROT_NONE and then just change the protection on pages as they >>> are required rather than just allocating them as required? >> >> Isn't it to prevent anything else being put in the shadow memory area? > > Maybe, but the address space manager already forces all memory mappings > to a fixed address inside the client address space anyway. > > The valgrind part of the address space (above the shadow space) is not > protected in the same way, and we don't have any problems with client > mappings widing up there. Have you tried taking it out to see what happens? Jeremy should know why it's done this way, but he's been very quiet lately... Jeremy, are you still out there? N |
|
From: Tom H. <to...@co...> - 2005-08-01 18:00:53
Attachments:
valgrind-nobigbang.patch
|
In message <Pin...@ch...>
Nicholas Nethercote <nj...@cs...> wrote:
> On Sun, 31 Jul 2005, Tom Hughes wrote:
>
> >>> Does anybody know why we map the whole of the shadow space at startup
> >>> using PROT_NONE and then just change the protection on pages as they
> >>> are required rather than just allocating them as required?
> >>
> >> Isn't it to prevent anything else being put in the shadow memory area?
> >
> > Maybe, but the address space manager already forces all memory mappings
> > to a fixed address inside the client address space anyway.
> >
> > The valgrind part of the address space (above the shadow space) is not
> > protected in the same way, and we don't have any problems with client
> > mappings widing up there.
>
> Have you tried taking it out to see what happens?
Just tried it and everything works fine - the patch is attached if
anybody else wants to try it.
> Jeremy should know why it's done this way, but he's been very quiet
> lately... Jeremy, are you still out there?
I think I may have worked it out - there was a scheme to have tools
just access pages rather than explicitly allocating them and the core
then caught the signal and initialised them if necessary. That is why
it is all allocated up front.
That system was never used (although the 2.4 line has the core code
to support it) and seems to have been removed in the 3.0 code.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|