Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1690288 > unrolled thread

[PATCHv2 02/10] x86/xen: Provide pre-built page tables only for XEN_PV and XEN_PVH

Started by"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
First post2017-07-18 16:20 +0200
Last post2017-07-18 16:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCHv2 02/10] x86/xen: Provide pre-built page tables only for XEN_PV and XEN_PVH "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2017-07-18 16:20 +0200

#1690288 — [PATCHv2 02/10] x86/xen: Provide pre-built page tables only for XEN_PV and XEN_PVH

From"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Date2017-07-18 16:20 +0200
Subject[PATCHv2 02/10] x86/xen: Provide pre-built page tables only for XEN_PV and XEN_PVH
Message-ID<u4BvX-3ta-1@gated-at.bofh.it>
Looks like we only need pre-built page tables for XEN_PV and XEN_PVH
cases. Let's not provide them for other configuration.

This patch if preparation for boot-time switching between 4- and 5-level
paging. pgd_index() is going to depend on a variable and cannot be
easily used in head_64.S.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/kernel/head_64.S | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index 6225550883df..979b388d5e37 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -37,11 +37,12 @@
  *
  */
 
-#define p4d_index(x)	(((x) >> P4D_SHIFT) & (PTRS_PER_P4D-1))
 #define pud_index(x)	(((x) >> PUD_SHIFT) & (PTRS_PER_PUD-1))
 
+#if defined(CONFIG_XEN_PV) || defined(CONFIG_XEN_PVH)
 PGD_PAGE_OFFSET = pgd_index(__PAGE_OFFSET_BASE)
 PGD_START_KERNEL = pgd_index(__START_KERNEL_map)
+#endif
 L3_START_KERNEL = pud_index(__START_KERNEL_map)
 
 	.text
@@ -345,10 +346,7 @@ NEXT_PAGE(early_dynamic_pgts)
 
 	.data
 
-#ifndef CONFIG_XEN
-NEXT_PAGE(init_top_pgt)
-	.fill	512,8,0
-#else
+#if defined(CONFIG_XEN_PV) || defined(CONFIG_XEN_PVH)
 NEXT_PAGE(init_top_pgt)
 	.quad   level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE
 	.org    init_top_pgt + PGD_PAGE_OFFSET*8, 0
@@ -365,6 +363,9 @@ NEXT_PAGE(level2_ident_pgt)
 	 * Don't set NX because code runs from these pages.
 	 */
 	PMDS(0, __PAGE_KERNEL_IDENT_LARGE_EXEC, PTRS_PER_PMD)
+#else
+NEXT_PAGE(init_top_pgt)
+	.fill	512,8,0
 #endif
 
 #ifdef CONFIG_X86_5LEVEL
-- 
2.11.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web