Fixing powerpc64 /boot/loader's kernel page handing: suggestions?

Mark Millard markmi at dsl-only.net
Thu Feb 19 11:38:50 UTC 2015


Nathan W wrote:

> Thanks for diagnosing this! The syncicache spans the whole kernel out of 
> laziness. As you note, it isn't appropriate. If there are more instances 
> of this kind of thing, then it might make sense to try to make ld emit 
> only one PT_LOAD program section as a long-term solution. I'll look into 
> that soon.
> -Nathan

In https://lists.freebsd.org/pipermail/freebsd-ppc/2015-February/007415.html I reported that I had accidentally caused the existence of the unreferenced pages via a .align that was larger than a page: I typed the target number instead of its power of 2. It was only "luck" that my prior builds had been close to the large .align boundary and so happened to not get any extra pages from the mistake.

Without this oddity in the .align only one PT_LOAD is present in any of my builds.

But with the oddity such breaks can cause multiple PT_LOAD's to be generated with holes between them.

As stands there is an implicit rule that no pages can be wasted: no holes that contain a full page or more are allowed. But any holes that include such have non-obvious behavior and failure at a very early stage where it is messy to figure out what happened.

An alternate for the issue of "holes" might be a message reporting the issue as a reason why the load/boot will be rejected --sort of like detecting and reporting other types of problems with using a messed-up file as a kernel. May be even just reporting whenever there is more than one PT_LOAD even if no pages would make a hole.

Then the issue of avoiding isync'ing memory regions that are not appropriate would be an independent point that still could be addressed on its own.


===
Mark Millard
markmi at dsl-only.net



More information about the freebsd-ppc mailing list