On Fri, 09 Oct 2009 16:09:27 +0100, nathan binkert <[email protected]> wrote:
> We have a memsetBlob function. Can you use that instead of allocating > a page, zeroing it and then doing a write? > Yes, sorry, I wasn't aware of that, but I'll fix it. > Do you actually see unaligned pages? Shouldn't we just align the > increment value to the next page boundary. > Yes, unfortunately I was seeing these in the test Hello World program that I included. The brk point is changed through this sequence: a) 0x10099000 (initial value) b) 0x10099CBC c) 0x100BACBC d) 0x100BB000 So sometimes it ends up in the middle of the page. > It seems to me that you need to use the chunk generator or some > looping construct to loop over all of the pages that may have been > allocated and check each individual page to make sure that they are > all zeroed (because the brk can be incremented by many pages.) > That's what I was trying to achieve with the patch. If the simulator allocates the page then it is full of zeros anyway. If the page already exists then I need to fill it. Going from b) to c) above I need to zero out the top of page 0x10099000, but not the whole page or I could obviously wipe out some of the application's data. However, I can't cross a page boundary because I might then try to write to an unallocated page. I can split this into two loops if you'd prefer - the original that allocates pages and a second that zeros them out? Cheers Tim -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. _______________________________________________ m5-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/m5-dev
