[PATCH 3.16-stable 2/5] x86/kaiser: Add PVCLOCK_FIXMAP user mapping

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Code lifted from patch 'x86/mm/kaiser: re-enable vsyscalls', courtesy of
Andrea Arcangeli <aarcange@xxxxxxxxxx>.

Signed-off-by: Juerg Haefliger <juerg.haefliger@xxxxxxxxxxxxx>
---
 arch/x86/mm/kaiser.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/x86/mm/kaiser.c b/arch/x86/mm/kaiser.c
index 8b5939649088..fc50dee484f6 100644
--- a/arch/x86/mm/kaiser.c
+++ b/arch/x86/mm/kaiser.c
@@ -322,7 +322,7 @@ silent_disable:
  */
 void __init kaiser_init(void)
 {
-	int cpu;
+	int cpu, idx;
 
 	if (!kaiser_enabled)
 		return;
@@ -371,6 +371,14 @@ void __init kaiser_init(void)
 		kaiser_add_user_map_early((void *)VSYSCALL_ADDR, PAGE_SIZE,
 					  vsyscall_pgprot);
 
+#ifdef CONFIG_PARAVIRT_CLOCK
+	for (idx = 0; idx <= (PVCLOCK_FIXMAP_END-PVCLOCK_FIXMAP_BEGIN); idx++) {
+		kaiser_add_user_map_early((void *)__fix_to_virt(PVCLOCK_FIXMAP_BEGIN + idx),
+					  PAGE_SIZE,
+					  __PAGE_KERNEL_VVAR | _PAGE_GLOBAL);
+	}
+#endif
+
 	pr_info("enabled\n");
 }
 
-- 
2.14.1




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]