Skip to content
  • Toshi Kani's avatar
    x86/mm/pat: Extend set_page_memtype() to support Write-Through type · 35a5a104
    Toshi Kani authored
    
    
    As set_memory_wb() calls free_ram_pages_type(), which then calls
    set_page_memtype() with -1, _PGMT_DEFAULT is used for tracking
    the WB type. _PGMT_WB is defined but unused. Thus, rename
    _PGMT_DEFAULT to _PGMT_WB to clarify the usage, and release the
    slot used by _PGMT_WB.
    
    Furthermore, change free_ram_pages_type() to call
    set_page_memtype() with _PGMT_WB, and get_page_memtype() to
    return _PAGE_CACHE_MODE_WB for _PGMT_WB.
    
    Then, define _PGMT_WT in the freed slot. This allows
    set_page_memtype() to track the WT type.
    
    Signed-off-by: default avatarToshi Kani <toshi.kani@hp.com>
    Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: Andy Lutomirski <luto@amacapital.net>
    Cc: Elliott@hp.com
    Cc: H. Peter Anvin <hpa@zytor.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Luis R. Rodriguez <mcgrof@suse.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: arnd@arndb.de
    Cc: hch@lst.de
    Cc: hmh@hmh.eng.br
    Cc: jgross@suse.com
    Cc: konrad.wilk@oracle.com
    Cc: linux-mm <linux-mm@kvack.org>
    Cc: linux-nvdimm@lists.01.org
    Cc: stefan.bader@canonical.com
    Cc: yigal@plexistor.com
    Link: http://lkml.kernel.org/r/1433436928-31903-12-git-send-email-bp@alien8.de
    
    
    Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
    35a5a104