• Konrad Rzeszutek Wilk's avatar
    xen/pat: Disable PAT support for now. · 8eaffa67
    Konrad Rzeszutek Wilk authored
    [Pls also look at https://lkml.org/lkml/2012/2/10/228]
    
    Using of PAT to change pages from WB to WC works quite nicely.
    Changing it back to WB - not so much. The crux of the matter is
    that the code that does this (__page_change_att_set_clr) has only
    limited information so when it tries to the change it gets
    the "raw" unfiltered information instead of the properly filtered one -
    and the "raw" one tell it that PSE bit is on (while infact it
    is not).  As a result when the PTE is set to be WB from WC, we get
    tons of:
    
    :WARNING: at arch/x86/xen/mmu.c:475 xen_make_pte+0x67/0xa0()
    :Hardware name: HP xw4400 Workstation
    .. snip..
    :Pid: 27, comm: kswapd0 Tainted: G        W    3.2.2-1.fc16.x86_64 #1
    :Call Trace:
    : [<ffffffff8106dd1f>] warn_slowpath_common+0x7f/0xc0
    : [<ffffffff8106dd7a>] warn_slowpath_null+0x1a/0x20
    : [<ffffffff81005a17>] xen_make_pte+0x67/0xa0
    : [<ffffffff810051bd>] __raw_callee_save_xen_make_pte+0x11/0x1e
    : [<ffffffff81040e15>] ? __change_page_attr_set_clr+0x9d5/0xc00
    : [<ffffffff8114c2e8>] ? __purge_vmap_area_lazy+0x158/0x1d0
    : [<ffffffff8114cca5>] ? vm_unmap_aliases+0x175/0x190
    : [<ffffffff81041168>] change_page_attr_set_clr+0x128/0x4c0
    : [<ffffffff81041542>] set_pages_array_wb+0x42/0xa0
    : [<ffffffff8100a9b2>] ? check_events+0x12/0x20
    : [<ffffffffa0074d4c>] ttm_pages_put+0x1c/0x70 [ttm]
    : [<ffffffffa0074e98>] ttm_page_pool_free+0xf8/0x180 [ttm]
    : [<ffffffffa0074f78>] ttm_pool_mm_shrink+0x58/0x90 [ttm]
    : [<ffffffff8112ba04>] shrink_slab+0x154/0x310
    : [<ffffffff8112f17a>] balance_pgdat+0x4fa/0x6c0
    : [<ffffffff8112f4b8>] kswapd+0x178/0x3d0
    : [<ffffffff815df134>] ? __schedule+0x3d4/0x8c0
    : [<ffffffff81090410>] ? remove_wait_queue+0x50/0x50
    : [<ffffffff8112f340>] ? balance_pgdat+0x6c0/0x6c0
    : [<ffffffff8108fb6c>] kthread+0x8c/0xa0
    
    for every page. The proper fix for this is has been posted
    and is https://lkml.org/lkml/2012/2/10/228
    "x86/cpa: Use pte_attrs instead of pte_flags on CPA/set_p.._wb/wc operations."
    along with a detailed description of the problem and solution.
    
    But since that posting has gone nowhere I am proposing
    this band-aid solution so that at least users don't get
    the page corruption (the pages that are WC don't get changed to WB
    and end up being recycled for filesystem or other things causing
    mysterious crashes).
    
    The negative impact of this patch is that users of WC flag
    (which are InfiniBand, radeon, nouveau drivers) won't be able
    to set that flag - so they are going to see performance degradation.
    But stability is more important here.
    
    Fixes RH BZ# 742032, 787403, and 745574
    Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    8eaffa67
enlighten.c 32.9 KB