@@ -21,4 +21,6 @@ int io_reserve_memtype(resource_size_t start, resource_size_t end,
void io_free_memtype(resource_size_t start, resource_size_t end);
+enum page_cache_mode lookup_memtype(u64 paddr);
+
#endif /* _ASM_X86_PAT_H */
@@ -650,7 +650,7 @@ int free_memtype(u64 start, u64 end)
* Returns _PAGE_CACHE_MODE_WB, _PAGE_CACHE_MODE_WC, _PAGE_CACHE_MODE_UC_MINUS
* or _PAGE_CACHE_MODE_WT.
*/
-static enum page_cache_mode lookup_memtype(u64 paddr)
+enum page_cache_mode lookup_memtype(u64 paddr)
{
enum page_cache_mode rettype = _PAGE_CACHE_MODE_WB;
struct memtype *entry;
@@ -676,6 +676,7 @@ static enum page_cache_mode lookup_memtype(u64 paddr)
spin_unlock(&memtype_lock);
return rettype;
}
+EXPORT_SYMBOL_GPL(lookup_memtype);
/**
* io_reserve_memtype - Request a memory type mapping for a region of memory
KVM MMU will use it to get the cache mode of the host page. Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com> --- arch/x86/include/asm/pat.h | 2 ++ arch/x86/mm/pat.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-)