mirror of https://gitee.com/openkylin/linux.git
x86/mm/set_memory: Fix -Wmissing-prototypes warnings
Add missing includes and move prototypes into the header set_memory.h in order to fix -Wmissing-prototypes warnings. [ bp: Add ifdeffery around arch_invalidate_pmem() ] Signed-off-by: Benjamin Thiel <b.thiel@posteo.de> Signed-off-by: Borislav Petkov <bp@suse.de> Link: https://lkml.kernel.org/r/20200320145028.6013-1-b.thiel@posteo.de
This commit is contained in:
parent
860f89e618
commit
5bacdc0982
|
@ -46,6 +46,8 @@ int set_memory_4k(unsigned long addr, int numpages);
|
||||||
int set_memory_encrypted(unsigned long addr, int numpages);
|
int set_memory_encrypted(unsigned long addr, int numpages);
|
||||||
int set_memory_decrypted(unsigned long addr, int numpages);
|
int set_memory_decrypted(unsigned long addr, int numpages);
|
||||||
int set_memory_np_noalias(unsigned long addr, int numpages);
|
int set_memory_np_noalias(unsigned long addr, int numpages);
|
||||||
|
int set_memory_nonglobal(unsigned long addr, int numpages);
|
||||||
|
int set_memory_global(unsigned long addr, int numpages);
|
||||||
|
|
||||||
int set_pages_array_uc(struct page **pages, int addrinarray);
|
int set_pages_array_uc(struct page **pages, int addrinarray);
|
||||||
int set_pages_array_wc(struct page **pages, int addrinarray);
|
int set_pages_array_wc(struct page **pages, int addrinarray);
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include <linux/gfp.h>
|
#include <linux/gfp.h>
|
||||||
#include <linux/pci.h>
|
#include <linux/pci.h>
|
||||||
#include <linux/vmalloc.h>
|
#include <linux/vmalloc.h>
|
||||||
|
#include <linux/libnvdimm.h>
|
||||||
|
|
||||||
#include <asm/e820/api.h>
|
#include <asm/e820/api.h>
|
||||||
#include <asm/processor.h>
|
#include <asm/processor.h>
|
||||||
|
@ -304,11 +305,13 @@ void clflush_cache_range(void *vaddr, unsigned int size)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(clflush_cache_range);
|
EXPORT_SYMBOL_GPL(clflush_cache_range);
|
||||||
|
|
||||||
|
#ifdef CONFIG_ARCH_HAS_PMEM_API
|
||||||
void arch_invalidate_pmem(void *addr, size_t size)
|
void arch_invalidate_pmem(void *addr, size_t size)
|
||||||
{
|
{
|
||||||
clflush_cache_range(addr, size);
|
clflush_cache_range(addr, size);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(arch_invalidate_pmem);
|
EXPORT_SYMBOL_GPL(arch_invalidate_pmem);
|
||||||
|
#endif
|
||||||
|
|
||||||
static void __cpa_flush_all(void *arg)
|
static void __cpa_flush_all(void *arg)
|
||||||
{
|
{
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
#include <asm/tlbflush.h>
|
#include <asm/tlbflush.h>
|
||||||
#include <asm/desc.h>
|
#include <asm/desc.h>
|
||||||
#include <asm/sections.h>
|
#include <asm/sections.h>
|
||||||
|
#include <asm/set_memory.h>
|
||||||
|
|
||||||
#undef pr_fmt
|
#undef pr_fmt
|
||||||
#define pr_fmt(fmt) "Kernel/User page tables isolation: " fmt
|
#define pr_fmt(fmt) "Kernel/User page tables isolation: " fmt
|
||||||
|
@ -554,13 +555,6 @@ static inline bool pti_kernel_image_global_ok(void)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* This is the only user for these and it is not arch-generic
|
|
||||||
* like the other set_memory.h functions. Just extern them.
|
|
||||||
*/
|
|
||||||
extern int set_memory_nonglobal(unsigned long addr, int numpages);
|
|
||||||
extern int set_memory_global(unsigned long addr, int numpages);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For some configurations, map all of kernel text into the user page
|
* For some configurations, map all of kernel text into the user page
|
||||||
* tables. This reduces TLB misses, especially on non-PCID systems.
|
* tables. This reduces TLB misses, especially on non-PCID systems.
|
||||||
|
|
Loading…
Reference in New Issue