All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Remove s390 sw-emulated hugepages and cleanup
@ 2015-05-28 11:52 ` Dominik Dingel
  0 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-05-28 11:52 UTC (permalink / raw)
  To: linux-arm-kernel

Hi everyone,

there is a potential bug with KVM and hugetlbfs if the hardware does not
support hugepages (EDAT1).
We fix this by making EDAT1 a hard requirement for hugepages and 
therefore removing and simplifying code.

As s390, with the sw-emulated hugepages, was the only user of arch_prepare/release_hugepage
I also removed theses calls from common and other architecture code.

Thanks,
    Dominik

Dominik Dingel (5):
  s390/mm: make hugepages_supported a boot time decision
  mm/hugetlb: remove unused arch hook prepare/release_hugepage
  mm/hugetlb: remove arch_prepare/release_hugepage from arch headers
  s390/hugetlb: remove dead code for sw emulated huge pages
  s390/mm: forward check for huge pmds to pmd_large()

 arch/arm/include/asm/hugetlb.h     |  9 ------
 arch/arm64/include/asm/hugetlb.h   |  9 ------
 arch/ia64/include/asm/hugetlb.h    |  9 ------
 arch/metag/include/asm/hugetlb.h   |  9 ------
 arch/mips/include/asm/hugetlb.h    |  9 ------
 arch/powerpc/include/asm/hugetlb.h |  9 ------
 arch/s390/include/asm/hugetlb.h    |  3 --
 arch/s390/include/asm/page.h       |  8 ++---
 arch/s390/kernel/setup.c           |  2 ++
 arch/s390/mm/hugetlbpage.c         | 65 +++-----------------------------------
 arch/s390/mm/pgtable.c             |  2 ++
 arch/sh/include/asm/hugetlb.h      |  9 ------
 arch/sparc/include/asm/hugetlb.h   |  9 ------
 arch/tile/include/asm/hugetlb.h    |  9 ------
 arch/x86/include/asm/hugetlb.h     |  9 ------
 mm/hugetlb.c                       | 10 ------
 16 files changed, 12 insertions(+), 168 deletions(-)

-- 
2.3.7


^ permalink raw reply	[flat|nested] 45+ messages in thread

* [PATCH 0/5] Remove s390 sw-emulated hugepages and cleanup
@ 2015-05-28 11:52 ` Dominik Dingel
  0 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-05-28 11:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: Russell King, Catalin Marinas, Will Deacon, Tony Luck,
	Fenghua Yu, James Hogan, Ralf Baechle, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Martin Schwidefsky,
	Heiko Carstens, linux390, David S. Miller, Chris Metcalf,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Andrew Morton,
	Zhang Zhen, Dominik Dingel, David Rientjes, Aneesh Kumar K.V,
	Nathan Lynch, Christian Borntraeger, Andy Lutomirski,
	Michael Holzheu, Hugh Dickins, Naoya Horiguchi, Paolo Bonzini,
	Jason J. Herne, Davidlohr Bueso, Kirill A. Shutemov,
	Luiz Capitulino, Mike Kravetz, linux-arm-kernel, linux-ia64,
	linux-metag, linux-mips, linuxppc-dev, linux-s390, linux-sh,
	sparclinux, linux-mm

Hi everyone,

there is a potential bug with KVM and hugetlbfs if the hardware does not
support hugepages (EDAT1).
We fix this by making EDAT1 a hard requirement for hugepages and 
therefore removing and simplifying code.

As s390, with the sw-emulated hugepages, was the only user of arch_prepare/release_hugepage
I also removed theses calls from common and other architecture code.

Thanks,
    Dominik

Dominik Dingel (5):
  s390/mm: make hugepages_supported a boot time decision
  mm/hugetlb: remove unused arch hook prepare/release_hugepage
  mm/hugetlb: remove arch_prepare/release_hugepage from arch headers
  s390/hugetlb: remove dead code for sw emulated huge pages
  s390/mm: forward check for huge pmds to pmd_large()

 arch/arm/include/asm/hugetlb.h     |  9 ------
 arch/arm64/include/asm/hugetlb.h   |  9 ------
 arch/ia64/include/asm/hugetlb.h    |  9 ------
 arch/metag/include/asm/hugetlb.h   |  9 ------
 arch/mips/include/asm/hugetlb.h    |  9 ------
 arch/powerpc/include/asm/hugetlb.h |  9 ------
 arch/s390/include/asm/hugetlb.h    |  3 --
 arch/s390/include/asm/page.h       |  8 ++---
 arch/s390/kernel/setup.c           |  2 ++
 arch/s390/mm/hugetlbpage.c         | 65 +++-----------------------------------
 arch/s390/mm/pgtable.c             |  2 ++
 arch/sh/include/asm/hugetlb.h      |  9 ------
 arch/sparc/include/asm/hugetlb.h   |  9 ------
 arch/tile/include/asm/hugetlb.h    |  9 ------
 arch/x86/include/asm/hugetlb.h     |  9 ------
 mm/hugetlb.c                       | 10 ------
 16 files changed, 12 insertions(+), 168 deletions(-)

-- 
2.3.7


^ permalink raw reply	[flat|nested] 45+ messages in thread

* [PATCH 0/5] Remove s390 sw-emulated hugepages and cleanup
@ 2015-05-28 11:52 ` Dominik Dingel
  0 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-05-28 11:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: Russell King, Catalin Marinas, Will Deacon, Tony Luck,
	Fenghua Yu, James Hogan, Ralf Baechle, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Martin Schwidefsky,
	Heiko Carstens, linux390, David S. Miller, Chris Metcalf,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Andrew Morton,
	Zhang Zhen, Dominik Dingel, David Rientjes, Aneesh Kumar K.V,
	Nathan Lynch, Christian Borntraeger, Andy Lutomirski,
	Michael Holzheu, Hugh Dickins, Naoya Horiguchi, Paolo Bonzini,
	Jason J. Herne, Davidlohr Bueso, Kirill A. Shutemov,
	Luiz Capitulino, Mike Kravetz, linux-arm-kernel, linux-ia64,
	linux-metag, linux-mips, linuxppc-dev, linux-s390, linux-sh,
	sparclinux, linux-mm

Hi everyone,

there is a potential bug with KVM and hugetlbfs if the hardware does not
support hugepages (EDAT1).
We fix this by making EDAT1 a hard requirement for hugepages and 
therefore removing and simplifying code.

As s390, with the sw-emulated hugepages, was the only user of arch_prepare/release_hugepage
I also removed theses calls from common and other architecture code.

Thanks,
    Dominik

Dominik Dingel (5):
  s390/mm: make hugepages_supported a boot time decision
  mm/hugetlb: remove unused arch hook prepare/release_hugepage
  mm/hugetlb: remove arch_prepare/release_hugepage from arch headers
  s390/hugetlb: remove dead code for sw emulated huge pages
  s390/mm: forward check for huge pmds to pmd_large()

 arch/arm/include/asm/hugetlb.h     |  9 ------
 arch/arm64/include/asm/hugetlb.h   |  9 ------
 arch/ia64/include/asm/hugetlb.h    |  9 ------
 arch/metag/include/asm/hugetlb.h   |  9 ------
 arch/mips/include/asm/hugetlb.h    |  9 ------
 arch/powerpc/include/asm/hugetlb.h |  9 ------
 arch/s390/include/asm/hugetlb.h    |  3 --
 arch/s390/include/asm/page.h       |  8 ++---
 arch/s390/kernel/setup.c           |  2 ++
 arch/s390/mm/hugetlbpage.c         | 65 +++-----------------------------------
 arch/s390/mm/pgtable.c             |  2 ++
 arch/sh/include/asm/hugetlb.h      |  9 ------
 arch/sparc/include/asm/hugetlb.h   |  9 ------
 arch/tile/include/asm/hugetlb.h    |  9 ------
 arch/x86/include/asm/hugetlb.h     |  9 ------
 mm/hugetlb.c                       | 10 ------
 16 files changed, 12 insertions(+), 168 deletions(-)

-- 
2.3.7

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 45+ messages in thread

* [PATCH 0/5] Remove s390 sw-emulated hugepages and cleanup
@ 2015-05-28 11:52 ` Dominik Dingel
  0 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-05-28 11:52 UTC (permalink / raw)
  To: linux-arm-kernel

Hi everyone,

there is a potential bug with KVM and hugetlbfs if the hardware does not
support hugepages (EDAT1).
We fix this by making EDAT1 a hard requirement for hugepages and 
therefore removing and simplifying code.

As s390, with the sw-emulated hugepages, was the only user of arch_prepare/release_hugepage
I also removed theses calls from common and other architecture code.

Thanks,
    Dominik

Dominik Dingel (5):
  s390/mm: make hugepages_supported a boot time decision
  mm/hugetlb: remove unused arch hook prepare/release_hugepage
  mm/hugetlb: remove arch_prepare/release_hugepage from arch headers
  s390/hugetlb: remove dead code for sw emulated huge pages
  s390/mm: forward check for huge pmds to pmd_large()

 arch/arm/include/asm/hugetlb.h     |  9 ------
 arch/arm64/include/asm/hugetlb.h   |  9 ------
 arch/ia64/include/asm/hugetlb.h    |  9 ------
 arch/metag/include/asm/hugetlb.h   |  9 ------
 arch/mips/include/asm/hugetlb.h    |  9 ------
 arch/powerpc/include/asm/hugetlb.h |  9 ------
 arch/s390/include/asm/hugetlb.h    |  3 --
 arch/s390/include/asm/page.h       |  8 ++---
 arch/s390/kernel/setup.c           |  2 ++
 arch/s390/mm/hugetlbpage.c         | 65 +++-----------------------------------
 arch/s390/mm/pgtable.c             |  2 ++
 arch/sh/include/asm/hugetlb.h      |  9 ------
 arch/sparc/include/asm/hugetlb.h   |  9 ------
 arch/tile/include/asm/hugetlb.h    |  9 ------
 arch/x86/include/asm/hugetlb.h     |  9 ------
 mm/hugetlb.c                       | 10 ------
 16 files changed, 12 insertions(+), 168 deletions(-)

-- 
2.3.7

^ permalink raw reply	[flat|nested] 45+ messages in thread

* [PATCH 0/5] Remove s390 sw-emulated hugepages and cleanup
@ 2015-05-28 11:52 ` Dominik Dingel
  0 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-05-28 11:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: Russell King, Catalin Marinas, Will Deacon, Tony Luck,
	Fenghua Yu, James Hogan, Ralf Baechle, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Martin Schwidefsky,
	Heiko Carstens, linux390, David S. Miller, Chris Metcalf,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Andrew Morton,
	Zhang Zhen

Hi everyone,

there is a potential bug with KVM and hugetlbfs if the hardware does not
support hugepages (EDAT1).
We fix this by making EDAT1 a hard requirement for hugepages and 
therefore removing and simplifying code.

As s390, with the sw-emulated hugepages, was the only user of arch_prepare/release_hugepage
I also removed theses calls from common and other architecture code.

Thanks,
    Dominik

Dominik Dingel (5):
  s390/mm: make hugepages_supported a boot time decision
  mm/hugetlb: remove unused arch hook prepare/release_hugepage
  mm/hugetlb: remove arch_prepare/release_hugepage from arch headers
  s390/hugetlb: remove dead code for sw emulated huge pages
  s390/mm: forward check for huge pmds to pmd_large()

 arch/arm/include/asm/hugetlb.h     |  9 ------
 arch/arm64/include/asm/hugetlb.h   |  9 ------
 arch/ia64/include/asm/hugetlb.h    |  9 ------
 arch/metag/include/asm/hugetlb.h   |  9 ------
 arch/mips/include/asm/hugetlb.h    |  9 ------
 arch/powerpc/include/asm/hugetlb.h |  9 ------
 arch/s390/include/asm/hugetlb.h    |  3 --
 arch/s390/include/asm/page.h       |  8 ++---
 arch/s390/kernel/setup.c           |  2 ++
 arch/s390/mm/hugetlbpage.c         | 65 +++-----------------------------------
 arch/s390/mm/pgtable.c             |  2 ++
 arch/sh/include/asm/hugetlb.h      |  9 ------
 arch/sparc/include/asm/hugetlb.h   |  9 ------
 arch/tile/include/asm/hugetlb.h    |  9 ------
 arch/x86/include/asm/hugetlb.h     |  9 ------
 mm/hugetlb.c                       | 10 ------
 16 files changed, 12 insertions(+), 168 deletions(-)

-- 
2.3.7

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 45+ messages in thread

* [PATCH 1/5] s390/mm: make hugepages_supported a boot time decision
  2015-05-28 11:52 ` Dominik Dingel
                     ` (2 preceding siblings ...)
  (?)
@ 2015-05-28 11:52   ` Dominik Dingel
  -1 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-05-28 11:52 UTC (permalink / raw)
  To: linux-arm-kernel

By dropping support for hugepages on machines which do not have
the hardware feature EDAT1, we fix a potential s390 KVM bug.

The bug would happen if a guest is backed by hugetlbfs (not supported currently),
but does not get pagetables with PGSTE.
This would lead to random memory overwrites.

Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
---
 arch/s390/include/asm/page.h | 8 ++++----
 arch/s390/kernel/setup.c     | 2 ++
 arch/s390/mm/pgtable.c       | 2 ++
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/s390/include/asm/page.h b/arch/s390/include/asm/page.h
index 53eacbd..0844b78 100644
--- a/arch/s390/include/asm/page.h
+++ b/arch/s390/include/asm/page.h
@@ -17,7 +17,10 @@
 #define PAGE_DEFAULT_ACC	0
 #define PAGE_DEFAULT_KEY	(PAGE_DEFAULT_ACC << 4)
 
-#define HPAGE_SHIFT	20
+#include <asm/setup.h>
+#ifndef __ASSEMBLY__
+
+extern unsigned int HPAGE_SHIFT;
 #define HPAGE_SIZE	(1UL << HPAGE_SHIFT)
 #define HPAGE_MASK	(~(HPAGE_SIZE - 1))
 #define HUGETLB_PAGE_ORDER	(HPAGE_SHIFT - PAGE_SHIFT)
@@ -27,9 +30,6 @@
 #define ARCH_HAS_PREPARE_HUGEPAGE
 #define ARCH_HAS_HUGEPAGE_CLEAR_FLUSH
 
-#include <asm/setup.h>
-#ifndef __ASSEMBLY__
-
 static inline void storage_key_init_range(unsigned long start, unsigned long end)
 {
 #if PAGE_DEFAULT_KEY
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index a5ea8bc..9ac282b 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -915,6 +915,8 @@ void __init setup_arch(char **cmdline_p)
 	 */
 	setup_hwcaps();
 
+	HPAGE_SHIFT = MACHINE_HAS_HPAGE ? 20 : 0;
+
 	/*
 	 * Create kernel page tables and switch to virtual addressing.
 	 */
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
index b2c1542..f76791e 100644
--- a/arch/s390/mm/pgtable.c
+++ b/arch/s390/mm/pgtable.c
@@ -36,6 +36,8 @@
 #endif
 
 
+unsigned int HPAGE_SHIFT;
+
 unsigned long *crst_table_alloc(struct mm_struct *mm)
 {
 	struct page *page = alloc_pages(GFP_KERNEL, ALLOC_ORDER);
-- 
2.3.7


^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 1/5] s390/mm: make hugepages_supported a boot time decision
@ 2015-05-28 11:52   ` Dominik Dingel
  0 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-05-28 11:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: Russell King, Catalin Marinas, Will Deacon, Tony Luck,
	Fenghua Yu, James Hogan, Ralf Baechle, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Martin Schwidefsky,
	Heiko Carstens, linux390, David S. Miller, Chris Metcalf,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Andrew Morton,
	Zhang Zhen, Dominik Dingel, David Rientjes, Aneesh Kumar K.V,
	Nathan Lynch, Christian Borntraeger, Andy Lutomirski,
	Michael Holzheu, Hugh Dickins, Naoya Horiguchi, Paolo Bonzini,
	Jason J. Herne, Davidlohr Bueso, Kirill A. Shutemov,
	Luiz Capitulino, Mike Kravetz, linux-arm-kernel, linux-ia64,
	linux-metag, linux-mips, linuxppc-dev, linux-s390, linux-sh,
	sparclinux, linux-mm

By dropping support for hugepages on machines which do not have
the hardware feature EDAT1, we fix a potential s390 KVM bug.

The bug would happen if a guest is backed by hugetlbfs (not supported currently),
but does not get pagetables with PGSTE.
This would lead to random memory overwrites.

Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
---
 arch/s390/include/asm/page.h | 8 ++++----
 arch/s390/kernel/setup.c     | 2 ++
 arch/s390/mm/pgtable.c       | 2 ++
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/s390/include/asm/page.h b/arch/s390/include/asm/page.h
index 53eacbd..0844b78 100644
--- a/arch/s390/include/asm/page.h
+++ b/arch/s390/include/asm/page.h
@@ -17,7 +17,10 @@
 #define PAGE_DEFAULT_ACC	0
 #define PAGE_DEFAULT_KEY	(PAGE_DEFAULT_ACC << 4)
 
-#define HPAGE_SHIFT	20
+#include <asm/setup.h>
+#ifndef __ASSEMBLY__
+
+extern unsigned int HPAGE_SHIFT;
 #define HPAGE_SIZE	(1UL << HPAGE_SHIFT)
 #define HPAGE_MASK	(~(HPAGE_SIZE - 1))
 #define HUGETLB_PAGE_ORDER	(HPAGE_SHIFT - PAGE_SHIFT)
@@ -27,9 +30,6 @@
 #define ARCH_HAS_PREPARE_HUGEPAGE
 #define ARCH_HAS_HUGEPAGE_CLEAR_FLUSH
 
-#include <asm/setup.h>
-#ifndef __ASSEMBLY__
-
 static inline void storage_key_init_range(unsigned long start, unsigned long end)
 {
 #if PAGE_DEFAULT_KEY
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index a5ea8bc..9ac282b 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -915,6 +915,8 @@ void __init setup_arch(char **cmdline_p)
 	 */
 	setup_hwcaps();
 
+	HPAGE_SHIFT = MACHINE_HAS_HPAGE ? 20 : 0;
+
 	/*
 	 * Create kernel page tables and switch to virtual addressing.
 	 */
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
index b2c1542..f76791e 100644
--- a/arch/s390/mm/pgtable.c
+++ b/arch/s390/mm/pgtable.c
@@ -36,6 +36,8 @@
 #endif
 
 
+unsigned int HPAGE_SHIFT;
+
 unsigned long *crst_table_alloc(struct mm_struct *mm)
 {
 	struct page *page = alloc_pages(GFP_KERNEL, ALLOC_ORDER);
-- 
2.3.7


^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 1/5] s390/mm: make hugepages_supported a boot time decision
@ 2015-05-28 11:52   ` Dominik Dingel
  0 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-05-28 11:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: Russell King, Catalin Marinas, Will Deacon, Tony Luck,
	Fenghua Yu, James Hogan, Ralf Baechle, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Martin Schwidefsky,
	Heiko Carstens, linux390, David S. Miller, Chris Metcalf,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Andrew Morton,
	Zhang Zhen, Dominik Dingel, David Rientjes, Aneesh Kumar K.V,
	Nathan Lynch, Christian Borntraeger, Andy Lutomirski,
	Michael Holzheu, Hugh Dickins, Naoya Horiguchi, Paolo Bonzini,
	Jason J. Herne, Davidlohr Bueso, Kirill A. Shutemov,
	Luiz Capitulino, Mike Kravetz, linux-arm-kernel, linux-ia64,
	linux-metag, linux-mips, linuxppc-dev, linux-s390, linux-sh,
	sparclinux, linux-mm

By dropping support for hugepages on machines which do not have
the hardware feature EDAT1, we fix a potential s390 KVM bug.

The bug would happen if a guest is backed by hugetlbfs (not supported currently),
but does not get pagetables with PGSTE.
This would lead to random memory overwrites.

Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
---
 arch/s390/include/asm/page.h | 8 ++++----
 arch/s390/kernel/setup.c     | 2 ++
 arch/s390/mm/pgtable.c       | 2 ++
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/s390/include/asm/page.h b/arch/s390/include/asm/page.h
index 53eacbd..0844b78 100644
--- a/arch/s390/include/asm/page.h
+++ b/arch/s390/include/asm/page.h
@@ -17,7 +17,10 @@
 #define PAGE_DEFAULT_ACC	0
 #define PAGE_DEFAULT_KEY	(PAGE_DEFAULT_ACC << 4)
 
-#define HPAGE_SHIFT	20
+#include <asm/setup.h>
+#ifndef __ASSEMBLY__
+
+extern unsigned int HPAGE_SHIFT;
 #define HPAGE_SIZE	(1UL << HPAGE_SHIFT)
 #define HPAGE_MASK	(~(HPAGE_SIZE - 1))
 #define HUGETLB_PAGE_ORDER	(HPAGE_SHIFT - PAGE_SHIFT)
@@ -27,9 +30,6 @@
 #define ARCH_HAS_PREPARE_HUGEPAGE
 #define ARCH_HAS_HUGEPAGE_CLEAR_FLUSH
 
-#include <asm/setup.h>
-#ifndef __ASSEMBLY__
-
 static inline void storage_key_init_range(unsigned long start, unsigned long end)
 {
 #if PAGE_DEFAULT_KEY
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index a5ea8bc..9ac282b 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -915,6 +915,8 @@ void __init setup_arch(char **cmdline_p)
 	 */
 	setup_hwcaps();
 
+	HPAGE_SHIFT = MACHINE_HAS_HPAGE ? 20 : 0;
+
 	/*
 	 * Create kernel page tables and switch to virtual addressing.
 	 */
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
index b2c1542..f76791e 100644
--- a/arch/s390/mm/pgtable.c
+++ b/arch/s390/mm/pgtable.c
@@ -36,6 +36,8 @@
 #endif
 
 
+unsigned int HPAGE_SHIFT;
+
 unsigned long *crst_table_alloc(struct mm_struct *mm)
 {
 	struct page *page = alloc_pages(GFP_KERNEL, ALLOC_ORDER);
-- 
2.3.7

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 1/5] s390/mm: make hugepages_supported a boot time decision
@ 2015-05-28 11:52   ` Dominik Dingel
  0 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-05-28 11:52 UTC (permalink / raw)
  To: linux-arm-kernel

By dropping support for hugepages on machines which do not have
the hardware feature EDAT1, we fix a potential s390 KVM bug.

The bug would happen if a guest is backed by hugetlbfs (not supported currently),
but does not get pagetables with PGSTE.
This would lead to random memory overwrites.

Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
---
 arch/s390/include/asm/page.h | 8 ++++----
 arch/s390/kernel/setup.c     | 2 ++
 arch/s390/mm/pgtable.c       | 2 ++
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/s390/include/asm/page.h b/arch/s390/include/asm/page.h
index 53eacbd..0844b78 100644
--- a/arch/s390/include/asm/page.h
+++ b/arch/s390/include/asm/page.h
@@ -17,7 +17,10 @@
 #define PAGE_DEFAULT_ACC	0
 #define PAGE_DEFAULT_KEY	(PAGE_DEFAULT_ACC << 4)
 
-#define HPAGE_SHIFT	20
+#include <asm/setup.h>
+#ifndef __ASSEMBLY__
+
+extern unsigned int HPAGE_SHIFT;
 #define HPAGE_SIZE	(1UL << HPAGE_SHIFT)
 #define HPAGE_MASK	(~(HPAGE_SIZE - 1))
 #define HUGETLB_PAGE_ORDER	(HPAGE_SHIFT - PAGE_SHIFT)
@@ -27,9 +30,6 @@
 #define ARCH_HAS_PREPARE_HUGEPAGE
 #define ARCH_HAS_HUGEPAGE_CLEAR_FLUSH
 
-#include <asm/setup.h>
-#ifndef __ASSEMBLY__
-
 static inline void storage_key_init_range(unsigned long start, unsigned long end)
 {
 #if PAGE_DEFAULT_KEY
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index a5ea8bc..9ac282b 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -915,6 +915,8 @@ void __init setup_arch(char **cmdline_p)
 	 */
 	setup_hwcaps();
 
+	HPAGE_SHIFT = MACHINE_HAS_HPAGE ? 20 : 0;
+
 	/*
 	 * Create kernel page tables and switch to virtual addressing.
 	 */
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
index b2c1542..f76791e 100644
--- a/arch/s390/mm/pgtable.c
+++ b/arch/s390/mm/pgtable.c
@@ -36,6 +36,8 @@
 #endif
 
 
+unsigned int HPAGE_SHIFT;
+
 unsigned long *crst_table_alloc(struct mm_struct *mm)
 {
 	struct page *page = alloc_pages(GFP_KERNEL, ALLOC_ORDER);
-- 
2.3.7

^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 1/5] s390/mm: make hugepages_supported a boot time decision
@ 2015-05-28 11:52   ` Dominik Dingel
  0 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-05-28 11:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: Russell King, Catalin Marinas, Will Deacon, Tony Luck,
	Fenghua Yu, James Hogan, Ralf Baechle, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Martin Schwidefsky,
	Heiko Carstens, linux390, David S. Miller, Chris Metcalf,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Andrew Morton,
	Zhang Zhen, Dominik Dingel, David Rientjes, Aneesh

By dropping support for hugepages on machines which do not have
the hardware feature EDAT1, we fix a potential s390 KVM bug.

The bug would happen if a guest is backed by hugetlbfs (not supported currently),
but does not get pagetables with PGSTE.
This would lead to random memory overwrites.

Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
---
 arch/s390/include/asm/page.h | 8 ++++----
 arch/s390/kernel/setup.c     | 2 ++
 arch/s390/mm/pgtable.c       | 2 ++
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/s390/include/asm/page.h b/arch/s390/include/asm/page.h
index 53eacbd..0844b78 100644
--- a/arch/s390/include/asm/page.h
+++ b/arch/s390/include/asm/page.h
@@ -17,7 +17,10 @@
 #define PAGE_DEFAULT_ACC	0
 #define PAGE_DEFAULT_KEY	(PAGE_DEFAULT_ACC << 4)
 
-#define HPAGE_SHIFT	20
+#include <asm/setup.h>
+#ifndef __ASSEMBLY__
+
+extern unsigned int HPAGE_SHIFT;
 #define HPAGE_SIZE	(1UL << HPAGE_SHIFT)
 #define HPAGE_MASK	(~(HPAGE_SIZE - 1))
 #define HUGETLB_PAGE_ORDER	(HPAGE_SHIFT - PAGE_SHIFT)
@@ -27,9 +30,6 @@
 #define ARCH_HAS_PREPARE_HUGEPAGE
 #define ARCH_HAS_HUGEPAGE_CLEAR_FLUSH
 
-#include <asm/setup.h>
-#ifndef __ASSEMBLY__
-
 static inline void storage_key_init_range(unsigned long start, unsigned long end)
 {
 #if PAGE_DEFAULT_KEY
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index a5ea8bc..9ac282b 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -915,6 +915,8 @@ void __init setup_arch(char **cmdline_p)
 	 */
 	setup_hwcaps();
 
+	HPAGE_SHIFT = MACHINE_HAS_HPAGE ? 20 : 0;
+
 	/*
 	 * Create kernel page tables and switch to virtual addressing.
 	 */
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
index b2c1542..f76791e 100644
--- a/arch/s390/mm/pgtable.c
+++ b/arch/s390/mm/pgtable.c
@@ -36,6 +36,8 @@
 #endif
 
 
+unsigned int HPAGE_SHIFT;
+
 unsigned long *crst_table_alloc(struct mm_struct *mm)
 {
 	struct page *page = alloc_pages(GFP_KERNEL, ALLOC_ORDER);
-- 
2.3.7


^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 2/5] mm/hugetlb: remove unused arch hook prepare/release_hugepage
  2015-05-28 11:52 ` Dominik Dingel
                     ` (2 preceding siblings ...)
  (?)
@ 2015-05-28 11:52   ` Dominik Dingel
  -1 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-05-28 11:52 UTC (permalink / raw)
  To: linux-arm-kernel

With s390 dropping support for emulated hugepages, the last user of
arch_prepare_hugepage and arch_release_hugepage is gone.

Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
---
 mm/hugetlb.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 290984b..a97958e 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -917,7 +917,6 @@ static void update_and_free_page(struct hstate *h, struct page *page)
 		destroy_compound_gigantic_page(page, huge_page_order(h));
 		free_gigantic_page(page, huge_page_order(h));
 	} else {
-		arch_release_hugepage(page);
 		__free_pages(page, huge_page_order(h));
 	}
 }
@@ -1102,10 +1101,6 @@ static struct page *alloc_fresh_huge_page_node(struct hstate *h, int nid)
 						__GFP_REPEAT|__GFP_NOWARN,
 		huge_page_order(h));
 	if (page) {
-		if (arch_prepare_hugepage(page)) {
-			__free_pages(page, huge_page_order(h));
-			return NULL;
-		}
 		prep_new_huge_page(h, page, nid);
 	}
 
@@ -1257,11 +1252,6 @@ static struct page *alloc_buddy_huge_page(struct hstate *h, int nid)
 			htlb_alloc_mask(h)|__GFP_COMP|__GFP_THISNODE|
 			__GFP_REPEAT|__GFP_NOWARN, huge_page_order(h));
 
-	if (page && arch_prepare_hugepage(page)) {
-		__free_pages(page, huge_page_order(h));
-		page = NULL;
-	}
-
 	spin_lock(&hugetlb_lock);
 	if (page) {
 		INIT_LIST_HEAD(&page->lru);
-- 
2.3.7


^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 2/5] mm/hugetlb: remove unused arch hook prepare/release_hugepage
@ 2015-05-28 11:52   ` Dominik Dingel
  0 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-05-28 11:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: Russell King, Catalin Marinas, Will Deacon, Tony Luck,
	Fenghua Yu, James Hogan, Ralf Baechle, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Martin Schwidefsky,
	Heiko Carstens, linux390, David S. Miller, Chris Metcalf,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Andrew Morton,
	Zhang Zhen, Dominik Dingel, David Rientjes, Aneesh Kumar K.V,
	Nathan Lynch, Christian Borntraeger, Andy Lutomirski,
	Michael Holzheu, Hugh Dickins, Naoya Horiguchi, Paolo Bonzini,
	Jason J. Herne, Davidlohr Bueso, Kirill A. Shutemov,
	Luiz Capitulino, Mike Kravetz, linux-arm-kernel, linux-ia64,
	linux-metag, linux-mips, linuxppc-dev, linux-s390, linux-sh,
	sparclinux, linux-mm

With s390 dropping support for emulated hugepages, the last user of
arch_prepare_hugepage and arch_release_hugepage is gone.

Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
---
 mm/hugetlb.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 290984b..a97958e 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -917,7 +917,6 @@ static void update_and_free_page(struct hstate *h, struct page *page)
 		destroy_compound_gigantic_page(page, huge_page_order(h));
 		free_gigantic_page(page, huge_page_order(h));
 	} else {
-		arch_release_hugepage(page);
 		__free_pages(page, huge_page_order(h));
 	}
 }
@@ -1102,10 +1101,6 @@ static struct page *alloc_fresh_huge_page_node(struct hstate *h, int nid)
 						__GFP_REPEAT|__GFP_NOWARN,
 		huge_page_order(h));
 	if (page) {
-		if (arch_prepare_hugepage(page)) {
-			__free_pages(page, huge_page_order(h));
-			return NULL;
-		}
 		prep_new_huge_page(h, page, nid);
 	}
 
@@ -1257,11 +1252,6 @@ static struct page *alloc_buddy_huge_page(struct hstate *h, int nid)
 			htlb_alloc_mask(h)|__GFP_COMP|__GFP_THISNODE|
 			__GFP_REPEAT|__GFP_NOWARN, huge_page_order(h));
 
-	if (page && arch_prepare_hugepage(page)) {
-		__free_pages(page, huge_page_order(h));
-		page = NULL;
-	}
-
 	spin_lock(&hugetlb_lock);
 	if (page) {
 		INIT_LIST_HEAD(&page->lru);
-- 
2.3.7


^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 2/5] mm/hugetlb: remove unused arch hook prepare/release_hugepage
@ 2015-05-28 11:52   ` Dominik Dingel
  0 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-05-28 11:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: Russell King, Catalin Marinas, Will Deacon, Tony Luck,
	Fenghua Yu, James Hogan, Ralf Baechle, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Martin Schwidefsky,
	Heiko Carstens, linux390, David S. Miller, Chris Metcalf,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Andrew Morton,
	Zhang Zhen, Dominik Dingel, David Rientjes, Aneesh Kumar K.V,
	Nathan Lynch, Christian Borntraeger, Andy Lutomirski,
	Michael Holzheu, Hugh Dickins, Naoya Horiguchi, Paolo Bonzini,
	Jason J. Herne, Davidlohr Bueso, Kirill A. Shutemov,
	Luiz Capitulino, Mike Kravetz, linux-arm-kernel, linux-ia64,
	linux-metag, linux-mips, linuxppc-dev, linux-s390, linux-sh,
	sparclinux, linux-mm

With s390 dropping support for emulated hugepages, the last user of
arch_prepare_hugepage and arch_release_hugepage is gone.

Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
---
 mm/hugetlb.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 290984b..a97958e 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -917,7 +917,6 @@ static void update_and_free_page(struct hstate *h, struct page *page)
 		destroy_compound_gigantic_page(page, huge_page_order(h));
 		free_gigantic_page(page, huge_page_order(h));
 	} else {
-		arch_release_hugepage(page);
 		__free_pages(page, huge_page_order(h));
 	}
 }
@@ -1102,10 +1101,6 @@ static struct page *alloc_fresh_huge_page_node(struct hstate *h, int nid)
 						__GFP_REPEAT|__GFP_NOWARN,
 		huge_page_order(h));
 	if (page) {
-		if (arch_prepare_hugepage(page)) {
-			__free_pages(page, huge_page_order(h));
-			return NULL;
-		}
 		prep_new_huge_page(h, page, nid);
 	}
 
@@ -1257,11 +1252,6 @@ static struct page *alloc_buddy_huge_page(struct hstate *h, int nid)
 			htlb_alloc_mask(h)|__GFP_COMP|__GFP_THISNODE|
 			__GFP_REPEAT|__GFP_NOWARN, huge_page_order(h));
 
-	if (page && arch_prepare_hugepage(page)) {
-		__free_pages(page, huge_page_order(h));
-		page = NULL;
-	}
-
 	spin_lock(&hugetlb_lock);
 	if (page) {
 		INIT_LIST_HEAD(&page->lru);
-- 
2.3.7

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 2/5] mm/hugetlb: remove unused arch hook prepare/release_hugepage
@ 2015-05-28 11:52   ` Dominik Dingel
  0 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-05-28 11:52 UTC (permalink / raw)
  To: linux-arm-kernel

With s390 dropping support for emulated hugepages, the last user of
arch_prepare_hugepage and arch_release_hugepage is gone.

Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
---
 mm/hugetlb.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 290984b..a97958e 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -917,7 +917,6 @@ static void update_and_free_page(struct hstate *h, struct page *page)
 		destroy_compound_gigantic_page(page, huge_page_order(h));
 		free_gigantic_page(page, huge_page_order(h));
 	} else {
-		arch_release_hugepage(page);
 		__free_pages(page, huge_page_order(h));
 	}
 }
@@ -1102,10 +1101,6 @@ static struct page *alloc_fresh_huge_page_node(struct hstate *h, int nid)
 						__GFP_REPEAT|__GFP_NOWARN,
 		huge_page_order(h));
 	if (page) {
-		if (arch_prepare_hugepage(page)) {
-			__free_pages(page, huge_page_order(h));
-			return NULL;
-		}
 		prep_new_huge_page(h, page, nid);
 	}
 
@@ -1257,11 +1252,6 @@ static struct page *alloc_buddy_huge_page(struct hstate *h, int nid)
 			htlb_alloc_mask(h)|__GFP_COMP|__GFP_THISNODE|
 			__GFP_REPEAT|__GFP_NOWARN, huge_page_order(h));
 
-	if (page && arch_prepare_hugepage(page)) {
-		__free_pages(page, huge_page_order(h));
-		page = NULL;
-	}
-
 	spin_lock(&hugetlb_lock);
 	if (page) {
 		INIT_LIST_HEAD(&page->lru);
-- 
2.3.7

^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 2/5] mm/hugetlb: remove unused arch hook prepare/release_hugepage
@ 2015-05-28 11:52   ` Dominik Dingel
  0 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-05-28 11:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: Russell King, Catalin Marinas, Will Deacon, Tony Luck,
	Fenghua Yu, James Hogan, Ralf Baechle, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Martin Schwidefsky,
	Heiko Carstens, linux390, David S. Miller, Chris Metcalf,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Andrew Morton,
	Zhang Zhen

With s390 dropping support for emulated hugepages, the last user of
arch_prepare_hugepage and arch_release_hugepage is gone.

Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
---
 mm/hugetlb.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 290984b..a97958e 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -917,7 +917,6 @@ static void update_and_free_page(struct hstate *h, struct page *page)
 		destroy_compound_gigantic_page(page, huge_page_order(h));
 		free_gigantic_page(page, huge_page_order(h));
 	} else {
-		arch_release_hugepage(page);
 		__free_pages(page, huge_page_order(h));
 	}
 }
@@ -1102,10 +1101,6 @@ static struct page *alloc_fresh_huge_page_node(struct hstate *h, int nid)
 						__GFP_REPEAT|__GFP_NOWARN,
 		huge_page_order(h));
 	if (page) {
-		if (arch_prepare_hugepage(page)) {
-			__free_pages(page, huge_page_order(h));
-			return NULL;
-		}
 		prep_new_huge_page(h, page, nid);
 	}
 
@@ -1257,11 +1252,6 @@ static struct page *alloc_buddy_huge_page(struct hstate *h, int nid)
 			htlb_alloc_mask(h)|__GFP_COMP|__GFP_THISNODE|
 			__GFP_REPEAT|__GFP_NOWARN, huge_page_order(h));
 
-	if (page && arch_prepare_hugepage(page)) {
-		__free_pages(page, huge_page_order(h));
-		page = NULL;
-	}
-
 	spin_lock(&hugetlb_lock);
 	if (page) {
 		INIT_LIST_HEAD(&page->lru);
-- 
2.3.7



^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 3/5] mm/hugetlb: remove arch_prepare/release_hugepage from arch headers
  2015-05-28 11:52 ` Dominik Dingel
                     ` (2 preceding siblings ...)
  (?)
@ 2015-05-28 11:52   ` Dominik Dingel
  -1 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-05-28 11:52 UTC (permalink / raw)
  To: linux-arm-kernel

Nobody used these hooks so they were removed from common code,
and can now be removed from the architectures.

Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
---
 arch/arm/include/asm/hugetlb.h     | 9 ---------
 arch/arm64/include/asm/hugetlb.h   | 9 ---------
 arch/ia64/include/asm/hugetlb.h    | 9 ---------
 arch/metag/include/asm/hugetlb.h   | 9 ---------
 arch/mips/include/asm/hugetlb.h    | 9 ---------
 arch/powerpc/include/asm/hugetlb.h | 9 ---------
 arch/sh/include/asm/hugetlb.h      | 9 ---------
 arch/sparc/include/asm/hugetlb.h   | 9 ---------
 arch/tile/include/asm/hugetlb.h    | 9 ---------
 arch/x86/include/asm/hugetlb.h     | 9 ---------
 10 files changed, 90 deletions(-)

diff --git a/arch/arm/include/asm/hugetlb.h b/arch/arm/include/asm/hugetlb.h
index 31bb7dc..7d26f6c 100644
--- a/arch/arm/include/asm/hugetlb.h
+++ b/arch/arm/include/asm/hugetlb.h
@@ -63,15 +63,6 @@ static inline pte_t huge_pte_wrprotect(pte_t pte)
 	return pte_wrprotect(pte);
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 	clear_bit(PG_dcache_clean, &page->flags);
diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h
index 734c17e..2fd9b14 100644
--- a/arch/arm64/include/asm/hugetlb.h
+++ b/arch/arm64/include/asm/hugetlb.h
@@ -96,15 +96,6 @@ static inline pte_t huge_pte_wrprotect(pte_t pte)
 	return pte_wrprotect(pte);
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 	clear_bit(PG_dcache_clean, &page->flags);
diff --git a/arch/ia64/include/asm/hugetlb.h b/arch/ia64/include/asm/hugetlb.h
index ff1377b..ef65f02 100644
--- a/arch/ia64/include/asm/hugetlb.h
+++ b/arch/ia64/include/asm/hugetlb.h
@@ -65,15 +65,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/metag/include/asm/hugetlb.h b/arch/metag/include/asm/hugetlb.h
index f730b39..905ed42 100644
--- a/arch/metag/include/asm/hugetlb.h
+++ b/arch/metag/include/asm/hugetlb.h
@@ -67,15 +67,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/mips/include/asm/hugetlb.h b/arch/mips/include/asm/hugetlb.h
index 4a5bb54..982bc06 100644
--- a/arch/mips/include/asm/hugetlb.h
+++ b/arch/mips/include/asm/hugetlb.h
@@ -110,15 +110,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h
index 4bbd3c8..7eac89b 100644
--- a/arch/powerpc/include/asm/hugetlb.h
+++ b/arch/powerpc/include/asm/hugetlb.h
@@ -168,15 +168,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/sh/include/asm/hugetlb.h b/arch/sh/include/asm/hugetlb.h
index b788a9b..ef489a5 100644
--- a/arch/sh/include/asm/hugetlb.h
+++ b/arch/sh/include/asm/hugetlb.h
@@ -79,15 +79,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 	clear_bit(PG_dcache_clean, &page->flags);
diff --git a/arch/sparc/include/asm/hugetlb.h b/arch/sparc/include/asm/hugetlb.h
index 3130d76..139e711 100644
--- a/arch/sparc/include/asm/hugetlb.h
+++ b/arch/sparc/include/asm/hugetlb.h
@@ -78,15 +78,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/tile/include/asm/hugetlb.h b/arch/tile/include/asm/hugetlb.h
index 1abd00c..2fac5be 100644
--- a/arch/tile/include/asm/hugetlb.h
+++ b/arch/tile/include/asm/hugetlb.h
@@ -94,15 +94,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/x86/include/asm/hugetlb.h b/arch/x86/include/asm/hugetlb.h
index dab7a3a..f8a29d2 100644
--- a/arch/x86/include/asm/hugetlb.h
+++ b/arch/x86/include/asm/hugetlb.h
@@ -80,15 +80,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
-- 
2.3.7


^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 3/5] mm/hugetlb: remove arch_prepare/release_hugepage from arch headers
@ 2015-05-28 11:52   ` Dominik Dingel
  0 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-05-28 11:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: Russell King, Catalin Marinas, Will Deacon, Tony Luck,
	Fenghua Yu, James Hogan, Ralf Baechle, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Martin Schwidefsky,
	Heiko Carstens, linux390, David S. Miller, Chris Metcalf,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Andrew Morton,
	Zhang Zhen, Dominik Dingel, David Rientjes, Aneesh Kumar K.V,
	Nathan Lynch, Christian Borntraeger, Andy Lutomirski,
	Michael Holzheu, Hugh Dickins, Naoya Horiguchi, Paolo Bonzini,
	Jason J. Herne, Davidlohr Bueso, Kirill A. Shutemov,
	Luiz Capitulino, Mike Kravetz, linux-arm-kernel, linux-ia64,
	linux-metag, linux-mips, linuxppc-dev, linux-s390, linux-sh,
	sparclinux, linux-mm

Nobody used these hooks so they were removed from common code,
and can now be removed from the architectures.

Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
---
 arch/arm/include/asm/hugetlb.h     | 9 ---------
 arch/arm64/include/asm/hugetlb.h   | 9 ---------
 arch/ia64/include/asm/hugetlb.h    | 9 ---------
 arch/metag/include/asm/hugetlb.h   | 9 ---------
 arch/mips/include/asm/hugetlb.h    | 9 ---------
 arch/powerpc/include/asm/hugetlb.h | 9 ---------
 arch/sh/include/asm/hugetlb.h      | 9 ---------
 arch/sparc/include/asm/hugetlb.h   | 9 ---------
 arch/tile/include/asm/hugetlb.h    | 9 ---------
 arch/x86/include/asm/hugetlb.h     | 9 ---------
 10 files changed, 90 deletions(-)

diff --git a/arch/arm/include/asm/hugetlb.h b/arch/arm/include/asm/hugetlb.h
index 31bb7dc..7d26f6c 100644
--- a/arch/arm/include/asm/hugetlb.h
+++ b/arch/arm/include/asm/hugetlb.h
@@ -63,15 +63,6 @@ static inline pte_t huge_pte_wrprotect(pte_t pte)
 	return pte_wrprotect(pte);
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 	clear_bit(PG_dcache_clean, &page->flags);
diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h
index 734c17e..2fd9b14 100644
--- a/arch/arm64/include/asm/hugetlb.h
+++ b/arch/arm64/include/asm/hugetlb.h
@@ -96,15 +96,6 @@ static inline pte_t huge_pte_wrprotect(pte_t pte)
 	return pte_wrprotect(pte);
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 	clear_bit(PG_dcache_clean, &page->flags);
diff --git a/arch/ia64/include/asm/hugetlb.h b/arch/ia64/include/asm/hugetlb.h
index ff1377b..ef65f02 100644
--- a/arch/ia64/include/asm/hugetlb.h
+++ b/arch/ia64/include/asm/hugetlb.h
@@ -65,15 +65,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/metag/include/asm/hugetlb.h b/arch/metag/include/asm/hugetlb.h
index f730b39..905ed42 100644
--- a/arch/metag/include/asm/hugetlb.h
+++ b/arch/metag/include/asm/hugetlb.h
@@ -67,15 +67,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/mips/include/asm/hugetlb.h b/arch/mips/include/asm/hugetlb.h
index 4a5bb54..982bc06 100644
--- a/arch/mips/include/asm/hugetlb.h
+++ b/arch/mips/include/asm/hugetlb.h
@@ -110,15 +110,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h
index 4bbd3c8..7eac89b 100644
--- a/arch/powerpc/include/asm/hugetlb.h
+++ b/arch/powerpc/include/asm/hugetlb.h
@@ -168,15 +168,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/sh/include/asm/hugetlb.h b/arch/sh/include/asm/hugetlb.h
index b788a9b..ef489a5 100644
--- a/arch/sh/include/asm/hugetlb.h
+++ b/arch/sh/include/asm/hugetlb.h
@@ -79,15 +79,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 	clear_bit(PG_dcache_clean, &page->flags);
diff --git a/arch/sparc/include/asm/hugetlb.h b/arch/sparc/include/asm/hugetlb.h
index 3130d76..139e711 100644
--- a/arch/sparc/include/asm/hugetlb.h
+++ b/arch/sparc/include/asm/hugetlb.h
@@ -78,15 +78,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/tile/include/asm/hugetlb.h b/arch/tile/include/asm/hugetlb.h
index 1abd00c..2fac5be 100644
--- a/arch/tile/include/asm/hugetlb.h
+++ b/arch/tile/include/asm/hugetlb.h
@@ -94,15 +94,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/x86/include/asm/hugetlb.h b/arch/x86/include/asm/hugetlb.h
index dab7a3a..f8a29d2 100644
--- a/arch/x86/include/asm/hugetlb.h
+++ b/arch/x86/include/asm/hugetlb.h
@@ -80,15 +80,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
-- 
2.3.7


^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 3/5] mm/hugetlb: remove arch_prepare/release_hugepage from arch headers
@ 2015-05-28 11:52   ` Dominik Dingel
  0 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-05-28 11:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: Russell King, Catalin Marinas, Will Deacon, Tony Luck,
	Fenghua Yu, James Hogan, Ralf Baechle, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Martin Schwidefsky,
	Heiko Carstens, linux390, David S. Miller, Chris Metcalf,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Andrew Morton,
	Zhang Zhen, Dominik Dingel, David Rientjes, Aneesh Kumar K.V,
	Nathan Lynch, Christian Borntraeger, Andy Lutomirski,
	Michael Holzheu, Hugh Dickins, Naoya Horiguchi, Paolo Bonzini,
	Jason J. Herne, Davidlohr Bueso, Kirill A. Shutemov,
	Luiz Capitulino, Mike Kravetz, linux-arm-kernel, linux-ia64,
	linux-metag, linux-mips, linuxppc-dev, linux-s390, linux-sh,
	sparclinux, linux-mm

Nobody used these hooks so they were removed from common code,
and can now be removed from the architectures.

Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
---
 arch/arm/include/asm/hugetlb.h     | 9 ---------
 arch/arm64/include/asm/hugetlb.h   | 9 ---------
 arch/ia64/include/asm/hugetlb.h    | 9 ---------
 arch/metag/include/asm/hugetlb.h   | 9 ---------
 arch/mips/include/asm/hugetlb.h    | 9 ---------
 arch/powerpc/include/asm/hugetlb.h | 9 ---------
 arch/sh/include/asm/hugetlb.h      | 9 ---------
 arch/sparc/include/asm/hugetlb.h   | 9 ---------
 arch/tile/include/asm/hugetlb.h    | 9 ---------
 arch/x86/include/asm/hugetlb.h     | 9 ---------
 10 files changed, 90 deletions(-)

diff --git a/arch/arm/include/asm/hugetlb.h b/arch/arm/include/asm/hugetlb.h
index 31bb7dc..7d26f6c 100644
--- a/arch/arm/include/asm/hugetlb.h
+++ b/arch/arm/include/asm/hugetlb.h
@@ -63,15 +63,6 @@ static inline pte_t huge_pte_wrprotect(pte_t pte)
 	return pte_wrprotect(pte);
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 	clear_bit(PG_dcache_clean, &page->flags);
diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h
index 734c17e..2fd9b14 100644
--- a/arch/arm64/include/asm/hugetlb.h
+++ b/arch/arm64/include/asm/hugetlb.h
@@ -96,15 +96,6 @@ static inline pte_t huge_pte_wrprotect(pte_t pte)
 	return pte_wrprotect(pte);
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 	clear_bit(PG_dcache_clean, &page->flags);
diff --git a/arch/ia64/include/asm/hugetlb.h b/arch/ia64/include/asm/hugetlb.h
index ff1377b..ef65f02 100644
--- a/arch/ia64/include/asm/hugetlb.h
+++ b/arch/ia64/include/asm/hugetlb.h
@@ -65,15 +65,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/metag/include/asm/hugetlb.h b/arch/metag/include/asm/hugetlb.h
index f730b39..905ed42 100644
--- a/arch/metag/include/asm/hugetlb.h
+++ b/arch/metag/include/asm/hugetlb.h
@@ -67,15 +67,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/mips/include/asm/hugetlb.h b/arch/mips/include/asm/hugetlb.h
index 4a5bb54..982bc06 100644
--- a/arch/mips/include/asm/hugetlb.h
+++ b/arch/mips/include/asm/hugetlb.h
@@ -110,15 +110,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h
index 4bbd3c8..7eac89b 100644
--- a/arch/powerpc/include/asm/hugetlb.h
+++ b/arch/powerpc/include/asm/hugetlb.h
@@ -168,15 +168,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/sh/include/asm/hugetlb.h b/arch/sh/include/asm/hugetlb.h
index b788a9b..ef489a5 100644
--- a/arch/sh/include/asm/hugetlb.h
+++ b/arch/sh/include/asm/hugetlb.h
@@ -79,15 +79,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 	clear_bit(PG_dcache_clean, &page->flags);
diff --git a/arch/sparc/include/asm/hugetlb.h b/arch/sparc/include/asm/hugetlb.h
index 3130d76..139e711 100644
--- a/arch/sparc/include/asm/hugetlb.h
+++ b/arch/sparc/include/asm/hugetlb.h
@@ -78,15 +78,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/tile/include/asm/hugetlb.h b/arch/tile/include/asm/hugetlb.h
index 1abd00c..2fac5be 100644
--- a/arch/tile/include/asm/hugetlb.h
+++ b/arch/tile/include/asm/hugetlb.h
@@ -94,15 +94,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/x86/include/asm/hugetlb.h b/arch/x86/include/asm/hugetlb.h
index dab7a3a..f8a29d2 100644
--- a/arch/x86/include/asm/hugetlb.h
+++ b/arch/x86/include/asm/hugetlb.h
@@ -80,15 +80,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
-- 
2.3.7

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 3/5] mm/hugetlb: remove arch_prepare/release_hugepage from arch headers
@ 2015-05-28 11:52   ` Dominik Dingel
  0 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-05-28 11:52 UTC (permalink / raw)
  To: linux-arm-kernel

Nobody used these hooks so they were removed from common code,
and can now be removed from the architectures.

Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
---
 arch/arm/include/asm/hugetlb.h     | 9 ---------
 arch/arm64/include/asm/hugetlb.h   | 9 ---------
 arch/ia64/include/asm/hugetlb.h    | 9 ---------
 arch/metag/include/asm/hugetlb.h   | 9 ---------
 arch/mips/include/asm/hugetlb.h    | 9 ---------
 arch/powerpc/include/asm/hugetlb.h | 9 ---------
 arch/sh/include/asm/hugetlb.h      | 9 ---------
 arch/sparc/include/asm/hugetlb.h   | 9 ---------
 arch/tile/include/asm/hugetlb.h    | 9 ---------
 arch/x86/include/asm/hugetlb.h     | 9 ---------
 10 files changed, 90 deletions(-)

diff --git a/arch/arm/include/asm/hugetlb.h b/arch/arm/include/asm/hugetlb.h
index 31bb7dc..7d26f6c 100644
--- a/arch/arm/include/asm/hugetlb.h
+++ b/arch/arm/include/asm/hugetlb.h
@@ -63,15 +63,6 @@ static inline pte_t huge_pte_wrprotect(pte_t pte)
 	return pte_wrprotect(pte);
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 	clear_bit(PG_dcache_clean, &page->flags);
diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h
index 734c17e..2fd9b14 100644
--- a/arch/arm64/include/asm/hugetlb.h
+++ b/arch/arm64/include/asm/hugetlb.h
@@ -96,15 +96,6 @@ static inline pte_t huge_pte_wrprotect(pte_t pte)
 	return pte_wrprotect(pte);
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 	clear_bit(PG_dcache_clean, &page->flags);
diff --git a/arch/ia64/include/asm/hugetlb.h b/arch/ia64/include/asm/hugetlb.h
index ff1377b..ef65f02 100644
--- a/arch/ia64/include/asm/hugetlb.h
+++ b/arch/ia64/include/asm/hugetlb.h
@@ -65,15 +65,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/metag/include/asm/hugetlb.h b/arch/metag/include/asm/hugetlb.h
index f730b39..905ed42 100644
--- a/arch/metag/include/asm/hugetlb.h
+++ b/arch/metag/include/asm/hugetlb.h
@@ -67,15 +67,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/mips/include/asm/hugetlb.h b/arch/mips/include/asm/hugetlb.h
index 4a5bb54..982bc06 100644
--- a/arch/mips/include/asm/hugetlb.h
+++ b/arch/mips/include/asm/hugetlb.h
@@ -110,15 +110,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h
index 4bbd3c8..7eac89b 100644
--- a/arch/powerpc/include/asm/hugetlb.h
+++ b/arch/powerpc/include/asm/hugetlb.h
@@ -168,15 +168,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/sh/include/asm/hugetlb.h b/arch/sh/include/asm/hugetlb.h
index b788a9b..ef489a5 100644
--- a/arch/sh/include/asm/hugetlb.h
+++ b/arch/sh/include/asm/hugetlb.h
@@ -79,15 +79,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 	clear_bit(PG_dcache_clean, &page->flags);
diff --git a/arch/sparc/include/asm/hugetlb.h b/arch/sparc/include/asm/hugetlb.h
index 3130d76..139e711 100644
--- a/arch/sparc/include/asm/hugetlb.h
+++ b/arch/sparc/include/asm/hugetlb.h
@@ -78,15 +78,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/tile/include/asm/hugetlb.h b/arch/tile/include/asm/hugetlb.h
index 1abd00c..2fac5be 100644
--- a/arch/tile/include/asm/hugetlb.h
+++ b/arch/tile/include/asm/hugetlb.h
@@ -94,15 +94,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/x86/include/asm/hugetlb.h b/arch/x86/include/asm/hugetlb.h
index dab7a3a..f8a29d2 100644
--- a/arch/x86/include/asm/hugetlb.h
+++ b/arch/x86/include/asm/hugetlb.h
@@ -80,15 +80,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
-- 
2.3.7

^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 3/5] mm/hugetlb: remove arch_prepare/release_hugepage from arch headers
@ 2015-05-28 11:52   ` Dominik Dingel
  0 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-05-28 11:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: Russell King, Catalin Marinas, Will Deacon, Tony Luck,
	Fenghua Yu, James Hogan, Ralf Baechle, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Martin Schwidefsky,
	Heiko Carstens, linux390, David S. Miller, Chris Metcalf,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Andrew Morton,
	Zhang Zhen

Nobody used these hooks so they were removed from common code,
and can now be removed from the architectures.

Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
---
 arch/arm/include/asm/hugetlb.h     | 9 ---------
 arch/arm64/include/asm/hugetlb.h   | 9 ---------
 arch/ia64/include/asm/hugetlb.h    | 9 ---------
 arch/metag/include/asm/hugetlb.h   | 9 ---------
 arch/mips/include/asm/hugetlb.h    | 9 ---------
 arch/powerpc/include/asm/hugetlb.h | 9 ---------
 arch/sh/include/asm/hugetlb.h      | 9 ---------
 arch/sparc/include/asm/hugetlb.h   | 9 ---------
 arch/tile/include/asm/hugetlb.h    | 9 ---------
 arch/x86/include/asm/hugetlb.h     | 9 ---------
 10 files changed, 90 deletions(-)

diff --git a/arch/arm/include/asm/hugetlb.h b/arch/arm/include/asm/hugetlb.h
index 31bb7dc..7d26f6c 100644
--- a/arch/arm/include/asm/hugetlb.h
+++ b/arch/arm/include/asm/hugetlb.h
@@ -63,15 +63,6 @@ static inline pte_t huge_pte_wrprotect(pte_t pte)
 	return pte_wrprotect(pte);
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 	clear_bit(PG_dcache_clean, &page->flags);
diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h
index 734c17e..2fd9b14 100644
--- a/arch/arm64/include/asm/hugetlb.h
+++ b/arch/arm64/include/asm/hugetlb.h
@@ -96,15 +96,6 @@ static inline pte_t huge_pte_wrprotect(pte_t pte)
 	return pte_wrprotect(pte);
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 	clear_bit(PG_dcache_clean, &page->flags);
diff --git a/arch/ia64/include/asm/hugetlb.h b/arch/ia64/include/asm/hugetlb.h
index ff1377b..ef65f02 100644
--- a/arch/ia64/include/asm/hugetlb.h
+++ b/arch/ia64/include/asm/hugetlb.h
@@ -65,15 +65,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/metag/include/asm/hugetlb.h b/arch/metag/include/asm/hugetlb.h
index f730b39..905ed42 100644
--- a/arch/metag/include/asm/hugetlb.h
+++ b/arch/metag/include/asm/hugetlb.h
@@ -67,15 +67,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/mips/include/asm/hugetlb.h b/arch/mips/include/asm/hugetlb.h
index 4a5bb54..982bc06 100644
--- a/arch/mips/include/asm/hugetlb.h
+++ b/arch/mips/include/asm/hugetlb.h
@@ -110,15 +110,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h
index 4bbd3c8..7eac89b 100644
--- a/arch/powerpc/include/asm/hugetlb.h
+++ b/arch/powerpc/include/asm/hugetlb.h
@@ -168,15 +168,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/sh/include/asm/hugetlb.h b/arch/sh/include/asm/hugetlb.h
index b788a9b..ef489a5 100644
--- a/arch/sh/include/asm/hugetlb.h
+++ b/arch/sh/include/asm/hugetlb.h
@@ -79,15 +79,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 	clear_bit(PG_dcache_clean, &page->flags);
diff --git a/arch/sparc/include/asm/hugetlb.h b/arch/sparc/include/asm/hugetlb.h
index 3130d76..139e711 100644
--- a/arch/sparc/include/asm/hugetlb.h
+++ b/arch/sparc/include/asm/hugetlb.h
@@ -78,15 +78,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/tile/include/asm/hugetlb.h b/arch/tile/include/asm/hugetlb.h
index 1abd00c..2fac5be 100644
--- a/arch/tile/include/asm/hugetlb.h
+++ b/arch/tile/include/asm/hugetlb.h
@@ -94,15 +94,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
diff --git a/arch/x86/include/asm/hugetlb.h b/arch/x86/include/asm/hugetlb.h
index dab7a3a..f8a29d2 100644
--- a/arch/x86/include/asm/hugetlb.h
+++ b/arch/x86/include/asm/hugetlb.h
@@ -80,15 +80,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
 	return *ptep;
 }
 
-static inline int arch_prepare_hugepage(struct page *page)
-{
-	return 0;
-}
-
-static inline void arch_release_hugepage(struct page *page)
-{
-}
-
 static inline void arch_clear_hugepage_flags(struct page *page)
 {
 }
-- 
2.3.7

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 4/5] s390/hugetlb: remove dead code for sw emulated huge pages
  2015-05-28 11:52 ` Dominik Dingel
                     ` (2 preceding siblings ...)
  (?)
@ 2015-05-28 11:52   ` Dominik Dingel
  -1 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-05-28 11:52 UTC (permalink / raw)
  To: linux-arm-kernel

We now support only hugepages on hardware with EDAT1 support.
So we remove the prepare/release_hugepage hooks and
simplify set_huge_pte_at and huge_ptep_get.

Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
---
 arch/s390/include/asm/hugetlb.h |  3 ---
 arch/s390/mm/hugetlbpage.c      | 60 +++--------------------------------------
 2 files changed, 3 insertions(+), 60 deletions(-)

diff --git a/arch/s390/include/asm/hugetlb.h b/arch/s390/include/asm/hugetlb.h
index dfb542a..0130d03 100644
--- a/arch/s390/include/asm/hugetlb.h
+++ b/arch/s390/include/asm/hugetlb.h
@@ -37,9 +37,6 @@ static inline int prepare_hugepage_range(struct file *file,
 
 #define arch_clear_hugepage_flags(page)		do { } while (0)
 
-int arch_prepare_hugepage(struct page *page);
-void arch_release_hugepage(struct page *page);
-
 static inline void huge_pte_clear(struct mm_struct *mm, unsigned long addr,
 				  pte_t *ptep)
 {
diff --git a/arch/s390/mm/hugetlbpage.c b/arch/s390/mm/hugetlbpage.c
index fa6e1bc..999616b 100644
--- a/arch/s390/mm/hugetlbpage.c
+++ b/arch/s390/mm/hugetlbpage.c
@@ -80,31 +80,16 @@ static inline pte_t __pmd_to_pte(pmd_t pmd)
 void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
 		     pte_t *ptep, pte_t pte)
 {
-	pmd_t pmd;
+	pmd_t pmd = __pte_to_pmd(pte);
 
-	pmd = __pte_to_pmd(pte);
-	if (!MACHINE_HAS_HPAGE) {
-		/* Emulated huge ptes loose the dirty and young bit */
-		pmd_val(pmd) &= ~_SEGMENT_ENTRY_ORIGIN;
-		pmd_val(pmd) |= pte_page(pte)[1].index;
-	} else
-		pmd_val(pmd) |= _SEGMENT_ENTRY_LARGE;
+	pmd_val(pmd) |= _SEGMENT_ENTRY_LARGE;
 	*(pmd_t *) ptep = pmd;
 }
 
 pte_t huge_ptep_get(pte_t *ptep)
 {
-	unsigned long origin;
-	pmd_t pmd;
+	pmd_t pmd = *(pmd_t *) ptep;
 
-	pmd = *(pmd_t *) ptep;
-	if (!MACHINE_HAS_HPAGE && pmd_present(pmd)) {
-		origin = pmd_val(pmd) & _SEGMENT_ENTRY_ORIGIN;
-		pmd_val(pmd) &= ~_SEGMENT_ENTRY_ORIGIN;
-		pmd_val(pmd) |= *(unsigned long *) origin;
-		/* Emulated huge ptes are young and dirty by definition */
-		pmd_val(pmd) |= _SEGMENT_ENTRY_YOUNG | _SEGMENT_ENTRY_DIRTY;
-	}
 	return __pmd_to_pte(pmd);
 }
 
@@ -119,45 +104,6 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
 	return pte;
 }
 
-int arch_prepare_hugepage(struct page *page)
-{
-	unsigned long addr = page_to_phys(page);
-	pte_t pte;
-	pte_t *ptep;
-	int i;
-
-	if (MACHINE_HAS_HPAGE)
-		return 0;
-
-	ptep = (pte_t *) pte_alloc_one(&init_mm, addr);
-	if (!ptep)
-		return -ENOMEM;
-
-	pte_val(pte) = addr;
-	for (i = 0; i < PTRS_PER_PTE; i++) {
-		set_pte_at(&init_mm, addr + i * PAGE_SIZE, ptep + i, pte);
-		pte_val(pte) += PAGE_SIZE;
-	}
-	page[1].index = (unsigned long) ptep;
-	return 0;
-}
-
-void arch_release_hugepage(struct page *page)
-{
-	pte_t *ptep;
-
-	if (MACHINE_HAS_HPAGE)
-		return;
-
-	ptep = (pte_t *) page[1].index;
-	if (!ptep)
-		return;
-	clear_table((unsigned long *) ptep, _PAGE_INVALID,
-		    PTRS_PER_PTE * sizeof(pte_t));
-	page_table_free(&init_mm, (unsigned long *) ptep);
-	page[1].index = 0;
-}
-
 pte_t *huge_pte_alloc(struct mm_struct *mm,
 			unsigned long addr, unsigned long sz)
 {
-- 
2.3.7


^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 4/5] s390/hugetlb: remove dead code for sw emulated huge pages
@ 2015-05-28 11:52   ` Dominik Dingel
  0 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-05-28 11:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: Russell King, Catalin Marinas, Will Deacon, Tony Luck,
	Fenghua Yu, James Hogan, Ralf Baechle, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Martin Schwidefsky,
	Heiko Carstens, linux390, David S. Miller, Chris Metcalf,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Andrew Morton,
	Zhang Zhen, Dominik Dingel, David Rientjes, Aneesh Kumar K.V,
	Nathan Lynch, Christian Borntraeger, Andy Lutomirski,
	Michael Holzheu, Hugh Dickins, Naoya Horiguchi, Paolo Bonzini,
	Jason J. Herne, Davidlohr Bueso, Kirill A. Shutemov,
	Luiz Capitulino, Mike Kravetz, linux-arm-kernel, linux-ia64,
	linux-metag, linux-mips, linuxppc-dev, linux-s390, linux-sh,
	sparclinux, linux-mm

We now support only hugepages on hardware with EDAT1 support.
So we remove the prepare/release_hugepage hooks and
simplify set_huge_pte_at and huge_ptep_get.

Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
---
 arch/s390/include/asm/hugetlb.h |  3 ---
 arch/s390/mm/hugetlbpage.c      | 60 +++--------------------------------------
 2 files changed, 3 insertions(+), 60 deletions(-)

diff --git a/arch/s390/include/asm/hugetlb.h b/arch/s390/include/asm/hugetlb.h
index dfb542a..0130d03 100644
--- a/arch/s390/include/asm/hugetlb.h
+++ b/arch/s390/include/asm/hugetlb.h
@@ -37,9 +37,6 @@ static inline int prepare_hugepage_range(struct file *file,
 
 #define arch_clear_hugepage_flags(page)		do { } while (0)
 
-int arch_prepare_hugepage(struct page *page);
-void arch_release_hugepage(struct page *page);
-
 static inline void huge_pte_clear(struct mm_struct *mm, unsigned long addr,
 				  pte_t *ptep)
 {
diff --git a/arch/s390/mm/hugetlbpage.c b/arch/s390/mm/hugetlbpage.c
index fa6e1bc..999616b 100644
--- a/arch/s390/mm/hugetlbpage.c
+++ b/arch/s390/mm/hugetlbpage.c
@@ -80,31 +80,16 @@ static inline pte_t __pmd_to_pte(pmd_t pmd)
 void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
 		     pte_t *ptep, pte_t pte)
 {
-	pmd_t pmd;
+	pmd_t pmd = __pte_to_pmd(pte);
 
-	pmd = __pte_to_pmd(pte);
-	if (!MACHINE_HAS_HPAGE) {
-		/* Emulated huge ptes loose the dirty and young bit */
-		pmd_val(pmd) &= ~_SEGMENT_ENTRY_ORIGIN;
-		pmd_val(pmd) |= pte_page(pte)[1].index;
-	} else
-		pmd_val(pmd) |= _SEGMENT_ENTRY_LARGE;
+	pmd_val(pmd) |= _SEGMENT_ENTRY_LARGE;
 	*(pmd_t *) ptep = pmd;
 }
 
 pte_t huge_ptep_get(pte_t *ptep)
 {
-	unsigned long origin;
-	pmd_t pmd;
+	pmd_t pmd = *(pmd_t *) ptep;
 
-	pmd = *(pmd_t *) ptep;
-	if (!MACHINE_HAS_HPAGE && pmd_present(pmd)) {
-		origin = pmd_val(pmd) & _SEGMENT_ENTRY_ORIGIN;
-		pmd_val(pmd) &= ~_SEGMENT_ENTRY_ORIGIN;
-		pmd_val(pmd) |= *(unsigned long *) origin;
-		/* Emulated huge ptes are young and dirty by definition */
-		pmd_val(pmd) |= _SEGMENT_ENTRY_YOUNG | _SEGMENT_ENTRY_DIRTY;
-	}
 	return __pmd_to_pte(pmd);
 }
 
@@ -119,45 +104,6 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
 	return pte;
 }
 
-int arch_prepare_hugepage(struct page *page)
-{
-	unsigned long addr = page_to_phys(page);
-	pte_t pte;
-	pte_t *ptep;
-	int i;
-
-	if (MACHINE_HAS_HPAGE)
-		return 0;
-
-	ptep = (pte_t *) pte_alloc_one(&init_mm, addr);
-	if (!ptep)
-		return -ENOMEM;
-
-	pte_val(pte) = addr;
-	for (i = 0; i < PTRS_PER_PTE; i++) {
-		set_pte_at(&init_mm, addr + i * PAGE_SIZE, ptep + i, pte);
-		pte_val(pte) += PAGE_SIZE;
-	}
-	page[1].index = (unsigned long) ptep;
-	return 0;
-}
-
-void arch_release_hugepage(struct page *page)
-{
-	pte_t *ptep;
-
-	if (MACHINE_HAS_HPAGE)
-		return;
-
-	ptep = (pte_t *) page[1].index;
-	if (!ptep)
-		return;
-	clear_table((unsigned long *) ptep, _PAGE_INVALID,
-		    PTRS_PER_PTE * sizeof(pte_t));
-	page_table_free(&init_mm, (unsigned long *) ptep);
-	page[1].index = 0;
-}
-
 pte_t *huge_pte_alloc(struct mm_struct *mm,
 			unsigned long addr, unsigned long sz)
 {
-- 
2.3.7


^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 4/5] s390/hugetlb: remove dead code for sw emulated huge pages
@ 2015-05-28 11:52   ` Dominik Dingel
  0 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-05-28 11:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: Russell King, Catalin Marinas, Will Deacon, Tony Luck,
	Fenghua Yu, James Hogan, Ralf Baechle, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Martin Schwidefsky,
	Heiko Carstens, linux390, David S. Miller, Chris Metcalf,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Andrew Morton,
	Zhang Zhen, Dominik Dingel, David Rientjes, Aneesh Kumar K.V,
	Nathan Lynch, Christian Borntraeger, Andy Lutomirski,
	Michael Holzheu, Hugh Dickins, Naoya Horiguchi, Paolo Bonzini,
	Jason J. Herne, Davidlohr Bueso, Kirill A. Shutemov,
	Luiz Capitulino, Mike Kravetz, linux-arm-kernel, linux-ia64,
	linux-metag, linux-mips, linuxppc-dev, linux-s390, linux-sh,
	sparclinux, linux-mm

We now support only hugepages on hardware with EDAT1 support.
So we remove the prepare/release_hugepage hooks and
simplify set_huge_pte_at and huge_ptep_get.

Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
---
 arch/s390/include/asm/hugetlb.h |  3 ---
 arch/s390/mm/hugetlbpage.c      | 60 +++--------------------------------------
 2 files changed, 3 insertions(+), 60 deletions(-)

diff --git a/arch/s390/include/asm/hugetlb.h b/arch/s390/include/asm/hugetlb.h
index dfb542a..0130d03 100644
--- a/arch/s390/include/asm/hugetlb.h
+++ b/arch/s390/include/asm/hugetlb.h
@@ -37,9 +37,6 @@ static inline int prepare_hugepage_range(struct file *file,
 
 #define arch_clear_hugepage_flags(page)		do { } while (0)
 
-int arch_prepare_hugepage(struct page *page);
-void arch_release_hugepage(struct page *page);
-
 static inline void huge_pte_clear(struct mm_struct *mm, unsigned long addr,
 				  pte_t *ptep)
 {
diff --git a/arch/s390/mm/hugetlbpage.c b/arch/s390/mm/hugetlbpage.c
index fa6e1bc..999616b 100644
--- a/arch/s390/mm/hugetlbpage.c
+++ b/arch/s390/mm/hugetlbpage.c
@@ -80,31 +80,16 @@ static inline pte_t __pmd_to_pte(pmd_t pmd)
 void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
 		     pte_t *ptep, pte_t pte)
 {
-	pmd_t pmd;
+	pmd_t pmd = __pte_to_pmd(pte);
 
-	pmd = __pte_to_pmd(pte);
-	if (!MACHINE_HAS_HPAGE) {
-		/* Emulated huge ptes loose the dirty and young bit */
-		pmd_val(pmd) &= ~_SEGMENT_ENTRY_ORIGIN;
-		pmd_val(pmd) |= pte_page(pte)[1].index;
-	} else
-		pmd_val(pmd) |= _SEGMENT_ENTRY_LARGE;
+	pmd_val(pmd) |= _SEGMENT_ENTRY_LARGE;
 	*(pmd_t *) ptep = pmd;
 }
 
 pte_t huge_ptep_get(pte_t *ptep)
 {
-	unsigned long origin;
-	pmd_t pmd;
+	pmd_t pmd = *(pmd_t *) ptep;
 
-	pmd = *(pmd_t *) ptep;
-	if (!MACHINE_HAS_HPAGE && pmd_present(pmd)) {
-		origin = pmd_val(pmd) & _SEGMENT_ENTRY_ORIGIN;
-		pmd_val(pmd) &= ~_SEGMENT_ENTRY_ORIGIN;
-		pmd_val(pmd) |= *(unsigned long *) origin;
-		/* Emulated huge ptes are young and dirty by definition */
-		pmd_val(pmd) |= _SEGMENT_ENTRY_YOUNG | _SEGMENT_ENTRY_DIRTY;
-	}
 	return __pmd_to_pte(pmd);
 }
 
@@ -119,45 +104,6 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
 	return pte;
 }
 
-int arch_prepare_hugepage(struct page *page)
-{
-	unsigned long addr = page_to_phys(page);
-	pte_t pte;
-	pte_t *ptep;
-	int i;
-
-	if (MACHINE_HAS_HPAGE)
-		return 0;
-
-	ptep = (pte_t *) pte_alloc_one(&init_mm, addr);
-	if (!ptep)
-		return -ENOMEM;
-
-	pte_val(pte) = addr;
-	for (i = 0; i < PTRS_PER_PTE; i++) {
-		set_pte_at(&init_mm, addr + i * PAGE_SIZE, ptep + i, pte);
-		pte_val(pte) += PAGE_SIZE;
-	}
-	page[1].index = (unsigned long) ptep;
-	return 0;
-}
-
-void arch_release_hugepage(struct page *page)
-{
-	pte_t *ptep;
-
-	if (MACHINE_HAS_HPAGE)
-		return;
-
-	ptep = (pte_t *) page[1].index;
-	if (!ptep)
-		return;
-	clear_table((unsigned long *) ptep, _PAGE_INVALID,
-		    PTRS_PER_PTE * sizeof(pte_t));
-	page_table_free(&init_mm, (unsigned long *) ptep);
-	page[1].index = 0;
-}
-
 pte_t *huge_pte_alloc(struct mm_struct *mm,
 			unsigned long addr, unsigned long sz)
 {
-- 
2.3.7

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 4/5] s390/hugetlb: remove dead code for sw emulated huge pages
@ 2015-05-28 11:52   ` Dominik Dingel
  0 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-05-28 11:52 UTC (permalink / raw)
  To: linux-arm-kernel

We now support only hugepages on hardware with EDAT1 support.
So we remove the prepare/release_hugepage hooks and
simplify set_huge_pte_at and huge_ptep_get.

Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
---
 arch/s390/include/asm/hugetlb.h |  3 ---
 arch/s390/mm/hugetlbpage.c      | 60 +++--------------------------------------
 2 files changed, 3 insertions(+), 60 deletions(-)

diff --git a/arch/s390/include/asm/hugetlb.h b/arch/s390/include/asm/hugetlb.h
index dfb542a..0130d03 100644
--- a/arch/s390/include/asm/hugetlb.h
+++ b/arch/s390/include/asm/hugetlb.h
@@ -37,9 +37,6 @@ static inline int prepare_hugepage_range(struct file *file,
 
 #define arch_clear_hugepage_flags(page)		do { } while (0)
 
-int arch_prepare_hugepage(struct page *page);
-void arch_release_hugepage(struct page *page);
-
 static inline void huge_pte_clear(struct mm_struct *mm, unsigned long addr,
 				  pte_t *ptep)
 {
diff --git a/arch/s390/mm/hugetlbpage.c b/arch/s390/mm/hugetlbpage.c
index fa6e1bc..999616b 100644
--- a/arch/s390/mm/hugetlbpage.c
+++ b/arch/s390/mm/hugetlbpage.c
@@ -80,31 +80,16 @@ static inline pte_t __pmd_to_pte(pmd_t pmd)
 void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
 		     pte_t *ptep, pte_t pte)
 {
-	pmd_t pmd;
+	pmd_t pmd = __pte_to_pmd(pte);
 
-	pmd = __pte_to_pmd(pte);
-	if (!MACHINE_HAS_HPAGE) {
-		/* Emulated huge ptes loose the dirty and young bit */
-		pmd_val(pmd) &= ~_SEGMENT_ENTRY_ORIGIN;
-		pmd_val(pmd) |= pte_page(pte)[1].index;
-	} else
-		pmd_val(pmd) |= _SEGMENT_ENTRY_LARGE;
+	pmd_val(pmd) |= _SEGMENT_ENTRY_LARGE;
 	*(pmd_t *) ptep = pmd;
 }
 
 pte_t huge_ptep_get(pte_t *ptep)
 {
-	unsigned long origin;
-	pmd_t pmd;
+	pmd_t pmd = *(pmd_t *) ptep;
 
-	pmd = *(pmd_t *) ptep;
-	if (!MACHINE_HAS_HPAGE && pmd_present(pmd)) {
-		origin = pmd_val(pmd) & _SEGMENT_ENTRY_ORIGIN;
-		pmd_val(pmd) &= ~_SEGMENT_ENTRY_ORIGIN;
-		pmd_val(pmd) |= *(unsigned long *) origin;
-		/* Emulated huge ptes are young and dirty by definition */
-		pmd_val(pmd) |= _SEGMENT_ENTRY_YOUNG | _SEGMENT_ENTRY_DIRTY;
-	}
 	return __pmd_to_pte(pmd);
 }
 
@@ -119,45 +104,6 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
 	return pte;
 }
 
-int arch_prepare_hugepage(struct page *page)
-{
-	unsigned long addr = page_to_phys(page);
-	pte_t pte;
-	pte_t *ptep;
-	int i;
-
-	if (MACHINE_HAS_HPAGE)
-		return 0;
-
-	ptep = (pte_t *) pte_alloc_one(&init_mm, addr);
-	if (!ptep)
-		return -ENOMEM;
-
-	pte_val(pte) = addr;
-	for (i = 0; i < PTRS_PER_PTE; i++) {
-		set_pte_at(&init_mm, addr + i * PAGE_SIZE, ptep + i, pte);
-		pte_val(pte) += PAGE_SIZE;
-	}
-	page[1].index = (unsigned long) ptep;
-	return 0;
-}
-
-void arch_release_hugepage(struct page *page)
-{
-	pte_t *ptep;
-
-	if (MACHINE_HAS_HPAGE)
-		return;
-
-	ptep = (pte_t *) page[1].index;
-	if (!ptep)
-		return;
-	clear_table((unsigned long *) ptep, _PAGE_INVALID,
-		    PTRS_PER_PTE * sizeof(pte_t));
-	page_table_free(&init_mm, (unsigned long *) ptep);
-	page[1].index = 0;
-}
-
 pte_t *huge_pte_alloc(struct mm_struct *mm,
 			unsigned long addr, unsigned long sz)
 {
-- 
2.3.7

^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 4/5] s390/hugetlb: remove dead code for sw emulated huge pages
@ 2015-05-28 11:52   ` Dominik Dingel
  0 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-05-28 11:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: Russell King, Catalin Marinas, Will Deacon, Tony Luck,
	Fenghua Yu, James Hogan, Ralf Baechle, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Martin Schwidefsky,
	Heiko Carstens, linux390, David S. Miller, Chris Metcalf,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Andrew Morton,
	Zhang Zhen, Dominik Dingel, David Rientjes, Aneesh

We now support only hugepages on hardware with EDAT1 support.
So we remove the prepare/release_hugepage hooks and
simplify set_huge_pte_at and huge_ptep_get.

Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
---
 arch/s390/include/asm/hugetlb.h |  3 ---
 arch/s390/mm/hugetlbpage.c      | 60 +++--------------------------------------
 2 files changed, 3 insertions(+), 60 deletions(-)

diff --git a/arch/s390/include/asm/hugetlb.h b/arch/s390/include/asm/hugetlb.h
index dfb542a..0130d03 100644
--- a/arch/s390/include/asm/hugetlb.h
+++ b/arch/s390/include/asm/hugetlb.h
@@ -37,9 +37,6 @@ static inline int prepare_hugepage_range(struct file *file,
 
 #define arch_clear_hugepage_flags(page)		do { } while (0)
 
-int arch_prepare_hugepage(struct page *page);
-void arch_release_hugepage(struct page *page);
-
 static inline void huge_pte_clear(struct mm_struct *mm, unsigned long addr,
 				  pte_t *ptep)
 {
diff --git a/arch/s390/mm/hugetlbpage.c b/arch/s390/mm/hugetlbpage.c
index fa6e1bc..999616b 100644
--- a/arch/s390/mm/hugetlbpage.c
+++ b/arch/s390/mm/hugetlbpage.c
@@ -80,31 +80,16 @@ static inline pte_t __pmd_to_pte(pmd_t pmd)
 void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
 		     pte_t *ptep, pte_t pte)
 {
-	pmd_t pmd;
+	pmd_t pmd = __pte_to_pmd(pte);
 
-	pmd = __pte_to_pmd(pte);
-	if (!MACHINE_HAS_HPAGE) {
-		/* Emulated huge ptes loose the dirty and young bit */
-		pmd_val(pmd) &= ~_SEGMENT_ENTRY_ORIGIN;
-		pmd_val(pmd) |= pte_page(pte)[1].index;
-	} else
-		pmd_val(pmd) |= _SEGMENT_ENTRY_LARGE;
+	pmd_val(pmd) |= _SEGMENT_ENTRY_LARGE;
 	*(pmd_t *) ptep = pmd;
 }
 
 pte_t huge_ptep_get(pte_t *ptep)
 {
-	unsigned long origin;
-	pmd_t pmd;
+	pmd_t pmd = *(pmd_t *) ptep;
 
-	pmd = *(pmd_t *) ptep;
-	if (!MACHINE_HAS_HPAGE && pmd_present(pmd)) {
-		origin = pmd_val(pmd) & _SEGMENT_ENTRY_ORIGIN;
-		pmd_val(pmd) &= ~_SEGMENT_ENTRY_ORIGIN;
-		pmd_val(pmd) |= *(unsigned long *) origin;
-		/* Emulated huge ptes are young and dirty by definition */
-		pmd_val(pmd) |= _SEGMENT_ENTRY_YOUNG | _SEGMENT_ENTRY_DIRTY;
-	}
 	return __pmd_to_pte(pmd);
 }
 
@@ -119,45 +104,6 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
 	return pte;
 }
 
-int arch_prepare_hugepage(struct page *page)
-{
-	unsigned long addr = page_to_phys(page);
-	pte_t pte;
-	pte_t *ptep;
-	int i;
-
-	if (MACHINE_HAS_HPAGE)
-		return 0;
-
-	ptep = (pte_t *) pte_alloc_one(&init_mm, addr);
-	if (!ptep)
-		return -ENOMEM;
-
-	pte_val(pte) = addr;
-	for (i = 0; i < PTRS_PER_PTE; i++) {
-		set_pte_at(&init_mm, addr + i * PAGE_SIZE, ptep + i, pte);
-		pte_val(pte) += PAGE_SIZE;
-	}
-	page[1].index = (unsigned long) ptep;
-	return 0;
-}
-
-void arch_release_hugepage(struct page *page)
-{
-	pte_t *ptep;
-
-	if (MACHINE_HAS_HPAGE)
-		return;
-
-	ptep = (pte_t *) page[1].index;
-	if (!ptep)
-		return;
-	clear_table((unsigned long *) ptep, _PAGE_INVALID,
-		    PTRS_PER_PTE * sizeof(pte_t));
-	page_table_free(&init_mm, (unsigned long *) ptep);
-	page[1].index = 0;
-}
-
 pte_t *huge_pte_alloc(struct mm_struct *mm,
 			unsigned long addr, unsigned long sz)
 {
-- 
2.3.7


^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 5/5] s390/mm: forward check for huge pmds to pmd_large()
  2015-05-28 11:52 ` Dominik Dingel
                     ` (2 preceding siblings ...)
  (?)
@ 2015-05-28 11:52   ` Dominik Dingel
  -1 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-05-28 11:52 UTC (permalink / raw)
  To: linux-arm-kernel

We already do the check in pmd_large, so we can just forward the call.

Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
---
 arch/s390/mm/hugetlbpage.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/arch/s390/mm/hugetlbpage.c b/arch/s390/mm/hugetlbpage.c
index 999616b..a4b2f5e 100644
--- a/arch/s390/mm/hugetlbpage.c
+++ b/arch/s390/mm/hugetlbpage.c
@@ -135,10 +135,7 @@ pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
 
 int pmd_huge(pmd_t pmd)
 {
-	if (!MACHINE_HAS_HPAGE)
-		return 0;
-
-	return !!(pmd_val(pmd) & _SEGMENT_ENTRY_LARGE);
+	return pmd_large(pmd);
 }
 
 int pud_huge(pud_t pud)
-- 
2.3.7


^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 5/5] s390/mm: forward check for huge pmds to pmd_large()
@ 2015-05-28 11:52   ` Dominik Dingel
  0 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-05-28 11:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: Russell King, Catalin Marinas, Will Deacon, Tony Luck,
	Fenghua Yu, James Hogan, Ralf Baechle, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Martin Schwidefsky,
	Heiko Carstens, linux390, David S. Miller, Chris Metcalf,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Andrew Morton,
	Zhang Zhen, Dominik Dingel, David Rientjes, Aneesh Kumar K.V,
	Nathan Lynch, Christian Borntraeger, Andy Lutomirski,
	Michael Holzheu, Hugh Dickins, Naoya Horiguchi, Paolo Bonzini,
	Jason J. Herne, Davidlohr Bueso, Kirill A. Shutemov,
	Luiz Capitulino, Mike Kravetz, linux-arm-kernel, linux-ia64,
	linux-metag, linux-mips, linuxppc-dev, linux-s390, linux-sh,
	sparclinux, linux-mm

We already do the check in pmd_large, so we can just forward the call.

Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
---
 arch/s390/mm/hugetlbpage.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/arch/s390/mm/hugetlbpage.c b/arch/s390/mm/hugetlbpage.c
index 999616b..a4b2f5e 100644
--- a/arch/s390/mm/hugetlbpage.c
+++ b/arch/s390/mm/hugetlbpage.c
@@ -135,10 +135,7 @@ pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
 
 int pmd_huge(pmd_t pmd)
 {
-	if (!MACHINE_HAS_HPAGE)
-		return 0;
-
-	return !!(pmd_val(pmd) & _SEGMENT_ENTRY_LARGE);
+	return pmd_large(pmd);
 }
 
 int pud_huge(pud_t pud)
-- 
2.3.7


^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 5/5] s390/mm: forward check for huge pmds to pmd_large()
@ 2015-05-28 11:52   ` Dominik Dingel
  0 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-05-28 11:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: Russell King, Catalin Marinas, Will Deacon, Tony Luck,
	Fenghua Yu, James Hogan, Ralf Baechle, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Martin Schwidefsky,
	Heiko Carstens, linux390, David S. Miller, Chris Metcalf,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Andrew Morton,
	Zhang Zhen, Dominik Dingel, David Rientjes, Aneesh Kumar K.V,
	Nathan Lynch, Christian Borntraeger, Andy Lutomirski,
	Michael Holzheu, Hugh Dickins, Naoya Horiguchi, Paolo Bonzini,
	Jason J. Herne, Davidlohr Bueso, Kirill A. Shutemov,
	Luiz Capitulino, Mike Kravetz, linux-arm-kernel, linux-ia64,
	linux-metag, linux-mips, linuxppc-dev, linux-s390, linux-sh,
	sparclinux, linux-mm

We already do the check in pmd_large, so we can just forward the call.

Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
---
 arch/s390/mm/hugetlbpage.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/arch/s390/mm/hugetlbpage.c b/arch/s390/mm/hugetlbpage.c
index 999616b..a4b2f5e 100644
--- a/arch/s390/mm/hugetlbpage.c
+++ b/arch/s390/mm/hugetlbpage.c
@@ -135,10 +135,7 @@ pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
 
 int pmd_huge(pmd_t pmd)
 {
-	if (!MACHINE_HAS_HPAGE)
-		return 0;
-
-	return !!(pmd_val(pmd) & _SEGMENT_ENTRY_LARGE);
+	return pmd_large(pmd);
 }
 
 int pud_huge(pud_t pud)
-- 
2.3.7

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 5/5] s390/mm: forward check for huge pmds to pmd_large()
@ 2015-05-28 11:52   ` Dominik Dingel
  0 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-05-28 11:52 UTC (permalink / raw)
  To: linux-arm-kernel

We already do the check in pmd_large, so we can just forward the call.

Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
---
 arch/s390/mm/hugetlbpage.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/arch/s390/mm/hugetlbpage.c b/arch/s390/mm/hugetlbpage.c
index 999616b..a4b2f5e 100644
--- a/arch/s390/mm/hugetlbpage.c
+++ b/arch/s390/mm/hugetlbpage.c
@@ -135,10 +135,7 @@ pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
 
 int pmd_huge(pmd_t pmd)
 {
-	if (!MACHINE_HAS_HPAGE)
-		return 0;
-
-	return !!(pmd_val(pmd) & _SEGMENT_ENTRY_LARGE);
+	return pmd_large(pmd);
 }
 
 int pud_huge(pud_t pud)
-- 
2.3.7

^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 5/5] s390/mm: forward check for huge pmds to pmd_large()
@ 2015-05-28 11:52   ` Dominik Dingel
  0 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-05-28 11:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: Russell King, Catalin Marinas, Will Deacon, Tony Luck,
	Fenghua Yu, James Hogan, Ralf Baechle, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Martin Schwidefsky,
	Heiko Carstens, linux390, David S. Miller, Chris Metcalf,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Andrew Morton,
	Zhang Zhen

We already do the check in pmd_large, so we can just forward the call.

Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
---
 arch/s390/mm/hugetlbpage.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/arch/s390/mm/hugetlbpage.c b/arch/s390/mm/hugetlbpage.c
index 999616b..a4b2f5e 100644
--- a/arch/s390/mm/hugetlbpage.c
+++ b/arch/s390/mm/hugetlbpage.c
@@ -135,10 +135,7 @@ pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
 
 int pmd_huge(pmd_t pmd)
 {
-	if (!MACHINE_HAS_HPAGE)
-		return 0;
-
-	return !!(pmd_val(pmd) & _SEGMENT_ENTRY_LARGE);
+	return pmd_large(pmd);
 }
 
 int pud_huge(pud_t pud)
-- 
2.3.7

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 45+ messages in thread

* Re: [PATCH 3/5] mm/hugetlb: remove arch_prepare/release_hugepage from arch headers
  2015-05-28 11:52   ` Dominik Dingel
                       ` (2 preceding siblings ...)
  (?)
@ 2015-05-28 13:59     ` Ralf Baechle
  -1 siblings, 0 replies; 45+ messages in thread
From: Ralf Baechle @ 2015-05-28 13:59 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, May 28, 2015 at 01:52:35PM +0200, Dominik Dingel wrote:

Acked-by: Ralf Baechle <ralf@linux-mips.org>

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 3/5] mm/hugetlb: remove arch_prepare/release_hugepage from arch headers
@ 2015-05-28 13:59     ` Ralf Baechle
  0 siblings, 0 replies; 45+ messages in thread
From: Ralf Baechle @ 2015-05-28 13:59 UTC (permalink / raw)
  To: Dominik Dingel
  Cc: linux-kernel, Russell King, Catalin Marinas, Will Deacon,
	Tony Luck, Fenghua Yu, James Hogan, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Martin Schwidefsky,
	Heiko Carstens, linux390, David S. Miller, Chris Metcalf,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Andrew Morton,
	Zhang Zhen, David Rientjes, Aneesh Kumar K.V, Nathan Lynch,
	Christian Borntraeger, Andy Lutomirski, Michael Holzheu,
	Hugh Dickins, Naoya Horiguchi, Paolo Bonzini, Jason J. Herne,
	Davidlohr Bueso, Kirill A. Shutemov, Luiz Capitulino,
	Mike Kravetz, linux-arm-kernel, linux-ia64, linux-metag,
	linux-mips, linuxppc-dev, linux-s390, linux-sh, sparclinux,
	linux-mm

On Thu, May 28, 2015 at 01:52:35PM +0200, Dominik Dingel wrote:

Acked-by: Ralf Baechle <ralf@linux-mips.org>

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 3/5] mm/hugetlb: remove arch_prepare/release_hugepage from arch headers
@ 2015-05-28 13:59     ` Ralf Baechle
  0 siblings, 0 replies; 45+ messages in thread
From: Ralf Baechle @ 2015-05-28 13:59 UTC (permalink / raw)
  To: Dominik Dingel
  Cc: linux-kernel, Russell King, Catalin Marinas, Will Deacon,
	Tony Luck, Fenghua Yu, James Hogan, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Martin Schwidefsky,
	Heiko Carstens, linux390, David S. Miller, Chris Metcalf,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Andrew Morton,
	Zhang Zhen, David Rientjes, Aneesh Kumar K.V, Nathan Lynch,
	Christian Borntraeger, Andy Lutomirski, Michael Holzheu,
	Hugh Dickins, Naoya Horiguchi, Paolo Bonzini, Jason J. Herne,
	Davidlohr Bueso, Kirill A. Shutemov, Luiz Capitulino,
	Mike Kravetz, linux-arm-kernel, linux-ia64, linux-metag,
	linux-mips, linuxppc-dev, linux-s390, linux-sh, sparclinux,
	linux-mm

On Thu, May 28, 2015 at 01:52:35PM +0200, Dominik Dingel wrote:

Acked-by: Ralf Baechle <ralf@linux-mips.org>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 45+ messages in thread

* [PATCH 3/5] mm/hugetlb: remove arch_prepare/release_hugepage from arch headers
@ 2015-05-28 13:59     ` Ralf Baechle
  0 siblings, 0 replies; 45+ messages in thread
From: Ralf Baechle @ 2015-05-28 13:59 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, May 28, 2015 at 01:52:35PM +0200, Dominik Dingel wrote:

Acked-by: Ralf Baechle <ralf@linux-mips.org>

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 3/5] mm/hugetlb: remove arch_prepare/release_hugepage from arch headers
@ 2015-05-28 13:59     ` Ralf Baechle
  0 siblings, 0 replies; 45+ messages in thread
From: Ralf Baechle @ 2015-05-28 13:59 UTC (permalink / raw)
  To: Dominik Dingel
  Cc: linux-kernel, Russell King, Catalin Marinas, Will Deacon,
	Tony Luck, Fenghua Yu, James Hogan, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Martin Schwidefsky,
	Heiko Carstens, linux390, David S. Miller, Chris Metcalf,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Andrew Morton,
	Zhang Zhen

On Thu, May 28, 2015 at 01:52:35PM +0200, Dominik Dingel wrote:

Acked-by: Ralf Baechle <ralf@linux-mips.org>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 0/5] Remove s390 sw-emulated hugepages and cleanup
  2015-05-28 11:52 ` Dominik Dingel
                     ` (2 preceding siblings ...)
  (?)
@ 2015-06-01  7:35   ` Christian Borntraeger
  -1 siblings, 0 replies; 45+ messages in thread
From: Christian Borntraeger @ 2015-06-01  7:35 UTC (permalink / raw)
  To: linux-arm-kernel

Am 28.05.2015 um 13:52 schrieb Dominik Dingel:
> Hi everyone,
> 
> there is a potential bug with KVM and hugetlbfs if the hardware does not
> support hugepages (EDAT1).
> We fix this by making EDAT1 a hard requirement for hugepages and 
> therefore removing and simplifying code.

The cleanup itself is nice and probably the right thing to do. 
Emulating large pages makes the code more complex and asks for
trouble (as outlined above)

The only downside that I see is that z/VM as of today does not
announce EDAT1 for its guests so the "emulated" large pages for
hugetlbfs would be useful in that case. The current code allocates
the page table only once and shares it for all mappers - which is
useful for some big databases that spawn hundreds of processes with
shared mappings of several hundred GBs. In these cases we do save
a decent amount of page table memory. 

Not sure if that case is actually important, though.

Christian


^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 0/5] Remove s390 sw-emulated hugepages and cleanup
@ 2015-06-01  7:35   ` Christian Borntraeger
  0 siblings, 0 replies; 45+ messages in thread
From: Christian Borntraeger @ 2015-06-01  7:35 UTC (permalink / raw)
  To: Dominik Dingel, linux-kernel
  Cc: Russell King, Catalin Marinas, Will Deacon, Tony Luck,
	Fenghua Yu, James Hogan, Ralf Baechle, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Martin Schwidefsky,
	Heiko Carstens, linux390, David S. Miller, Chris Metcalf,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Andrew Morton,
	Zhang Zhen, David Rientjes, Aneesh Kumar K.V, Nathan Lynch,
	Andy Lutomirski, Michael Holzheu, Hugh Dickins, Naoya Horiguchi,
	Paolo Bonzini, Jason J. Herne, Davidlohr Bueso,
	Kirill A. Shutemov, Luiz Capitulino, Mike Kravetz,
	linux-arm-kernel, linux-ia64, linux-metag, linux-mips,
	linuxppc-dev, linux-s390, linux-sh, sparclinux, linux-mm

Am 28.05.2015 um 13:52 schrieb Dominik Dingel:
> Hi everyone,
> 
> there is a potential bug with KVM and hugetlbfs if the hardware does not
> support hugepages (EDAT1).
> We fix this by making EDAT1 a hard requirement for hugepages and 
> therefore removing and simplifying code.

The cleanup itself is nice and probably the right thing to do. 
Emulating large pages makes the code more complex and asks for
trouble (as outlined above)

The only downside that I see is that z/VM as of today does not
announce EDAT1 for its guests so the "emulated" large pages for
hugetlbfs would be useful in that case. The current code allocates
the page table only once and shares it for all mappers - which is
useful for some big databases that spawn hundreds of processes with
shared mappings of several hundred GBs. In these cases we do save
a decent amount of page table memory. 

Not sure if that case is actually important, though.

Christian


^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 0/5] Remove s390 sw-emulated hugepages and cleanup
@ 2015-06-01  7:35   ` Christian Borntraeger
  0 siblings, 0 replies; 45+ messages in thread
From: Christian Borntraeger @ 2015-06-01  7:35 UTC (permalink / raw)
  To: Dominik Dingel, linux-kernel
  Cc: Russell King, Catalin Marinas, Will Deacon, Tony Luck,
	Fenghua Yu, James Hogan, Ralf Baechle, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Martin Schwidefsky,
	Heiko Carstens, linux390, David S. Miller, Chris Metcalf,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Andrew Morton,
	Zhang Zhen, David Rientjes, Aneesh Kumar K.V, Nathan Lynch,
	Andy Lutomirski, Michael Holzheu, Hugh Dickins, Naoya Horiguchi,
	Paolo Bonzini, Jason J. Herne, Davidlohr Bueso,
	Kirill A. Shutemov, Luiz Capitulino, Mike Kravetz,
	linux-arm-kernel, linux-ia64, linux-metag, linux-mips,
	linuxppc-dev, linux-s390, linux-sh, sparclinux, linux-mm

Am 28.05.2015 um 13:52 schrieb Dominik Dingel:
> Hi everyone,
> 
> there is a potential bug with KVM and hugetlbfs if the hardware does not
> support hugepages (EDAT1).
> We fix this by making EDAT1 a hard requirement for hugepages and 
> therefore removing and simplifying code.

The cleanup itself is nice and probably the right thing to do. 
Emulating large pages makes the code more complex and asks for
trouble (as outlined above)

The only downside that I see is that z/VM as of today does not
announce EDAT1 for its guests so the "emulated" large pages for
hugetlbfs would be useful in that case. The current code allocates
the page table only once and shares it for all mappers - which is
useful for some big databases that spawn hundreds of processes with
shared mappings of several hundred GBs. In these cases we do save
a decent amount of page table memory. 

Not sure if that case is actually important, though.

Christian

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 45+ messages in thread

* [PATCH 0/5] Remove s390 sw-emulated hugepages and cleanup
@ 2015-06-01  7:35   ` Christian Borntraeger
  0 siblings, 0 replies; 45+ messages in thread
From: Christian Borntraeger @ 2015-06-01  7:35 UTC (permalink / raw)
  To: linux-arm-kernel

Am 28.05.2015 um 13:52 schrieb Dominik Dingel:
> Hi everyone,
> 
> there is a potential bug with KVM and hugetlbfs if the hardware does not
> support hugepages (EDAT1).
> We fix this by making EDAT1 a hard requirement for hugepages and 
> therefore removing and simplifying code.

The cleanup itself is nice and probably the right thing to do. 
Emulating large pages makes the code more complex and asks for
trouble (as outlined above)

The only downside that I see is that z/VM as of today does not
announce EDAT1 for its guests so the "emulated" large pages for
hugetlbfs would be useful in that case. The current code allocates
the page table only once and shares it for all mappers - which is
useful for some big databases that spawn hundreds of processes with
shared mappings of several hundred GBs. In these cases we do save
a decent amount of page table memory. 

Not sure if that case is actually important, though.

Christian

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 0/5] Remove s390 sw-emulated hugepages and cleanup
@ 2015-06-01  7:35   ` Christian Borntraeger
  0 siblings, 0 replies; 45+ messages in thread
From: Christian Borntraeger @ 2015-06-01  7:35 UTC (permalink / raw)
  To: Dominik Dingel, linux-kernel
  Cc: Russell King, Catalin Marinas, Will Deacon, Tony Luck,
	Fenghua Yu, James Hogan, Ralf Baechle, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Martin Schwidefsky,
	Heiko Carstens, linux390, David S. Miller, Chris Metcalf,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Andrew Morton,
	Zhang Zhen, David Rientjes, Aneesh Kumar K.V, Nathan

Am 28.05.2015 um 13:52 schrieb Dominik Dingel:
> Hi everyone,
> 
> there is a potential bug with KVM and hugetlbfs if the hardware does not
> support hugepages (EDAT1).
> We fix this by making EDAT1 a hard requirement for hugepages and 
> therefore removing and simplifying code.

The cleanup itself is nice and probably the right thing to do. 
Emulating large pages makes the code more complex and asks for
trouble (as outlined above)

The only downside that I see is that z/VM as of today does not
announce EDAT1 for its guests so the "emulated" large pages for
hugetlbfs would be useful in that case. The current code allocates
the page table only once and shares it for all mappers - which is
useful for some big databases that spawn hundreds of processes with
shared mappings of several hundred GBs. In these cases we do save
a decent amount of page table memory. 

Not sure if that case is actually important, though.

Christian


^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 0/5] Remove s390 sw-emulated hugepages and cleanup
  2015-06-01  7:35   ` Christian Borntraeger
  (?)
  (?)
@ 2015-06-02  7:46     ` Dominik Dingel
  -1 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-06-02  7:46 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, 01 Jun 2015 09:35:57 +0200
Christian Borntraeger <borntraeger@de.ibm.com> wrote:

> Am 28.05.2015 um 13:52 schrieb Dominik Dingel:
> > Hi everyone,
> > 
> > there is a potential bug with KVM and hugetlbfs if the hardware does not
> > support hugepages (EDAT1).
> > We fix this by making EDAT1 a hard requirement for hugepages and 
> > therefore removing and simplifying code.
> 
> The cleanup itself is nice and probably the right thing to do. 
> Emulating large pages makes the code more complex and asks for
> trouble (as outlined above)
> 
> The only downside that I see is that z/VM as of today does not
> announce EDAT1 for its guests so the "emulated" large pages for
> hugetlbfs would be useful in that case. The current code allocates
> the page table only once and shares it for all mappers - which is
> useful for some big databases that spawn hundreds of processes with
> shared mappings of several hundred GBs. In these cases we do save
> a decent amount of page table memory. 

To limit the damage done, we could always allocate page tables with pgstes for that case.
That would allow one guest manipulating another guests storage keys,
but at least would prevent random memory overwrites in the host.

Another thing we could do, make software emulated large pages a kernel config option
and only if KVM is not selected allow it, visa versa.

@Martin what do you think?

Thanks,
	Dominik

> Not sure if that case is actually important, though.
> 
> Christian
> 


^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 0/5] Remove s390 sw-emulated hugepages and cleanup
@ 2015-06-02  7:46     ` Dominik Dingel
  0 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-06-02  7:46 UTC (permalink / raw)
  To: Christian Borntraeger, Martin Schwidefsky
  Cc: linux-kernel, Russell King, Catalin Marinas, Will Deacon,
	Tony Luck, Fenghua Yu, James Hogan, Ralf Baechle,
	Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Heiko Carstens, linux390, David S. Miller, Chris Metcalf,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Andrew Morton,
	Zhang Zhen, David Rientjes, Aneesh Kumar K.V, Nathan Lynch,
	Andy Lutomirski, Michael Holzheu, Hugh Dickins, Naoya Horiguchi,
	Paolo Bonzini, Jason J. Herne, Davidlohr Bueso,
	Kirill A. Shutemov, Luiz Capitulino, Mike Kravetz,
	linux-arm-kernel, linux-ia64, linux-metag, linux-mips,
	linuxppc-dev, linux-s390, linux-sh, sparclinux

On Mon, 01 Jun 2015 09:35:57 +0200
Christian Borntraeger <borntraeger@de.ibm.com> wrote:

> Am 28.05.2015 um 13:52 schrieb Dominik Dingel:
> > Hi everyone,
> > 
> > there is a potential bug with KVM and hugetlbfs if the hardware does not
> > support hugepages (EDAT1).
> > We fix this by making EDAT1 a hard requirement for hugepages and 
> > therefore removing and simplifying code.
> 
> The cleanup itself is nice and probably the right thing to do. 
> Emulating large pages makes the code more complex and asks for
> trouble (as outlined above)
> 
> The only downside that I see is that z/VM as of today does not
> announce EDAT1 for its guests so the "emulated" large pages for
> hugetlbfs would be useful in that case. The current code allocates
> the page table only once and shares it for all mappers - which is
> useful for some big databases that spawn hundreds of processes with
> shared mappings of several hundred GBs. In these cases we do save
> a decent amount of page table memory. 

To limit the damage done, we could always allocate page tables with pgstes for that case.
That would allow one guest manipulating another guests storage keys,
but at least would prevent random memory overwrites in the host.

Another thing we could do, make software emulated large pages a kernel config option
and only if KVM is not selected allow it, visa versa.

@Martin what do you think?

Thanks,
	Dominik

> Not sure if that case is actually important, though.
> 
> Christian
> 


^ permalink raw reply	[flat|nested] 45+ messages in thread

* [PATCH 0/5] Remove s390 sw-emulated hugepages and cleanup
@ 2015-06-02  7:46     ` Dominik Dingel
  0 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-06-02  7:46 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, 01 Jun 2015 09:35:57 +0200
Christian Borntraeger <borntraeger@de.ibm.com> wrote:

> Am 28.05.2015 um 13:52 schrieb Dominik Dingel:
> > Hi everyone,
> > 
> > there is a potential bug with KVM and hugetlbfs if the hardware does not
> > support hugepages (EDAT1).
> > We fix this by making EDAT1 a hard requirement for hugepages and 
> > therefore removing and simplifying code.
> 
> The cleanup itself is nice and probably the right thing to do. 
> Emulating large pages makes the code more complex and asks for
> trouble (as outlined above)
> 
> The only downside that I see is that z/VM as of today does not
> announce EDAT1 for its guests so the "emulated" large pages for
> hugetlbfs would be useful in that case. The current code allocates
> the page table only once and shares it for all mappers - which is
> useful for some big databases that spawn hundreds of processes with
> shared mappings of several hundred GBs. In these cases we do save
> a decent amount of page table memory. 

To limit the damage done, we could always allocate page tables with pgstes for that case.
That would allow one guest manipulating another guests storage keys,
but at least would prevent random memory overwrites in the host.

Another thing we could do, make software emulated large pages a kernel config option
and only if KVM is not selected allow it, visa versa.

@Martin what do you think?

Thanks,
	Dominik

> Not sure if that case is actually important, though.
> 
> Christian
> 

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 0/5] Remove s390 sw-emulated hugepages and cleanup
@ 2015-06-02  7:46     ` Dominik Dingel
  0 siblings, 0 replies; 45+ messages in thread
From: Dominik Dingel @ 2015-06-02  7:46 UTC (permalink / raw)
  To: Christian Borntraeger, Martin Schwidefsky
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, Russell King,
	Catalin Marinas, Will Deacon, Tony Luck, Fenghua Yu, James Hogan,
	Ralf Baechle, Benjamin Herrenschmidt, Paul Mackerras,
	Michael Ellerman, Heiko Carstens,
	linux390-tA70FqPdS9bQT0dZR+AlfA, David S. Miller, Chris Metcalf,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	x86-DgEjT+Ai2ygdnm+yROfE0A, Andrew Morton, Zhang Zhen,
	David Rientjes, Aneesh Kumar K.V, Nathan Lynch

On Mon, 01 Jun 2015 09:35:57 +0200
Christian Borntraeger <borntraeger-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org> wrote:

> Am 28.05.2015 um 13:52 schrieb Dominik Dingel:
> > Hi everyone,
> > 
> > there is a potential bug with KVM and hugetlbfs if the hardware does not
> > support hugepages (EDAT1).
> > We fix this by making EDAT1 a hard requirement for hugepages and 
> > therefore removing and simplifying code.
> 
> The cleanup itself is nice and probably the right thing to do. 
> Emulating large pages makes the code more complex and asks for
> trouble (as outlined above)
> 
> The only downside that I see is that z/VM as of today does not
> announce EDAT1 for its guests so the "emulated" large pages for
> hugetlbfs would be useful in that case. The current code allocates
> the page table only once and shares it for all mappers - which is
> useful for some big databases that spawn hundreds of processes with
> shared mappings of several hundred GBs. In these cases we do save
> a decent amount of page table memory. 

To limit the damage done, we could always allocate page tables with pgstes for that case.
That would allow one guest manipulating another guests storage keys,
but at least would prevent random memory overwrites in the host.

Another thing we could do, make software emulated large pages a kernel config option
and only if KVM is not selected allow it, visa versa.

@Martin what do you think?

Thanks,
	Dominik

> Not sure if that case is actually important, though.
> 
> Christian
> 

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [3/5] mm/hugetlb: remove arch_prepare/release_hugepage from arch headers
  2015-05-28 11:52   ` Dominik Dingel
                     ` (4 preceding siblings ...)
  (?)
@ 2015-06-04 12:15   ` Michael Ellerman
  -1 siblings, 0 replies; 45+ messages in thread
From: Michael Ellerman @ 2015-06-04 12:15 UTC (permalink / raw)
  To: Dominik Dingel, linux-kernel; +Cc: linuxppc-dev

On Thu, 2015-28-05 at 11:52:35 UTC, Dominik Dingel wrote:
> Nobody used these hooks so they were removed from common code,
> and can now be removed from the architectures.
> 
> Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
> Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
> Acked-by: Ralf Baechle <ralf@linux-mips.org>

> diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h
> index 4bbd3c8..7eac89b 100644
> --- a/arch/powerpc/include/asm/hugetlb.h
> +++ b/arch/powerpc/include/asm/hugetlb.h
> @@ -168,15 +168,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
>  	return *ptep;
>  }
>  
> -static inline int arch_prepare_hugepage(struct page *page)
> -{
> -	return 0;
> -}
> -
> -static inline void arch_release_hugepage(struct page *page)
> -{
> -}
> -
>  static inline void arch_clear_hugepage_flags(struct page *page)
>  {
>  }

Acked-by: Michael Ellerman <mpe@ellerman.id.au>

cheers

^ permalink raw reply	[flat|nested] 45+ messages in thread

end of thread, other threads:[~2015-06-04 12:15 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-28 11:52 [PATCH 0/5] Remove s390 sw-emulated hugepages and cleanup Dominik Dingel
2015-05-28 11:52 ` Dominik Dingel
2015-05-28 11:52 ` Dominik Dingel
2015-05-28 11:52 ` Dominik Dingel
2015-05-28 11:52 ` Dominik Dingel
2015-05-28 11:52 ` [PATCH 1/5] s390/mm: make hugepages_supported a boot time decision Dominik Dingel
2015-05-28 11:52   ` Dominik Dingel
2015-05-28 11:52   ` Dominik Dingel
2015-05-28 11:52   ` Dominik Dingel
2015-05-28 11:52   ` Dominik Dingel
2015-05-28 11:52 ` [PATCH 2/5] mm/hugetlb: remove unused arch hook prepare/release_hugepage Dominik Dingel
2015-05-28 11:52   ` Dominik Dingel
2015-05-28 11:52   ` Dominik Dingel
2015-05-28 11:52   ` Dominik Dingel
2015-05-28 11:52   ` Dominik Dingel
2015-05-28 11:52 ` [PATCH 3/5] mm/hugetlb: remove arch_prepare/release_hugepage from arch headers Dominik Dingel
2015-05-28 11:52   ` Dominik Dingel
2015-05-28 11:52   ` Dominik Dingel
2015-05-28 11:52   ` Dominik Dingel
2015-05-28 11:52   ` Dominik Dingel
2015-05-28 13:59   ` Ralf Baechle
2015-05-28 13:59     ` Ralf Baechle
2015-05-28 13:59     ` Ralf Baechle
2015-05-28 13:59     ` Ralf Baechle
2015-05-28 13:59     ` Ralf Baechle
2015-06-04 12:15   ` [3/5] " Michael Ellerman
2015-05-28 11:52 ` [PATCH 4/5] s390/hugetlb: remove dead code for sw emulated huge pages Dominik Dingel
2015-05-28 11:52   ` Dominik Dingel
2015-05-28 11:52   ` Dominik Dingel
2015-05-28 11:52   ` Dominik Dingel
2015-05-28 11:52   ` Dominik Dingel
2015-05-28 11:52 ` [PATCH 5/5] s390/mm: forward check for huge pmds to pmd_large() Dominik Dingel
2015-05-28 11:52   ` Dominik Dingel
2015-05-28 11:52   ` Dominik Dingel
2015-05-28 11:52   ` Dominik Dingel
2015-05-28 11:52   ` Dominik Dingel
2015-06-01  7:35 ` [PATCH 0/5] Remove s390 sw-emulated hugepages and cleanup Christian Borntraeger
2015-06-01  7:35   ` Christian Borntraeger
2015-06-01  7:35   ` Christian Borntraeger
2015-06-01  7:35   ` Christian Borntraeger
2015-06-01  7:35   ` Christian Borntraeger
2015-06-02  7:46   ` Dominik Dingel
2015-06-02  7:46     ` Dominik Dingel
2015-06-02  7:46     ` Dominik Dingel
2015-06-02  7:46     ` Dominik Dingel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.