[lkml]   [2010]   [Dec]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[PATCH 08/10] xen/mmu: Bugfix. Fill the top entry page with appropriate middle layer pointers.
    If we swapped over from using an p2m_mid_identical to p2m_mid_missing
    (earlier call to set_phys_to_machine) and then started going through the
    PFNs in descending order to program a new MFN (balloon worker), we would
    end up in this code path. At that point we would set up new page filled with
    pointers to p2m_identity instead of p2m_missing. This had the disastrous
    effect that get_phys_to_machine on that PFN would return an 1-1 mapping
    instead of INVALID_P2M_ENTRY resulting in hitting a BUG check in balloon driver.

    Signed-off-by: Konrad Rzeszutek Wilk <>
    arch/x86/xen/mmu.c | 5 ++++-
    1 files changed, 4 insertions(+), 1 deletions(-)

    diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
    index 92f4fec..a917439 100644
    --- a/arch/x86/xen/mmu.c
    +++ b/arch/x86/xen/mmu.c
    @@ -480,7 +480,10 @@ static bool alloc_p2m(unsigned long pfn)
    if (!mid)
    return false;

    - p2m_mid_init(mid, p2m_identity);
    + if (mid == p2m_mid_identity)
    + p2m_mid_init(mid, p2m_identity);
    + else
    + p2m_mid_init(mid, p2m_missing);

    if (cmpxchg(top_p, mid_orig, mid) != mid_orig)

     \ /
      Last update: 2010-12-21 22:41    [W:0.018 / U:31.716 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site