lkml.org 
[lkml]   [2011]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 04/11] xen/mmu: BUG_ON when racing to swap middle leaf.
    Date
    The initial bootup code uses set_phys_to_machine quite a lot, and after
    bootup it would be used by the balloon driver. The balloon driver does have
    mutex lock so this should not be necessary - but just in case, add
    a BUG_ON if we do hit this scenario.

    [v2: Change from WARN to BUG_ON]
    [v3: Rebased on top of xen->p2m code split]
    Reviewed-by: Ian Campbell <Ian.Campbell@eu.citrix.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    ---
    arch/x86/xen/p2m.c | 3 ++-
    1 files changed, 2 insertions(+), 1 deletions(-)

    diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
    index 19b0a65..fbbd2ab 100644
    --- a/arch/x86/xen/p2m.c
    +++ b/arch/x86/xen/p2m.c
    @@ -478,7 +478,8 @@ bool __set_phys_to_machine(unsigned long pfn, unsigned long mfn)

    /* Swap over from MISSING to IDENTITY if needed. */
    if (p2m_top[topidx][mididx] == p2m_missing) {
    - p2m_top[topidx][mididx] = p2m_identity;
    + BUG_ON(cmpxchg(&p2m_top[topidx][mididx], p2m_missing,
    + p2m_identity) != p2m_missing);
    return true;
    }
    }
    --
    1.7.1


    \
     
     \ /
      Last update: 2011-02-01 00:13    [W:3.177 / U:0.488 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site