Skip to content

Commit 5bacdc0

Browse files
Benjamin Thielsuryasaimadhu
authored andcommitted
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 <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 860f89e commit 5bacdc0

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

arch/x86/include/asm/set_memory.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ int set_memory_4k(unsigned long addr, int numpages);
4646
int set_memory_encrypted(unsigned long addr, int numpages);
4747
int set_memory_decrypted(unsigned long addr, int numpages);
4848
int set_memory_np_noalias(unsigned long addr, int numpages);
49+
int set_memory_nonglobal(unsigned long addr, int numpages);
50+
int set_memory_global(unsigned long addr, int numpages);
4951

5052
int set_pages_array_uc(struct page **pages, int addrinarray);
5153
int set_pages_array_wc(struct page **pages, int addrinarray);

arch/x86/mm/pat/set_memory.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <linux/gfp.h>
1616
#include <linux/pci.h>
1717
#include <linux/vmalloc.h>
18+
#include <linux/libnvdimm.h>
1819

1920
#include <asm/e820/api.h>
2021
#include <asm/processor.h>
@@ -304,11 +305,13 @@ void clflush_cache_range(void *vaddr, unsigned int size)
304305
}
305306
EXPORT_SYMBOL_GPL(clflush_cache_range);
306307

308+
#ifdef CONFIG_ARCH_HAS_PMEM_API
307309
void arch_invalidate_pmem(void *addr, size_t size)
308310
{
309311
clflush_cache_range(addr, size);
310312
}
311313
EXPORT_SYMBOL_GPL(arch_invalidate_pmem);
314+
#endif
312315

313316
static void __cpa_flush_all(void *arg)
314317
{

arch/x86/mm/pti.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include <asm/tlbflush.h>
4040
#include <asm/desc.h>
4141
#include <asm/sections.h>
42+
#include <asm/set_memory.h>
4243

4344
#undef pr_fmt
4445
#define pr_fmt(fmt) "Kernel/User page tables isolation: " fmt
@@ -554,13 +555,6 @@ static inline bool pti_kernel_image_global_ok(void)
554555
return true;
555556
}
556557

557-
/*
558-
* This is the only user for these and it is not arch-generic
559-
* like the other set_memory.h functions. Just extern them.
560-
*/
561-
extern int set_memory_nonglobal(unsigned long addr, int numpages);
562-
extern int set_memory_global(unsigned long addr, int numpages);
563-
564558
/*
565559
* For some configurations, map all of kernel text into the user page
566560
* tables. This reduces TLB misses, especially on non-PCID systems.

0 commit comments

Comments
 (0)