Work-around race condition with heap management.
Work-around race condition with heap management.

    Previously, when we map a page into a high virtual address we
    unmap that same page from the low heap address range (by
    setting the permissions to NO_ACCESS).  This commit changes
    the behavior to only prevent writes to the heap range by
    setting the permissions to READ_ONLY.

    The heap management code uses atomic instructions to manage a
    stack of free pages (see PageManager::allocatePage).  There
    was a race condition where two threads would both be allocating
    a page at the same time; one of which was a kernel thread
    fulfilling a VMM exception by allocating a page.  Due to the
    way Simics emulates hardware threads, by the time the other
    thread executed the load instruction to find Head->Next of the
    free page stack, the permissions were already changed on the
    page containing Head, such that the load would fail with a
    data storage exception.

    There were a few other possible changes proposed for this fix
    and this seemed like the most straight-forward.  Others were:
        1) Change heap management to not have the stack nodes on
	   the pages themselves but allocate a separate set of
	   nodes.  This would cause a large re-write to the PageMgr.

	2) Identify the data storage exception and interrogate the
	   corresponding instruction address that raised the
	   instruction.  If the instruction was in PageManager,
	   treat it as a spurious instruction, advance the NIP, and
	   continue execution.

    The change to READ_ONLY instead of NO_ACCESS should have little
    impact.  The original intent of using NO_ACCESS was to better
    catch bad address and buffer overrun bugs.  In most cases, the
    erroring code is going to attempt a write to the bad address, so
    this situation will still be caught.  Since there is a single
    address space, this feature was mostly to detect bad code writing
    on top of instructions, which READ_ONLY will still detect.

Change-Id: I454f2fd51aeea55592e4fe3b8969f7667d7e97a6
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/605
Tested-by: Jenkins Server
Reviewed-by: Douglas R. Gilbert <54dff2264884c355ed5584a3b7f1530b4b26921e@us.ibm.com>
Reviewed-by: Daniel M. Crowell <912029ca9254ac7b5854e56910561d682e1fa2d0@us.ibm.com>
Reviewed-by: MATTHEW S. BARTH <76a4069b1098781bef2e2b6fa2d90fe40aa24503@us.ibm.com>

Over-enthusiastic/hostboot,open-power/hostboot,csmart/hostboot,open-power/hostboot,alvintpwang/hostboot,Over-enthusiastic/hostboot,alvintpwang/hostboot,open-power/hostboot,alvintpwang/hostboot,alvintpwang/hostboot,csmart/hostboot,Over-enthusiastic/hostboot,csmart/hostboot,open-power/hostboot,Over-enthusiastic/hostboot,open-power/hostboot,alvintpwang/hostboot,Over-enthusiastic/hostboot,csmart/hostboot,csmart/hostboot