From: Greg Kroah-Hartman Date: Mon, 20 Nov 2017 14:07:56 +0000 (+0100) Subject: 4.4-stable patches X-Git-Tag: v3.18.83~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f927ef1511a66721539b09f2a85b74fc3cd13979;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: mm-add-phys_pfn-use-it-in-__phys_to_pfn.patch --- diff --git a/queue-4.4/mm-add-phys_pfn-use-it-in-__phys_to_pfn.patch b/queue-4.4/mm-add-phys_pfn-use-it-in-__phys_to_pfn.patch new file mode 100644 index 00000000000..31ff540f076 --- /dev/null +++ b/queue-4.4/mm-add-phys_pfn-use-it-in-__phys_to_pfn.patch @@ -0,0 +1,62 @@ +From 8f235d1a3eb7198affe7cadf676a10afb8a46a1a Mon Sep 17 00:00:00 2001 +From: Chen Gang +Date: Thu, 14 Jan 2016 15:18:33 -0800 +Subject: mm: add PHYS_PFN, use it in __phys_to_pfn() + +From: Chen Gang + +commit 8f235d1a3eb7198affe7cadf676a10afb8a46a1a upstream. + +__phys_to_pfn and __pfn_to_phys are symmetric, PHYS_PFN and PFN_PHYS are +semmetric: + + - y = (phys_addr_t)x << PAGE_SHIFT + + - y >> PAGE_SHIFT = (phys_add_t)x + + - (unsigned long)(y >> PAGE_SHIFT) = x + +[akpm@linux-foundation.org: use macro arg name `x'] +[arnd@arndb.de: include linux/pfn.h for PHYS_PFN definition] +Signed-off-by: Chen Gang +Cc: Oleg Nesterov +Signed-off-by: Arnd Bergmann +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Cc: Marcin Nowakowski +Signed-off-by: Greg Kroah-Hartman + +--- + include/asm-generic/memory_model.h | 4 +++- + include/linux/pfn.h | 1 + + 2 files changed, 4 insertions(+), 1 deletion(-) + +--- a/include/asm-generic/memory_model.h ++++ b/include/asm-generic/memory_model.h +@@ -1,6 +1,8 @@ + #ifndef __ASM_MEMORY_MODEL_H + #define __ASM_MEMORY_MODEL_H + ++#include ++ + #ifndef __ASSEMBLY__ + + #if defined(CONFIG_FLATMEM) +@@ -72,7 +74,7 @@ + /* + * Convert a physical address to a Page Frame Number and back + */ +-#define __phys_to_pfn(paddr) ((unsigned long)((paddr) >> PAGE_SHIFT)) ++#define __phys_to_pfn(paddr) PHYS_PFN(paddr) + #define __pfn_to_phys(pfn) PFN_PHYS(pfn) + + #define page_to_pfn __page_to_pfn +--- a/include/linux/pfn.h ++++ b/include/linux/pfn.h +@@ -9,5 +9,6 @@ + #define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT) + #define PFN_DOWN(x) ((x) >> PAGE_SHIFT) + #define PFN_PHYS(x) ((phys_addr_t)(x) << PAGE_SHIFT) ++#define PHYS_PFN(x) ((unsigned long)((x) >> PAGE_SHIFT)) + + #endif diff --git a/queue-4.4/series b/queue-4.4/series index 9ac92b32c81..5bdebf44fca 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -45,6 +45,7 @@ ixgbe-add-mask-for-64-rss-queues.patch ixgbe-do-not-disable-fec-from-the-driver.patch staging-rtl8712-fixed-little-endian-problem.patch mips-end-asm-function-prologue-macros-with-.insn.patch +mm-add-phys_pfn-use-it-in-__phys_to_pfn.patch mips-init-ensure-bootmem-does-not-corrupt-reserved-memory.patch mips-init-ensure-reserved-memory-regions-are-not-added-to-bootmem.patch mips-netlogic-exclude-netlogic-xlp-pic-code-from-xlr-builds.patch