Skip to contentSkip to conversation

set_memory_* functions header refactor

PATCH Superseded Laura Abbott 11 participants 33 messages Mar 2, 2017 – Mar 5, 2017

Subsystems (30)
DRM drivers Arm (32-bit) x86 Sound +26 more subsystems

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover set_memory_* functions header refactor

Hi,

This is v2 of my proposal to move set_memory_* function prototypes out of cacheflush.h and into their own header file. This came out of a comment Russell made while reviewing RODATA test cases
http://lists.infradead.org/pipermail/linux-arm-kernel/2017-January/480855.html
While the final result of that series was the rodata code was refactored into its own header file, the set_memory_* APIs are still out of place.

This version refactored the common set_memory_* functions into an asm-generic header. s390x added some features so it can't just use the asm-generic header. I debated how much more to try and shove into the asm-generic version (e.g. stub prototypes for the ARM nommu case, set_kernel_text_*) but decided to stick with just the basics for this version.

I split out the cacheflush.h -> set_memory.h conversions into separate patches to hopefully make merging easier. Worst case, the final patch to completely separate the two can be delayed if there are more problems found. I'd like for this to eventually go through the -mm tree so I'd like Acks where appropriate.

As always, feedback appreciated.

Thanks,
Laura

Laura Abbott (14):
treewide: Move set_memory_* functions away from cacheflush.h
arm: Use set_memory.h header
arm64: Use set_memory.h header
s390: Use set_memory.h header
x86: Use set_memory.h header
agp: Use set_memory.h header
drm: Use set_memory.h header
intel_th: Use set_memory.h header
watchdog: hpwdt: Use set_memory.h header
bpf: Use set_memory.h header
module: Use set_memory.h header
PM / hibernate: Use set_memory.h header
ALSA: hda: Use set_memory.h header
treewide: Decouple cacheflush.h and set_memory.h

 arch/arm/include/asm/cacheflush.h        | 20 --------
 arch/arm/include/asm/set_memory.h        | 32 ++++++++++++
 arch/arm/mm/pageattr.c                   |  1 +
 arch/arm/net/bpf_jit_32.c                |  2 +-
 arch/arm64/include/asm/Kbuild            |  1 +
 arch/arm64/include/asm/cacheflush.h      |  5 --
 arch/arm64/mm/pageattr.c                 |  1 +
 arch/arm64/net/bpf_jit_comp.c            |  1 +
 arch/s390/include/asm/Kbuild             |  1 +
 arch/s390/include/asm/cacheflush.h       | 34 -------------
 arch/s390/include/asm/set_memory.h       | 31 ++++++++++++
 arch/s390/kernel/ftrace.c                |  1 +
 arch/s390/kernel/kprobes.c               |  2 +-
 arch/s390/kernel/machine_kexec.c         |  1 +
 arch/s390/mm/init.c                      |  1 +
 arch/s390/mm/pageattr.c                  |  1 +
 arch/s390/mm/vmem.c                      |  1 +
 arch/s390/net/bpf_jit_comp.c             |  1 +
 arch/x86/include/asm/cacheflush.h        | 85 -------------------------------
 arch/x86/include/asm/set_memory.h        | 87 ++++++++++++++++++++++++++++++++
 arch/x86/kernel/amd_gart_64.c            |  2 +-
 arch/x86/kernel/cpu/amd.c                |  2 +-
 arch/x86/kernel/cpu/bugs.c               |  2 +-
 arch/x86/kernel/ftrace.c                 |  2 +-
 arch/x86/kernel/machine_kexec_64.c       |  1 +
 arch/x86/mm/init.c                       |  2 +-
 arch/x86/mm/init_64.c                    |  2 +-
 arch/x86/mm/ioremap.c                    |  2 +-
 arch/x86/mm/pageattr.c                   |  1 +
 arch/x86/net/bpf_jit_comp.c              |  1 +
 arch/x86/pci/pcbios.c                    |  2 +-
 arch/x86/platform/efi/efi.c              |  2 +-
 arch/x86/realmode/init.c                 |  2 +-
 drivers/char/agp/amd-k7-agp.c            |  1 +
 drivers/char/agp/ati-agp.c               |  1 +
 drivers/char/agp/generic.c               |  2 +-
 drivers/char/agp/intel-gtt.c             |  1 +
 drivers/char/agp/sworks-agp.c            |  1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c |  1 +
 drivers/gpu/drm/gma500/gtt.c             |  1 +
 drivers/gpu/drm/gma500/psb_drv.c         |  1 +
 drivers/gpu/drm/radeon/radeon_gart.c     |  1 +
 drivers/gpu/drm/ttm/ttm_page_alloc.c     |  1 +
 drivers/gpu/drm/ttm/ttm_page_alloc_dma.c |  1 +
 drivers/gpu/drm/ttm/ttm_tt.c             |  1 +
 drivers/hwtracing/intel_th/msu.c         |  2 +-
 drivers/watchdog/hpwdt.c                 |  2 +-
 include/asm-generic/set_memory.h         | 12 +++++
 include/linux/filter.h                   |  2 +-
 kernel/module.c                          |  1 +
 kernel/power/snapshot.c                  |  1 +
 sound/pci/hda/hda_intel.c                |  2 +-
 52 files changed, 206 insertions(+), 161 deletions(-)
 create mode 100644 arch/arm/include/asm/set_memory.h
 delete mode 100644 arch/s390/include/asm/cacheflush.h
 create mode 100644 arch/s390/include/asm/set_memory.h
 create mode 100644 arch/x86/include/asm/set_memory.h
 create mode 100644 include/asm-generic/set_memory.h
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/14 treewide: Move set_memory_* functions away from cacheflush.h

The set_memory_* APIs came out of a desire to have a better way to change memory attributes. Many of these attributes were linked to cache functionality so the prototypes were put in cacheflush.h. These days, the APIs have grown and have a much wider use than just cache APIs. To support this growth, split off set_memory_* and friends into a separate header file to avoid growing cacheflush.h for APIs that have nothing to do with caches.

---
 arch/arm/include/asm/cacheflush.h   | 21 +--------
 arch/arm/include/asm/set_memory.h   | 32 ++++++++++++++
 arch/arm64/include/asm/Kbuild       |  1 +
 arch/arm64/include/asm/cacheflush.h |  6 +--
 arch/s390/include/asm/cacheflush.h  | 28 +-----------
 arch/s390/include/asm/set_memory.h  | 31 +++++++++++++
 arch/x86/include/asm/cacheflush.h   | 86 +-----------------------------------
 arch/x86/include/asm/set_memory.h   | 87 +++++++++++++++++++++++++++++++++++++
 include/asm-generic/set_memory.h    | 12 +++++
 9 files changed, 167 insertions(+), 137 deletions(-)
 create mode 100644 arch/arm/include/asm/set_memory.h
 create mode 100644 arch/s390/include/asm/set_memory.h
 create mode 100644 arch/x86/include/asm/set_memory.h
 create mode 100644 include/asm-generic/set_memory.h
arch/arm/include/asm/cacheflush.h +1 -20
index 02454fa..1cb9d11 100644
@@ -16,6 +16,7 @@
 #include <asm/shmparam.h>
 #include <asm/cachetype.h>
 #include <asm/outercache.h>
+#include <asm/set_memory.h>
 
 #define CACHE_COLOUR(vaddr)	((vaddr & (SHMLBA - 1)) >> PAGE_SHIFT)
 
@@ -478,26 +479,6 @@ static inline void __sync_cache_range_r(volatile void *p, size_t size)
 	: : : "r0","r1","r2","r3","r4","r5","r6","r7", \
 	      "r9","r10","lr","memory" )
 
-#ifdef CONFIG_MMU
-int set_memory_ro(unsigned long addr, int numpages);
-int set_memory_rw(unsigned long addr, int numpages);
-int set_memory_x(unsigned long addr, int numpages);
-int set_memory_nx(unsigned long addr, int numpages);
-#else
-static inline int set_memory_ro(unsigned long addr, int numpages) { return 0; }
-static inline int set_memory_rw(unsigned long addr, int numpages) { return 0; }
-static inline int set_memory_x(unsigned long addr, int numpages) { return 0; }
-static inline int set_memory_nx(unsigned long addr, int numpages) { return 0; }
-#endif
-
-#ifdef CONFIG_STRICT_KERNEL_RWX
-void set_kernel_text_rw(void);
-void set_kernel_text_ro(void);
-#else
-static inline void set_kernel_text_rw(void) { }
-static inline void set_kernel_text_ro(void) { }
-#endif
-
 void flush_uprobe_xol_access(struct page *page, unsigned long uaddr,
 			     void *kaddr, unsigned long len);
 
arch/arm/include/asm/set_memory.h new file +32 -0
new file mode 100644
index 0000000..5aa4315
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 1999-2002 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef _ASMARM_SET_MEMORY_H
+#define _ASMARM_SET_MEMORY_H
+
+#ifdef CONFIG_MMU
+int set_memory_ro(unsigned long addr, int numpages);
+int set_memory_rw(unsigned long addr, int numpages);
+int set_memory_x(unsigned long addr, int numpages);
+int set_memory_nx(unsigned long addr, int numpages);
+#else
+static inline int set_memory_ro(unsigned long addr, int numpages) { return 0; }
+static inline int set_memory_rw(unsigned long addr, int numpages) { return 0; }
+static inline int set_memory_x(unsigned long addr, int numpages) { return 0; }
+static inline int set_memory_nx(unsigned long addr, int numpages) { return 0; }
+#endif
+
+#ifdef CONFIG_STRICT_KERNEL_RWX
+void set_kernel_text_rw(void);
+void set_kernel_text_ro(void);
+#else
+static inline void set_kernel_text_rw(void) { }
+static inline void set_kernel_text_ro(void) { }
+#endif
+
+#endif
arch/arm64/include/asm/Kbuild +1 -0
index a12f1af..e419965 100644
@@ -27,6 +27,7 @@ generic-y += preempt.h
 generic-y += resource.h
 generic-y += rwsem.h
 generic-y += segment.h
+generic-y += set_memory.h
 generic-y += sembuf.h
 generic-y += serial.h
 generic-y += shmbuf.h
arch/arm64/include/asm/cacheflush.h +1 -5
index 5a2a6ee..7db6962 100644
@@ -20,6 +20,7 @@
 #define __ASM_CACHEFLUSH_H
 
 #include <linux/mm.h>
+#include <asm/set_memory.h>
 
 /*
  * This flag is used to indicate that the page pointed to by a pte is clean
@@ -150,9 +151,4 @@ static inline void flush_cache_vunmap(unsigned long start, unsigned long end)
 {
 }
 
-int set_memory_ro(unsigned long addr, int numpages);
-int set_memory_rw(unsigned long addr, int numpages);
-int set_memory_x(unsigned long addr, int numpages);
-int set_memory_nx(unsigned long addr, int numpages);
-
 #endif
arch/s390/include/asm/cacheflush.h +1 -27
index 0499334..afe2965 100644
@@ -3,32 +3,6 @@
 
 /* Caches aren't brain-dead on the s390. */
 #include <asm-generic/cacheflush.h>
-
-#define SET_MEMORY_RO	1UL
-#define SET_MEMORY_RW	2UL
-#define SET_MEMORY_NX	4UL
-#define SET_MEMORY_X	8UL
-
-int __set_memory(unsigned long addr, int numpages, unsigned long flags);
-
-static inline int set_memory_ro(unsigned long addr, int numpages)
-{
-	return __set_memory(addr, numpages, SET_MEMORY_RO);
-}
-
-static inline int set_memory_rw(unsigned long addr, int numpages)
-{
-	return __set_memory(addr, numpages, SET_MEMORY_RW);
-}
-
-static inline int set_memory_nx(unsigned long addr, int numpages)
-{
-	return __set_memory(addr, numpages, SET_MEMORY_NX);
-}
-
-static inline int set_memory_x(unsigned long addr, int numpages)
-{
-	return __set_memory(addr, numpages, SET_MEMORY_X);
-}
+#include <asm/set_memory.h>
 
 #endif /* _S390_CACHEFLUSH_H */
arch/s390/include/asm/set_memory.h new file +31 -0
new file mode 100644
index 0000000..46a4db4
@@ -0,0 +1,31 @@
+#ifndef _ASMS390_SET_MEMORY_H
+#define _ASMS390_SET_MEMORY_H
+
+#define SET_MEMORY_RO	1UL
+#define SET_MEMORY_RW	2UL
+#define SET_MEMORY_NX	4UL
+#define SET_MEMORY_X	8UL
+
+int __set_memory(unsigned long addr, int numpages, unsigned long flags);
+
+static inline int set_memory_ro(unsigned long addr, int numpages)
+{
+	return __set_memory(addr, numpages, SET_MEMORY_RO);
+}
+
+static inline int set_memory_rw(unsigned long addr, int numpages)
+{
+	return __set_memory(addr, numpages, SET_MEMORY_RW);
+}
+
+static inline int set_memory_nx(unsigned long addr, int numpages)
+{
+	return __set_memory(addr, numpages, SET_MEMORY_NX);
+}
+
+static inline int set_memory_x(unsigned long addr, int numpages)
+{
+	return __set_memory(addr, numpages, SET_MEMORY_X);
+}
+
+#endif
arch/x86/include/asm/cacheflush.h +1 -85

95 lines not on this page · raw message

arch/x86/include/asm/set_memory.h new file +87 -0

87 lines not on this page · raw message

include/asm-generic/set_memory.h new file +12 -0
new file mode 100644
index 0000000..83e81f8
@@ -0,0 +1,12 @@
+#ifndef __ASM_SET_MEMORY_H
+#define __ASM_SET_MEMORY_H
+
+/*
+ * Functions to change memory attributes.
+ */
+int set_memory_ro(unsigned long addr, int numpages);
+int set_memory_rw(unsigned long addr, int numpages);
+int set_memory_x(unsigned long addr, int numpages);
+int set_memory_nx(unsigned long addr, int numpages);
+
+#endif
Signature · 1 line
2.7.4
maintainer Acked-by Russell King on v2 1/14
#2 lore raw

Re: [PATCHv2 01/14] treewide: Move set_memory_* functions away from cacheflush.h

Quoted 67 lines · Laura Abbott
arch/arm/include/asm/cacheflush.h +1 -20
index 02454fa..1cb9d11 100644
@@ -16,6 +16,7 @@
 #include <asm/shmparam.h>
 #include <asm/cachetype.h>
 #include <asm/outercache.h>
+#include <asm/set_memory.h>
 
 #define CACHE_COLOUR(vaddr)	((vaddr & (SHMLBA - 1)) >> PAGE_SHIFT)
 
@@ -478,26 +479,6 @@ static inline void __sync_cache_range_r(volatile void *p, size_t size)
 	: : : "r0","r1","r2","r3","r4","r5","r6","r7", \
 	      "r9","r10","lr","memory" )
 
-#ifdef CONFIG_MMU
-int set_memory_ro(unsigned long addr, int numpages);
-int set_memory_rw(unsigned long addr, int numpages);
-int set_memory_x(unsigned long addr, int numpages);
-int set_memory_nx(unsigned long addr, int numpages);
-#else
-static inline int set_memory_ro(unsigned long addr, int numpages) { return 0; }
-static inline int set_memory_rw(unsigned long addr, int numpages) { return 0; }
-static inline int set_memory_x(unsigned long addr, int numpages) { return 0; }
-static inline int set_memory_nx(unsigned long addr, int numpages) { return 0; }
-#endif
-
-#ifdef CONFIG_STRICT_KERNEL_RWX
-void set_kernel_text_rw(void);
-void set_kernel_text_ro(void);
-#else
-static inline void set_kernel_text_rw(void) { }
-static inline void set_kernel_text_ro(void) { }
-#endif
-
 void flush_uprobe_xol_access(struct page *page, unsigned long uaddr,
 			     void *kaddr, unsigned long len);
 
arch/arm/include/asm/set_memory.h new file +22 -0
new file mode 100644
index 0000000..5aa4315
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 1999-2002 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef _ASMARM_SET_MEMORY_H
+#define _ASMARM_SET_MEMORY_H
+
+#ifdef CONFIG_MMU
+int set_memory_ro(unsigned long addr, int numpages);
+int set_memory_rw(unsigned long addr, int numpages);
+int set_memory_x(unsigned long addr, int numpages);
+int set_memory_nx(unsigned long addr, int numpages);
+#else
+static inline int set_memory_ro(unsigned long addr, int numpages) { return 0; }
+static inline int set_memory_rw(unsigned long addr, int numpages) { return 0; }
+static inline int set_memory_x(unsigned long addr, int numpages) { return 0; }
+static inline int set_memory_nx(unsigned long addr, int numpages) { return 0; }
+#endif

arch/arm/include/asm/set_memory.h line 32

Quoted 10 lines
arch/arm/include/asm/set_memory.h new file +10 -0
+
+#ifdef CONFIG_STRICT_KERNEL_RWX
+void set_kernel_text_rw(void);
+void set_kernel_text_ro(void);
+#else
+static inline void set_kernel_text_rw(void) { }
+static inline void set_kernel_text_ro(void) { }
+#endif
+
+#endif

Thanks.

Signature · 7 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
reviewer Acked-by on v2 1/14
#3 lore raw

Re: [PATCHv2 01/14] treewide: Move set_memory_* functions away from cacheflush.h

In reply to Laura Abbott

arch/arm64/include/asm/Kbuild generic-y += preempt.h · line 32

Quoted 11 lines · Laura Abbott
arch/arm64/include/asm/Kbuild +1 -0
index a12f1af..e419965 100644
@@ -27,6 +27,7 @@ generic-y += preempt.h
 generic-y += resource.h
 generic-y += rwsem.h
 generic-y += segment.h
+generic-y += set_memory.h
 generic-y += sembuf.h
 generic-y += serial.h

Nit: alphabetical order, please.

Quoted 32 lines
arch/arm64/include/asm/Kbuild +0 -0
 generic-y += shmbuf.h
arch/arm64/include/asm/cacheflush.h +1 -5
index 5a2a6ee..7db6962 100644
@@ -20,6 +20,7 @@
 #define __ASM_CACHEFLUSH_H
 
 #include <linux/mm.h>
+#include <asm/set_memory.h>
 
 /*
  * This flag is used to indicate that the page pointed to by a pte is clean
@@ -150,9 +151,4 @@ static inline void flush_cache_vunmap(unsigned long start, unsigned long end)
 {
 }
 
-int set_memory_ro(unsigned long addr, int numpages);
-int set_memory_rw(unsigned long addr, int numpages);
-int set_memory_x(unsigned long addr, int numpages);
-int set_memory_nx(unsigned long addr, int numpages);
-
 #endif
include/asm-generic/set_memory.h new file +2 -0
new file mode 100644
index 0000000..83e81f8
@@ -0,0 +1,12 @@
+#ifndef __ASM_SET_MEMORY_H
+#define __ASM_SET_MEMORY_H

include/asm-generic/set_memory.h line 12

Quoted 10 lines
include/asm-generic/set_memory.h new file +10 -0
+
+/*
+ * Functions to change memory attributes.
+ */
+int set_memory_ro(unsigned long addr, int numpages);
+int set_memory_rw(unsigned long addr, int numpages);
+int set_memory_x(unsigned long addr, int numpages);
+int set_memory_nx(unsigned long addr, int numpages);
+
+#endif

Otherwise, this looks fine to me. FWIW:

Thanks,
Mark.

#4 lore raw

PATCH v2 2/14 arm: Use set_memory.h header

In reply to Laura Abbott

set_memory_* functions have moved to set_memory.h. Switch to this explicitly

---
 arch/arm/mm/pageattr.c    | 1 +
 arch/arm/net/bpf_jit_32.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
arch/arm/mm/pageattr.c +1 -0
index 3b69f26..1403cb4 100644
@@ -15,6 +15,7 @@
 
 #include <asm/pgtable.h>
 #include <asm/tlbflush.h>
+#include <asm/set_memory.h>
 
 struct page_change_data {
 	pgprot_t set_mask;
arch/arm/net/bpf_jit_32.c +1 -1
index 93d0b6d..c200910 100644
@@ -17,7 +17,7 @@
 #include <linux/slab.h>
 #include <linux/if_vlan.h>
 
-#include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 #include <asm/hwcap.h>
 #include <asm/opcodes.h>
 
Signature · 1 line
2.7.4
maintainer Acked-by Russell King on v2 2/14
#5 lore raw

Re: [PATCHv2 02/14] arm: Use set_memory.h header

Quoted 5 lines · Laura Abbott

set_memory_* functions have moved to set_memory.h. Switch to this explicitly

Thanks for doing this Laura.

Signature · 3 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
#6 lore raw

PATCH v2 3/14 arm64: Use set_memory.h header

In reply to Laura Abbott

The set_memory_* functions have moved to set_memory.h. Use that header explicitly.

---
 arch/arm64/mm/pageattr.c      | 1 +
 arch/arm64/net/bpf_jit_comp.c | 1 +
 2 files changed, 2 insertions(+)
arch/arm64/mm/pageattr.c +1 -0
index 8def55e..12ab86d 100644
@@ -18,6 +18,7 @@
 
 #include <asm/pgtable.h>
 #include <asm/tlbflush.h>
+#include <asm/set_memory.h>
 
 struct page_change_data {
 	pgprot_t set_mask;
arch/arm64/net/bpf_jit_comp.c +1 -0
index a785554..84e4a91 100644
@@ -26,6 +26,7 @@
 
 #include <asm/byteorder.h>
 #include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 #include <asm/debug-monitors.h>
 
 #include "bpf_jit.h"
Signature · 1 line
2.7.4
reviewer Acked-by on v2 3/14
#7 lore raw

Re: [PATCHv2 03/14] arm64: Use set_memory.h header

Quoted 15 lines · Laura Abbott

The set_memory_* functions have moved to set_memory.h. Use that header explicitly.

---
 arch/arm64/mm/pageattr.c      | 1 +
 arch/arm64/net/bpf_jit_comp.c | 1 +
 2 files changed, 2 insertions(+)
arch/arm64/mm/pageattr.c +0 -0
index 8def55e..12ab86d 100644

arch/arm64/mm/pageattr.c line 21

Quoted 4 lines
arch/arm64/mm/pageattr.c +1 -0
@@ -18,6 +18,7 @@
 
 #include <asm/pgtable.h>
 #include <asm/tlbflush.h>
+#include <asm/set_memory.h>

Nit: alphabetical order, please.

arch/arm64/net/bpf_jit_comp.c line 30

Quoted 13 lines
arch/arm64/mm/pageattr.c +0 -0
 struct page_change_data {
 	pgprot_t set_mask;
arch/arm64/net/bpf_jit_comp.c +1 -0
index a785554..84e4a91 100644
@@ -26,6 +26,7 @@
 
 #include <asm/byteorder.h>
 #include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 #include <asm/debug-monitors.h>

Nit: likewise.

Otherwise, this looks fine to me. FWIW:

Mark.

Quoted 5 lines
arch/arm64/net/bpf_jit_comp.c +0 -0
 #include "bpf_jit.h"
Signature · 1 line
2.7.4
#9 lore raw

PATCH v2 4/14 s390: Use set_memory.h header

In reply to Laura Abbott

set_memory_* functions have moved to set_memory.h. Switch to this explicitly

---
 arch/s390/kernel/ftrace.c        | 1 +
 arch/s390/kernel/kprobes.c       | 2 +-
 arch/s390/kernel/machine_kexec.c | 1 +
 arch/s390/mm/init.c              | 1 +
 arch/s390/mm/pageattr.c          | 1 +
 arch/s390/mm/vmem.c              | 1 +
 arch/s390/net/bpf_jit_comp.c     | 1 +
 7 files changed, 7 insertions(+), 1 deletion(-)
arch/s390/kernel/ftrace.c +1 -0
index 60a8a4e..27477f3 100644
@@ -17,6 +17,7 @@
 #include <trace/syscall.h>
 #include <asm/asm-offsets.h>
 #include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 #include "entry.h"
 
 /*
arch/s390/kernel/kprobes.c +1 -1
index 76f9eda..3d6a997 100644
@@ -31,7 +31,7 @@
 #include <linux/slab.h>
 #include <linux/hardirq.h>
 #include <linux/ftrace.h>
-#include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 #include <asm/sections.h>
 #include <linux/uaccess.h>
 #include <asm/dis.h>
arch/s390/kernel/machine_kexec.c +1 -0
index 3074c1d..ab506ef 100644
@@ -26,6 +26,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/cacheflush.h>
 #include <asm/os_info.h>
+#include <asm/set_memory.h>
 #include <asm/switch_to.h>
 
 typedef void (*relocate_kernel_t)(kimage_entry_t *, unsigned long);
arch/s390/mm/init.c +1 -0
index ee506671..ee6a1d3 100644
@@ -39,6 +39,7 @@
 #include <asm/sections.h>
 #include <asm/ctl_reg.h>
 #include <asm/sclp.h>
+#include <asm/set_memory.h>
 
 pgd_t swapper_pg_dir[PTRS_PER_PGD] __section(.bss..swapper_pg_dir);
 
arch/s390/mm/pageattr.c +1 -0
index fc5dc33..143cc9a 100644
@@ -8,6 +8,7 @@
 #include <asm/facility.h>
 #include <asm/pgtable.h>
 #include <asm/page.h>
+#include <asm/set_memory.h>
 
 static inline unsigned long sske_frame(unsigned long addr, unsigned char skey)
 {
arch/s390/mm/vmem.c +1 -0
index 60d3899..c33c94b 100644
@@ -17,6 +17,7 @@
 #include <asm/setup.h>
 #include <asm/tlbflush.h>
 #include <asm/sections.h>
+#include <asm/set_memory.h>
 
 static DEFINE_MUTEX(vmem_mutex);
 
arch/s390/net/bpf_jit_comp.c +1 -0
index 4ecf6d6..6e97a2e 100644
@@ -24,6 +24,7 @@
 #include <linux/bpf.h>
 #include <asm/cacheflush.h>
 #include <asm/dis.h>
+#include <asm/set_memory.h>
 #include "bpf_jit.h"
 
 int bpf_jit_enable __read_mostly;
Signature · 1 line
2.7.4
#10 lore raw

PATCH v2 5/14 x86: Use set_memory.h header

In reply to Laura Abbott

set_memory_* functions have moved to set_memory.h. Switch to this explicitly.

---
 arch/x86/kernel/amd_gart_64.c      | 2 +-
 arch/x86/kernel/cpu/amd.c          | 2 +-
 arch/x86/kernel/cpu/bugs.c         | 2 +-
 arch/x86/kernel/ftrace.c           | 2 +-
 arch/x86/kernel/machine_kexec_64.c | 1 +
 arch/x86/mm/init.c                 | 2 +-
 arch/x86/mm/init_64.c              | 2 +-
 arch/x86/mm/ioremap.c              | 2 +-
 arch/x86/mm/pageattr.c             | 1 +
 arch/x86/net/bpf_jit_comp.c        | 1 +
 arch/x86/pci/pcbios.c              | 2 +-
 arch/x86/platform/efi/efi.c        | 2 +-
 arch/x86/realmode/init.c           | 2 +-
 13 files changed, 13 insertions(+), 10 deletions(-)
arch/x86/kernel/amd_gart_64.c +1 -1
index 82dfe32..6c81048 100644
@@ -35,7 +35,7 @@
 #include <asm/proto.h>
 #include <asm/iommu.h>
 #include <asm/gart.h>
-#include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 #include <asm/swiotlb.h>
 #include <asm/dma.h>
 #include <asm/amd_nb.h>
arch/x86/kernel/cpu/amd.c +1 -1
index 4e95b2e..f77f7f4 100644
@@ -15,7 +15,7 @@
 
 #ifdef CONFIG_X86_64
 # include <asm/mmconfig.h>
-# include <asm/cacheflush.h>
+# include <asm/set_memory.h>
 #endif
 
 #include "cpu.h"
arch/x86/kernel/cpu/bugs.c +1 -1
index a44ef52..0af86d9 100644
@@ -17,7 +17,7 @@
 #include <asm/paravirt.h>
 #include <asm/alternative.h>
 #include <asm/pgtable.h>
-#include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 
 void __init check_bugs(void)
 {
arch/x86/kernel/ftrace.c +1 -1
index 8639bb2..da9f2b0 100644
@@ -24,7 +24,7 @@
 
 #include <trace/syscall.h>
 
-#include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 #include <asm/kprobes.h>
 #include <asm/ftrace.h>
 #include <asm/nops.h>
arch/x86/kernel/machine_kexec_64.c +1 -0
index 307b1f4..8887311 100644
@@ -27,6 +27,7 @@
 #include <asm/debugreg.h>
 #include <asm/kexec-bzimage64.h>
 #include <asm/setup.h>
+#include <asm/set_memory.h>
 
 #ifdef CONFIG_KEXEC_FILE
 static struct kexec_file_ops *kexec_file_loaders[] = {
arch/x86/mm/init.c +1 -1
index 22af912..adbfb09 100644
@@ -5,7 +5,7 @@
 #include <linux/memblock.h>
 #include <linux/bootmem.h>	/* for max_low_pfn */
 
-#include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 #include <asm/e820.h>
 #include <asm/init.h>
 #include <asm/page.h>
arch/x86/mm/init_64.c +1 -1
index 15173d3..7eef172 100644
@@ -50,7 +50,7 @@
 #include <asm/sections.h>
 #include <asm/kdebug.h>
 #include <asm/numa.h>
-#include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 #include <asm/init.h>
 #include <asm/uv/uv.h>
 #include <asm/setup.h>
arch/x86/mm/ioremap.c +1 -1
index 7aaa263..8ae010c 100644
@@ -13,7 +13,7 @@
 #include <linux/vmalloc.h>
 #include <linux/mmiotrace.h>
 
-#include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 #include <asm/e820.h>
 #include <asm/fixmap.h>
 #include <asm/pgtable.h>
arch/x86/mm/pageattr.c +1 -0
index 28d4213..bfcdd45 100644
@@ -24,6 +24,7 @@
 #include <asm/pgalloc.h>
 #include <asm/proto.h>
 #include <asm/pat.h>
+#include <asm/set_memory.h>
 
 /*
  * The current flushing context - we pass it instead of 5 arguments:
arch/x86/net/bpf_jit_comp.c +1 -0
index 32322ce..a63e6af 100644
@@ -12,6 +12,7 @@
 #include <linux/filter.h>
 #include <linux/if_vlan.h>
 #include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 #include <linux/bpf.h>
 
 int bpf_jit_enable __read_mostly;
arch/x86/pci/pcbios.c +1 -1
index 1d97cea..4d510a6 100644
@@ -9,7 +9,7 @@
 #include <linux/uaccess.h>
 #include <asm/pci_x86.h>
 #include <asm/pci-functions.h>
-#include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 
 /* BIOS32 signature: "_32_" */
 #define BIOS32_SIGNATURE	(('_' << 0) + ('3' << 8) + ('2' << 16) + ('_' << 24))
arch/x86/platform/efi/efi.c +1 -1
index 565dff3..6867d88 100644
@@ -48,7 +48,7 @@
 #include <asm/setup.h>
 #include <asm/efi.h>
 #include <asm/time.h>
-#include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 #include <asm/tlbflush.h>
 #include <asm/x86_init.h>
 #include <asm/uv/uv.h>
arch/x86/realmode/init.c +1 -1
index 5db706f1..a163a90 100644
@@ -2,7 +2,7 @@
 #include <linux/slab.h>
 #include <linux/memblock.h>
 
-#include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 #include <asm/pgtable.h>
 #include <asm/realmode.h>
 #include <asm/tlbflush.h>
Signature · 1 line
2.7.4
Acked-by on v2 5/14
#11 lore raw

Re: [PATCHv2 05/14] x86: Use set_memory.h header

Quoted 5 lines · Laura Abbott

set_memory_* functions have moved to set_memory.h. Switch to this explicitly.

Quoted 15 lines
---
 arch/x86/kernel/amd_gart_64.c      | 2 +-
 arch/x86/kernel/cpu/amd.c          | 2 +-
 arch/x86/kernel/cpu/bugs.c         | 2 +-
 arch/x86/kernel/ftrace.c           | 2 +-
 arch/x86/kernel/machine_kexec_64.c | 1 +
 arch/x86/mm/init.c                 | 2 +-
 arch/x86/mm/init_64.c              | 2 +-
 arch/x86/mm/ioremap.c              | 2 +-
 arch/x86/mm/pageattr.c             | 1 +
 arch/x86/net/bpf_jit_comp.c        | 1 +
 arch/x86/pci/pcbios.c              | 2 +-
 arch/x86/platform/efi/efi.c        | 2 +-
 arch/x86/realmode/init.c           | 2 +-
 13 files changed, 13 insertions(+), 10 deletions(-)

Thanks,

Ingo

#12 lore raw

PATCH v2 6/14 agp: Use set_memory.h header

In reply to Laura Abbott

set_memory_* functions have moved to set_memory.h. Switch to this explicitly.

---
 drivers/char/agp/amd-k7-agp.c | 1 +
 drivers/char/agp/ati-agp.c    | 1 +
 drivers/char/agp/generic.c    | 2 +-
 drivers/char/agp/intel-gtt.c  | 1 +
 drivers/char/agp/sworks-agp.c | 1 +
 5 files changed, 5 insertions(+), 1 deletion(-)
drivers/char/agp/amd-k7-agp.c +1 -0
index 3661a51..5fbd333 100644
@@ -9,6 +9,7 @@
 #include <linux/page-flags.h>
 #include <linux/mm.h>
 #include <linux/slab.h>
+#include <asm/set_memory.h>
 #include "agp.h"
 
 #define AMD_MMBASE_BAR	1
drivers/char/agp/ati-agp.c +1 -0
index 75a9786..0b5ec7a 100644
@@ -10,6 +10,7 @@
 #include <linux/slab.h>
 #include <linux/agp_backend.h>
 #include <asm/agp.h>
+#include <asm/set_memory.h>
 #include "agp.h"
 
 #define ATI_GART_MMBASE_BAR	1
drivers/char/agp/generic.c +1 -1
index f002fa5..c38f38c6 100644
@@ -39,7 +39,7 @@
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <asm/io.h>
-#include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 #include <asm/pgtable.h>
 #include "agp.h"
 
drivers/char/agp/intel-gtt.c +1 -0
index 9702c78f..9776f28 100644
@@ -25,6 +25,7 @@
 #include "agp.h"
 #include "intel-agp.h"
 #include <drm/intel-gtt.h>
+#include <asm/set_memory.h>
 
 /*
  * If we have Intel graphics, we're not going to have anything other than
drivers/char/agp/sworks-agp.c +1 -0
index 9b163b4..03be4ac 100644
@@ -9,6 +9,7 @@
 #include <linux/slab.h>
 #include <linux/jiffies.h>
 #include <linux/agp_backend.h>
+#include <asm/set_memory.h>
 #include "agp.h"
 
 #define SVWRKS_COMMAND		0x04
Signature · 1 line
2.7.4
#13 lore raw

PATCH v2 7/14 drm: Use set_memory.h header

In reply to Laura Abbott

set_memory_* functions have moved to set_memory.h. Switch to this explicitly.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 1 +
 drivers/gpu/drm/gma500/gtt.c             | 1 +
 drivers/gpu/drm/gma500/psb_drv.c         | 1 +
 drivers/gpu/drm/radeon/radeon_gart.c     | 1 +
 drivers/gpu/drm/ttm/ttm_page_alloc.c     | 1 +
 drivers/gpu/drm/ttm/ttm_page_alloc_dma.c | 1 +
 drivers/gpu/drm/ttm/ttm_tt.c             | 1 +
 7 files changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c +1 -0
index 964d2a94..2479ccc 100644
@@ -27,6 +27,7 @@
  */
 #include <drm/drmP.h>
 #include <drm/amdgpu_drm.h>
+#include <asm/set_memory.h>
 #include "amdgpu.h"
 
 /*
drivers/gpu/drm/gma500/gtt.c +1 -0
index 3f4f424..3949b09 100644
@@ -21,6 +21,7 @@
 
 #include <drm/drmP.h>
 #include <linux/shmem_fs.h>
+#include <asm/set_memory.h>
 #include "psb_drv.h"
 #include "blitter.h"
 
drivers/gpu/drm/gma500/psb_drv.c +1 -0
index 5ee93ff..1f9b35a 100644
@@ -35,6 +35,7 @@
 #include <linux/pm_runtime.h>
 #include <acpi/video.h>
 #include <linux/module.h>
+#include <asm/set_memory.h>
 
 static struct drm_driver driver;
 static int psb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent);
drivers/gpu/drm/radeon/radeon_gart.c +1 -0
index c4777c8..dcf8042 100644
@@ -27,6 +27,7 @@
  */
 #include <drm/drmP.h>
 #include <drm/radeon_drm.h>
+#include <asm/set_memory.h>
 #include "radeon.h"
 
 /*
drivers/gpu/drm/ttm/ttm_page_alloc.c +1 -0
index a37de5d..04d8b43 100644
@@ -51,6 +51,7 @@
 #if IS_ENABLED(CONFIG_AGP)
 #include <asm/agp.h>
 #endif
+#include <asm/set_memory.h>
 
 #define NUM_PAGES_TO_ALLOC		(PAGE_SIZE/sizeof(struct page *))
 #define SMALL_ALLOCATION		16
drivers/gpu/drm/ttm/ttm_page_alloc_dma.c +1 -0
index cec4b4b..d6e4cb7 100644
@@ -53,6 +53,7 @@
 #if IS_ENABLED(CONFIG_AGP)
 #include <asm/agp.h>
 #endif
+#include <asm/set_memory.h>
 
 #define NUM_PAGES_TO_ALLOC		(PAGE_SIZE/sizeof(struct page *))
 #define SMALL_ALLOCATION		4
drivers/gpu/drm/ttm/ttm_tt.c +1 -0
index aee3c00..668ae6f 100644
@@ -44,6 +44,7 @@
 #include <drm/ttm/ttm_bo_driver.h>
 #include <drm/ttm/ttm_placement.h>
 #include <drm/ttm/ttm_page_alloc.h>
+#include <asm/set_memory.h>
 
 /**
  * Allocates storage for pointers to the pages that back the ttm.
Signature · 1 line
2.7.4
#14 lore raw

Re: [PATCHv2 07/14] drm: Use set_memory.h header

url: https://github.com/0day-ci/linux/commits/Laura-Abbott/set_memory_-functions-header-refactor/20170305-062939 config: ia64-defconfig (attached as .config) compiler: ia64-linux-gcc (GCC) 6.2.0…

Hi Laura,

[auto build test ERROR on linus/master]
[also build test ERROR on next-20170303]
[cannot apply to tip/x86/core drm/drm-next v4.10]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Laura-Abbott/set_memory_-functions-header-refactor/20170305-062939
config: ia64-defconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 6.2.0
reproduce:
wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=ia64

All errors (new ones prefixed by >>):

>> drivers/char/agp/generic.c:42:28: fatal error: asm/set_memory.h: No such file or directory
    #include <asm/set_memory.h>
                               ^
   compilation terminated.
--
>> drivers/gpu/drm/radeon/radeon_gart.c:30:28: fatal error: asm/set_memory.h: No such file or directory
    #include <asm/set_memory.h>
                               ^
   compilation terminated.
--
>> drivers/gpu/drm/ttm/ttm_tt.c:47:28: fatal error: asm/set_memory.h: No such file or directory
    #include <asm/set_memory.h>
                               ^
   compilation terminated.
--
>> drivers/gpu/drm/ttm/ttm_page_alloc.c:54:28: fatal error: asm/set_memory.h: No such file or directory
    #include <asm/set_memory.h>
                               ^
   compilation terminated.
--
>> drivers/gpu/drm/ttm/ttm_page_alloc_dma.c:56:28: fatal error: asm/set_memory.h: No such file or directory
    #include <asm/set_memory.h>
                               ^

compilation terminated.

vim +30 drivers/gpu/drm/radeon/radeon_gart.c

24 * Authors: Dave Airlie
25 * Alex Deucher
26 * Jerome Glisse
27 */
28 #include <drm/drmP.h>
29 #include <drm/radeon_drm.h>

  > 30	#include <asm/set_memory.h>
    31	#include "radeon.h"
    32	
    33	/*

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#15 lore raw

PATCH v2 8/14 intel_th: Use set_memory.h header

In reply to Laura Abbott

set_memory_* functions have moved to set_memory.h. Switch to this explicitly.

---
 drivers/hwtracing/intel_th/msu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwtracing/intel_th/msu.c +1 -1
index e88afe1..f0e36c8 100644
@@ -27,7 +27,7 @@
 #include <linux/io.h>
 #include <linux/dma-mapping.h>
 
-#include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 
 #include "intel_th.h"
 #include "msu.h"
Signature · 1 line
2.7.4
#17 lore raw

PATCH v2 9/14 watchdog: hpwdt: Use set_memory.h header

In reply to Laura Abbott

set_memory_* functions have moved to set_memory.h. Switch to this explicitly.

---
 drivers/watchdog/hpwdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/hpwdt.c +1 -1
index 70c7194..67fbe35 100644
@@ -34,7 +34,7 @@
 #include <linux/nmi.h>
 #include <linux/kdebug.h>
 #include <linux/notifier.h>
-#include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 #endif /* CONFIG_HPWDT_NMI_DECODING */
 #include <asm/nmi.h>
 #include <asm/frame.h>
Signature · 1 line
2.7.4
maintainer Acked-by on v2 9/14
#18 lore raw

Re: [PATCHv2 09/14] watchdog: hpwdt: Use set_memory.h header

Quoted 4 lines · Laura Abbott

set_memory_* functions have moved to set_memory.h. Switch to this explicitly.

Quoted 18 lines
---
 drivers/watchdog/hpwdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/hpwdt.c +1 -1
index 70c7194..67fbe35 100644
@@ -34,7 +34,7 @@
 #include <linux/nmi.h>
 #include <linux/kdebug.h>
 #include <linux/notifier.h>
-#include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 #endif /* CONFIG_HPWDT_NMI_DECODING */
 #include <asm/nmi.h>
 #include <asm/frame.h>
#19 lore raw

PATCH v2 10/14 bpf: Use set_memory.h header

In reply to Laura Abbott

set_memory_* functions have moved to set_memory.h. Switch to this explicitly.

---
 include/linux/filter.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/filter.h +1 -1
index 0c167fd..c2b403f 100644
@@ -18,7 +18,7 @@
 
 #include <net/sch_generic.h>
 
-#include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 
 #include <uapi/linux/filter.h>
 #include <uapi/linux/bpf.h>
Signature · 1 line
2.7.4
#21 lore raw

Re: [PATCHv2 10/14] bpf: Use set_memory.h header

In reply to Laura Abbott
url: https://github.com/0day-ci/linux/commits/Laura-Abbott/set_memory_-functions-header-refactor/20170305-062939 config: arm-allmodconfig (attached as .config) compiler: arm-linux-gnueabi-gcc…

Hi Laura,

[auto build test ERROR on linus/master]
[also build test ERROR on next-20170303]
[cannot apply to tip/x86/core drm/drm-next v4.10]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Laura-Abbott/set_memory_-functions-header-refactor/20170305-062939
config: arm-allmodconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm

All errors (new ones prefixed by >>):

arch/arm/net/bpf_jit_32.c: In function 'bpf_jit_compile':

>> arch/arm/net/bpf_jit_32.c:1051:2: error: implicit declaration of function 'flush_icache_range' [-Werror=implicit-function-declaration]
     flush_icache_range((u32)header, (u32)(ctx.target + ctx.idx));
     ^~~~~~~~~~~~~~~~~~

cc1: some warnings being treated as errors

vim +/flush_icache_range +1051 arch/arm/net/bpf_jit_32.c

ddecdfce Mircea Gherzan   2012-03-16  1035  		goto out;
ddecdfce Mircea Gherzan   2012-03-16  1036  
55309dd3 Daniel Borkmann  2014-09-08  1037  	ctx.target = (u32 *) target_ptr;
ddecdfce Mircea Gherzan   2012-03-16  1038  	ctx.idx = 0;
55309dd3 Daniel Borkmann  2014-09-08  1039  
ddecdfce Mircea Gherzan   2012-03-16  1040  	build_prologue(&ctx);
0b59d880 Nicolas Schichan 2015-05-07  1041  	if (build_body(&ctx) < 0) {
0b59d880 Nicolas Schichan 2015-05-07  1042  #if __LINUX_ARM_ARCH__ < 7
0b59d880 Nicolas Schichan 2015-05-07  1043  		if (ctx.imm_count)
0b59d880 Nicolas Schichan 2015-05-07  1044  			kfree(ctx.imms);
0b59d880 Nicolas Schichan 2015-05-07  1045  #endif
0b59d880 Nicolas Schichan 2015-05-07  1046  		bpf_jit_binary_free(header);
0b59d880 Nicolas Schichan 2015-05-07  1047  		goto out;
0b59d880 Nicolas Schichan 2015-05-07  1048  	}
ddecdfce Mircea Gherzan   2012-03-16  1049  	build_epilogue(&ctx);
ddecdfce Mircea Gherzan   2012-03-16  1050  
ebaef649 Daniel Borkmann  2015-11-14 @1051  	flush_icache_range((u32)header, (u32)(ctx.target + ctx.idx));
ddecdfce Mircea Gherzan   2012-03-16  1052  
ddecdfce Mircea Gherzan   2012-03-16  1053  #if __LINUX_ARM_ARCH__ < 7
ddecdfce Mircea Gherzan   2012-03-16  1054  	if (ctx.imm_count)
ddecdfce Mircea Gherzan   2012-03-16  1055  		kfree(ctx.imms);
ddecdfce Mircea Gherzan   2012-03-16  1056  #endif
ddecdfce Mircea Gherzan   2012-03-16  1057  
ddecdfce Mircea Gherzan   2012-03-16  1058  	if (bpf_jit_enable > 1)
79617801 Daniel Borkmann  2013-03-21  1059  		/* there are 2 passes here */

:::::: The code at line 1051 was first introduced by commit
:::::: ebaef649c26b44ff28114b452fd067a270ca7f02 bpf, arm: start flushing icache range from header

:::::: TO: Daniel Borkmann <[email protected]> :::::: CC: David S. Miller <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 61304 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170305/7bb6e2a1/attachment-0001.gz>

#22 lore raw

PATCH v2 11/14 module: Use set_memory.h header

In reply to Laura Abbott

set_memory_* functions have moved to set_memory.h. Switch to this explicitly.

---
 kernel/module.c | 1 +
 1 file changed, 1 insertion(+)
kernel/module.c +1 -0
index 7eba6de..c0f04b3 100644
@@ -49,6 +49,7 @@
 #include <linux/rculist.h>
 #include <linux/uaccess.h>
 #include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 #include <asm/mmu_context.h>
 #include <linux/license.h>
 #include <asm/sections.h>
Signature · 1 line
2.7.4
Acked-by on v2 11/14
#23 lore raw

Re: [PATCHv2 11/14] module: Use set_memory.h header

+++ Laura Abbott [01/03/17 16:15 -0800]:

Quoted 5 lines

set_memory_* functions have moved to set_memory.h. Switch to this explicitly.

Thanks,

Jessica

Quoted 19 lines

---
kernel/module.c | 1 +

1 file changed, 1 insertion(+)
kernel/module.c +1 -0
index 7eba6de..c0f04b3 100644
@@ -49,6 +49,7 @@
 #include <linux/rculist.h>
 #include <linux/uaccess.h>
 #include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 #include <asm/mmu_context.h>
 #include <linux/license.h>
 #include <asm/sections.h>
Signature · 1 line
2.7.4
#24 lore raw

PATCH v2 12/14 PM / hibernate: Use set_memory.h header

In reply to Laura Abbott

set_memory_* functions have moved to set_memory.h. Switch to this explicitly.

---
 kernel/power/snapshot.c | 1 +
 1 file changed, 1 insertion(+)
kernel/power/snapshot.c +1 -0
index 905d5bb..4302815 100644
@@ -35,6 +35,7 @@
 #include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/io.h>
+#include <asm/set_memory.h>
 
 #include "power.h"
 
Signature · 1 line
2.7.4
#25 lore raw

PATCH v2 13/14 ALSA: hda: Use set_memory.h header

In reply to Laura Abbott

set_memory_* functions have moved to set_memory.h. Switch to this explicitly.

---
 sound/pci/hda/hda_intel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/hda_intel.c +1 -1
index 16108f0e..e3d8756 100644
@@ -53,7 +53,7 @@
 #ifdef CONFIG_X86
 /* for snoop control */
 #include <asm/pgtable.h>
-#include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 #include <asm/cpufeature.h>
 #endif
 #include <sound/core.h>
Signature · 6 lines
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#26 lore raw

PATCH v2 14/14 treewide: Decouple cacheflush.h and set_memory.h

In reply to Laura Abbott

Now that all call sites, completely decouple cacheflush.h and set_memory.h

---
 arch/arm/include/asm/cacheflush.h   | 1 -
 arch/arm64/include/asm/cacheflush.h | 1 -
 arch/s390/include/asm/Kbuild        | 1 +
 arch/s390/include/asm/cacheflush.h  | 8 --------
 arch/x86/include/asm/cacheflush.h   | 1 -
 5 files changed, 1 insertion(+), 11 deletions(-)
 delete mode 100644 arch/s390/include/asm/cacheflush.h
arch/arm/include/asm/cacheflush.h +0 -1
index 1cb9d11..d69bebf 100644
@@ -16,7 +16,6 @@
 #include <asm/shmparam.h>
 #include <asm/cachetype.h>
 #include <asm/outercache.h>
-#include <asm/set_memory.h>
 
 #define CACHE_COLOUR(vaddr)	((vaddr & (SHMLBA - 1)) >> PAGE_SHIFT)
 
arch/arm64/include/asm/cacheflush.h +0 -1
index 7db6962..5812469 100644
@@ -20,7 +20,6 @@
 #define __ASM_CACHEFLUSH_H
 
 #include <linux/mm.h>
-#include <asm/set_memory.h>
 
 /*
  * This flag is used to indicate that the page pointed to by a pte is clean
arch/s390/include/asm/Kbuild +1 -0
index 8aea32f..c0a7057 100644
@@ -1,4 +1,5 @@
 generic-y += asm-offsets.h
+generic-y += cacheflush.h
 generic-y += clkdev.h
 generic-y += dma-contiguous.h
 generic-y += export.h
arch/s390/include/asm/cacheflush.h deleted +0 -8
deleted file mode 100644
index afe2965..0000000
@@ -1,8 +0,0 @@
-#ifndef _S390_CACHEFLUSH_H
-#define _S390_CACHEFLUSH_H
-
-/* Caches aren't brain-dead on the s390. */
-#include <asm-generic/cacheflush.h>
-#include <asm/set_memory.h>
-
-#endif /* _S390_CACHEFLUSH_H */
arch/x86/include/asm/cacheflush.h +0 -1
index 3d7db6f..8b4140f 100644
@@ -4,7 +4,6 @@
 /* Caches aren't brain-dead on the intel. */
 #include <asm-generic/cacheflush.h>
 #include <asm/special_insns.h>
-#include <asm/set_memory.h>
 
 void clflush_cache_range(void *addr, unsigned int size);
 
Signature · 1 line
2.7.4
maintainer Acked-by Russell King on v2 14/14
#27 lore raw

Re: [PATCHv2 14/14] treewide: Decouple cacheflush.h and set_memory.h

arch/arm/include/asm/cacheflush.h line 21

Quoted 12 lines · Laura Abbott
arch/arm/include/asm/cacheflush.h +0 -1
index 1cb9d11..d69bebf 100644
@@ -16,7 +16,6 @@
 #include <asm/shmparam.h>
 #include <asm/cachetype.h>
 #include <asm/outercache.h>
-#include <asm/set_memory.h>
 
 #define CACHE_COLOUR(vaddr)	((vaddr & (SHMLBA - 1)) >> PAGE_SHIFT)
 

Thanks.

Signature · 3 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
reviewer Acked-by on v2 14/14
#28 lore raw

Re: [PATCHv2 14/14] treewide: Decouple cacheflush.h and set_memory.h

In reply to Laura Abbott
Quoted 19 lines · Laura Abbott

Now that all call sites, completely decouple cacheflush.h and set_memory.h

---
 arch/arm/include/asm/cacheflush.h   | 1 -
 arch/arm64/include/asm/cacheflush.h | 1 -
 arch/s390/include/asm/Kbuild        | 1 +
 arch/s390/include/asm/cacheflush.h  | 8 --------
 arch/x86/include/asm/cacheflush.h   | 1 -
 5 files changed, 1 insertion(+), 11 deletions(-)
 delete mode 100644 arch/s390/include/asm/cacheflush.h
arch/arm/include/asm/cacheflush.h +0 -0
index 1cb9d11..d69bebf 100644

arch/arm/include/asm/cacheflush.h line 19

Quoted 4 lines
arch/arm/include/asm/cacheflush.h +0 -1
@@ -16,7 +16,6 @@
 #include <asm/shmparam.h>
 #include <asm/cachetype.h>
 #include <asm/outercache.h>
-#include <asm/set_memory.h>

Thanks,
Mark.

#30 lore raw

Re: [PATCHv2 14/14] treewide: Decouple cacheflush.h and set_memory.h

In reply to Laura Abbott
url: https://github.com/0day-ci/linux/commits/Laura-Abbott/set_memory_-functions-header-refactor/20170305-062939 config: i386-randconfig-x014-201710 (attached as .config) compiler: gcc-6 (Debian…

Hi Laura,

[auto build test ERROR on linus/master]
[also build test ERROR on next-20170303]
[cannot apply to tip/x86/core drm/drm-next v4.10]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Laura-Abbott/set_memory_-functions-header-refactor/20170305-062939
config: i386-randconfig-x014-201710 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce:

        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

arch/x86/kernel/machine_kexec_32.c: In function 'machine_kexec_prepare':

>> arch/x86/kernel/machine_kexec_32.c:160:2: error: implicit declaration of function 'set_pages_x' [-Werror=implicit-function-declaration]
     set_pages_x(image->control_code_page, 1);
     ^~~~~~~~~~~
   arch/x86/kernel/machine_kexec_32.c: In function 'machine_kexec_cleanup':
>> arch/x86/kernel/machine_kexec_32.c:174:2: error: implicit declaration of function 'set_pages_nx' [-Werror=implicit-function-declaration]
     set_pages_nx(image->control_code_page, 1);
     ^~~~~~~~~~~~
   cc1: some warnings being treated as errors
--
   arch/x86/mm/init_32.c: In function 'set_kernel_text_rw':
>> arch/x86/mm/init_32.c:880:2: error: implicit declaration of function 'set_pages_rw' [-Werror=implicit-function-declaration]
     set_pages_rw(virt_to_page(start), size >> PAGE_SHIFT);
     ^~~~~~~~~~~~
   arch/x86/mm/init_32.c: In function 'set_kernel_text_ro':
>> arch/x86/mm/init_32.c:894:2: error: implicit declaration of function 'set_pages_ro' [-Werror=implicit-function-declaration]
     set_pages_ro(virt_to_page(start), size >> PAGE_SHIFT);
     ^~~~~~~~~~~~
   arch/x86/mm/init_32.c: In function 'mark_nxdata_nx':
>> arch/x86/mm/init_32.c:911:2: error: implicit declaration of function 'set_pages_nx' [-Werror=implicit-function-declaration]
     set_pages_nx(virt_to_page(start), size >> PAGE_SHIFT);
     ^~~~~~~~~~~~

cc1: some warnings being treated as errors

vim +/set_pages_x +160 arch/x86/kernel/machine_kexec_32.c

9868ee63 arch/x86/kernel/machine_kexec_32.c Huang Ying        2008-10-31  154   * - Setup page tables
5033cba0 arch/i386/kernel/machine_kexec.c   Eric W. Biederman 2005-06-25  155   */
5033cba0 arch/i386/kernel/machine_kexec.c   Eric W. Biederman 2005-06-25  156  int machine_kexec_prepare(struct kimage *image)
5033cba0 arch/i386/kernel/machine_kexec.c   Eric W. Biederman 2005-06-25  157  {
9868ee63 arch/x86/kernel/machine_kexec_32.c Huang Ying        2008-10-31  158  	int error;
9868ee63 arch/x86/kernel/machine_kexec_32.c Huang Ying        2008-10-31  159  
3ab83521 arch/x86/kernel/machine_kexec_32.c Huang Ying        2008-07-25 @160  	set_pages_x(image->control_code_page, 1);
9868ee63 arch/x86/kernel/machine_kexec_32.c Huang Ying        2008-10-31  161  	error = machine_kexec_alloc_page_tables(image);
9868ee63 arch/x86/kernel/machine_kexec_32.c Huang Ying        2008-10-31  162  	if (error)
9868ee63 arch/x86/kernel/machine_kexec_32.c Huang Ying        2008-10-31  163  		return error;
9868ee63 arch/x86/kernel/machine_kexec_32.c Huang Ying        2008-10-31  164  	machine_kexec_prepare_page_tables(image);
9868ee63 arch/x86/kernel/machine_kexec_32.c Huang Ying        2008-10-31  165  	return 0;
5033cba0 arch/i386/kernel/machine_kexec.c   Eric W. Biederman 2005-06-25  166  }
5033cba0 arch/i386/kernel/machine_kexec.c   Eric W. Biederman 2005-06-25  167  
5033cba0 arch/i386/kernel/machine_kexec.c   Eric W. Biederman 2005-06-25  168  /*
5033cba0 arch/i386/kernel/machine_kexec.c   Eric W. Biederman 2005-06-25  169   * Undo anything leftover by machine_kexec_prepare
5033cba0 arch/i386/kernel/machine_kexec.c   Eric W. Biederman 2005-06-25  170   * when an image is freed.
5033cba0 arch/i386/kernel/machine_kexec.c   Eric W. Biederman 2005-06-25  171   */
5033cba0 arch/i386/kernel/machine_kexec.c   Eric W. Biederman 2005-06-25  172  void machine_kexec_cleanup(struct kimage *image)
5033cba0 arch/i386/kernel/machine_kexec.c   Eric W. Biederman 2005-06-25  173  {
3ab83521 arch/x86/kernel/machine_kexec_32.c Huang Ying        2008-07-25 @174  	set_pages_nx(image->control_code_page, 1);
92be3d6b arch/x86/kernel/machine_kexec_32.c Huang Ying        2008-10-31  175  	machine_kexec_free_page_tables(image);
5033cba0 arch/i386/kernel/machine_kexec.c   Eric W. Biederman 2005-06-25  176  }

5033cba0 arch/i386/kernel/machine_kexec.c Eric W. Biederman 2005-06-25 177

:::::: The code at line 160 was first introduced by commit :::::: 3ab83521378268044a448113c6aa9a9e245f4d2f kexec jump

:::::: TO: Huang Ying <[email protected]> :::::: CC: Linus Torvalds <torvalds-de/[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#31 lore raw

Re: [PATCHv2 14/14] treewide: Decouple cacheflush.h and set_memory.h

In reply to Laura Abbott
url: https://github.com/0day-ci/linux/commits/Laura-Abbott/set_memory_-functions-header-refactor/20170305-062939 config: i386-allmodconfig (attached as .config) compiler: gcc-6 (Debian 6.2.0-3)…

Hi Laura,

[auto build test ERROR on linus/master]
[also build test ERROR on next-20170303]
[cannot apply to tip/x86/core drm/drm-next v4.10]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Laura-Abbott/set_memory_-functions-header-refactor/20170305-062939
config: i386-allmodconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce:

        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

sound/pci/intel8x0.c: In function 'fill_nocache':

>> sound/pci/intel8x0.c:736:3: error: implicit declaration of function 'set_pages_uc' [-Werror=implicit-function-declaration]
      set_pages_uc(virt_to_page(buf), size);
      ^~~~~~~~~~~~
>> sound/pci/intel8x0.c:738:3: error: implicit declaration of function 'set_pages_wb' [-Werror=implicit-function-declaration]
      set_pages_wb(virt_to_page(buf), size);
      ^~~~~~~~~~~~
   cc1: some warnings being treated as errors
--
   sound/x86/intel_hdmi_audio.c: In function 'had_pcm_hw_params':
>> sound/x86/intel_hdmi_audio.c:1135:11: error: implicit declaration of function 'set_memory_uc' [-Werror=implicit-function-declaration]
     retval = set_memory_uc(addr, pages);
              ^~~~~~~~~~~~~
   sound/x86/intel_hdmi_audio.c: In function 'had_pcm_hw_free':
>> sound/x86/intel_hdmi_audio.c:1163:3: error: implicit declaration of function 'set_memory_wb' [-Werror=implicit-function-declaration]
      set_memory_wb(addr, pages);
      ^~~~~~~~~~~~~

cc1: some warnings being treated as errors

vim +/set_pages_uc +736 sound/pci/intel8x0.c

631dd1a8 Justin P. Mattock 2010-10-18  730   *	http://download.intel.com/design/chipsets/specupdt/24505108.pdf
^1da177e Linus Torvalds    2005-04-16  731   */
^1da177e Linus Torvalds    2005-04-16  732  static void fill_nocache(void *buf, int size, int nocache)
^1da177e Linus Torvalds    2005-04-16  733  {
^1da177e Linus Torvalds    2005-04-16  734  	size = (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
6d238cc4 Arjan van de Ven  2008-01-30  735  	if (nocache)
6d238cc4 Arjan van de Ven  2008-01-30 @736  		set_pages_uc(virt_to_page(buf), size);
6d238cc4 Arjan van de Ven  2008-01-30  737  	else
6d238cc4 Arjan van de Ven  2008-01-30 @738  		set_pages_wb(virt_to_page(buf), size);
^1da177e Linus Torvalds    2005-04-16  739  }
^1da177e Linus Torvalds    2005-04-16  740  #else
6d238cc4 Arjan van de Ven  2008-01-30  741  #define fill_nocache(buf, size, nocache) do { ; } while (0)

:::::: The code at line 736 was first introduced by commit
:::::: 6d238cc4dc8a36a3915c26202fe49f58a0683fb9 x86: convert CPA users to the new set_page_ API

:::::: TO: Arjan van de Ven <[email protected]> :::::: CC: Ingo Molnar <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 58978 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170305/d6f4df6d/attachment-0001.gz>

Acked-by on the v2 series
#32 lore raw
In reply to Laura Abbott
Quoted 15 lines · Laura Abbott

Hi,

This is v2 of my proposal to move set_memory_* function prototypes out of cacheflush.h and into their own header file. This came out of a comment Russell made while reviewing RODATA test cases
http://lists.infradead.org/pipermail/linux-arm-kernel/2017-January/480855.html
While the final result of that series was the rodata code was refactored into its own header file, the set_memory_* APIs are still out of place.

This version refactored the common set_memory_* functions into an asm-generic header. s390x added some features so it can't just use the asm-generic header. I debated how much more to try and shove into the asm-generic version (e.g. stub prototypes for the ARM nommu case, set_kernel_text_*) but decided to stick with just the basics for this version.

Quoted 7 lines

I split out the cacheflush.h -> set_memory.h conversions into separate patches to hopefully make merging easier. Worst case, the final patch to completely separate the two can be delayed if there are more problems found. I'd like for this to eventually go through the -mm tree so I'd like Acks where appropriate.

As always, feedback appreciated.

For the s390 bits: