• J
    KVM: arm/arm64: add WARN_ON if size is not PAGE_SIZE aligned in unmap_stage2_range · 47a91b72
    Jia He 提交于
    There is a panic in armv8a server(QDF2400) under memory pressure tests
    (start 20 guests and run memhog in the host).
    
    ---------------------------------begin--------------------------------
    [35380.800950] BUG: Bad page state in process qemu-kvm  pfn:dd0b6
    [35380.805825] page:ffff7fe003742d80 count:-4871 mapcount:-2126053375
    mapping:          (null) index:0x0
    [35380.815024] flags: 0x1fffc00000000000()
    [35380.818845] raw: 1fffc00000000000 0000000000000000 0000000000000000
    ffffecf981470000
    [35380.826569] raw: dead000000000100 dead000000000200 ffff8017c001c000
    0000000000000000
    [35380.805825] page:ffff7fe003742d80 count:-4871 mapcount:-2126053375
    mapping:          (null) index:0x0
    [35380.815024] flags: 0x1fffc00000000000()
    [35380.818845] raw: 1fffc00000000000 0000000000000000 0000000000000000
    ffffecf981470000
    [35380.826569] raw: dead000000000100 dead000000000200 ffff8017c001c000
    0000000000000000
    [35380.834294] page dumped because: nonzero _refcount
    [...]
    --------------------------------end--------------------------------------
    
    The root cause might be what was fixed at [1]. But from the KVM points of
    view, it would be better if the issue was caught earlier.
    
    If the size is not PAGE_SIZE aligned, unmap_stage2_range might unmap the
    wrong(more or less) page range. Hence it caused the "BUG: Bad page
    state"
    
    Let's WARN in that case, so that the issue is obvious.
    
    [1] https://lkml.org/lkml/2018/5/3/1042Reviewed-by: NSuzuki K Poulose <suzuki.poulose@arm.com>
    Signed-off-by: jia.he@hxt-semitech.com
    [maz: tidied up commit message]
    Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
    47a91b72
mmu.c 56.3 KB