On Fri, Jan 08, 2010 at 01:41:40AM +0100, Jean-Yves Migeon wrote: > Hi, > > Jeremy kindly posted [1] different patches to enable PAE, as well as the > NX bit, when possible. > > I just finished porting Jeremy's patches to current, and I'd like to > commit a tiny fraction of it: mainly fixes in UVM code where there is a > risk of unwanted (but IMHO harmless) overflows when shifting bits from > frame numbers to addresses. > > Patch is attached, or available here [2]. > > It was compile tested for amd64, and compile+boot tested for i386. > > Explanations: > - printfs using PRIxADDR instead of hardcoding long types in format > - ptoa() => ctob() + cast to uint64_t (when necessary) for integer > values that could be higher than 1M, risking truncation when casted to > vaddr_t via ptoa().
I think the rlimit part is still wrong. rlim_cur is a int, so storing a 64bit value, possibly larger than 4Gb in a 32bit int will cause trouble. In this case the overflow needs to be detected and a sensible value needs to be used instead. Otherwise, you may end up with a very low RSS limit preventing userland from running. -- Manuel Bouyer <[email protected]> NetBSD: 26 ans d'experience feront toujours la difference --
