[Devel] [PATCH RHEL7 COMMIT] vdso/ia32: Revert monotonic time virtualization for ia32

Konstantin Khorenko khorenko at virtuozzo.com
Mon Jul 10 15:47:12 MSK 2017


The commit is pushed to "branch-rh7-3.10.0-514.26.1.vz7.33.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-514.26.1.vz7.33.2
------>
commit 1e58ba50c20bf02dbc26098bb65a4b5a7152b210
Author: Dmitry Safonov <dsafonov at virtuozzo.com>
Date:   Mon Jul 10 16:47:12 2017 +0400

    vdso/ia32: Revert monotonic time virtualization for ia32
    
    As vz-kernel is based on v3.10 kernel and __vdso_gettimeofday()
    was added to vdso page laterly, we don't need to virtualize
    clocks in case of ia32 clock_gettime()/vdso_gettimeofday().
    
    So, they are present in ms, but our kernel yet have poorer
    vdso32.lds.S:
    VERSION
    {
    	LINUX_2.5 {
    	global:
    		__kernel_vsyscall;
    		__kernel_sigreturn;
    		__kernel_rt_sigreturn;
    	local: *;
    	};
    }
    
    https://jira.sw.ru/browse/PSBM-68050
    
    Fixes: commit 25960eecc77e ("ve/vdso: virtualized monotonic gettime
    through vdso") and commit 481382a5f63e ("vdso32: Fix monotonic time
    virtualization for ia32)".
    
    Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
    Acked-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
 arch/x86/vdso/vclock_gettime.c |  2 --
 arch/x86/vdso/vdso32-setup.c   | 11 ++++++-----
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/arch/x86/vdso/vclock_gettime.c b/arch/x86/vdso/vclock_gettime.c
index e3f80ba..7c218ce 100644
--- a/arch/x86/vdso/vclock_gettime.c
+++ b/arch/x86/vdso/vclock_gettime.c
@@ -28,8 +28,6 @@
 #define gtod (&VVAR(vsyscall_gtod_data))
 
 struct timespec VDSO64_ve_start_timespec;
-extern struct timespec VDSO32_ve_start_timespec
-	__attribute__((weak, alias("VDSO64_ve_start_timespec")));
 
 notrace static cycle_t vread_tsc(void)
 {
diff --git a/arch/x86/vdso/vdso32-setup.c b/arch/x86/vdso/vdso32-setup.c
index 70e1cc4..81a16c8 100644
--- a/arch/x86/vdso/vdso32-setup.c
+++ b/arch/x86/vdso/vdso32-setup.c
@@ -344,8 +344,10 @@ static struct page **uts_prep_vdso_pages_locked(int map)
 		 * preallocated one.
 		 */
 		new_version = KERNEL_VERSION(n1, n2, n3);
+		if (new_version == LINUX_VERSION_CODE)
+			goto out;
 #ifdef CONFIG_X86_32
-		{
+		else {
 			/*
 			 * Native x86-32 mode requires vDSO runtime
 			 * relocations applied which is not supported
@@ -368,8 +370,8 @@ static struct page **uts_prep_vdso_pages_locked(int map)
 		 * better than walk out with error.
 		 */
 		pr_warn_once("Wrong release uts name format detected."
-			     " Using host's uts name.\n");
-		new_version = LINUX_VERSION_CODE;
+			     " Ignoring vDSO virtualization.\n");
+		goto out;
 	}
 
 	mutex_lock(&vdso32_mutex);
@@ -399,9 +401,7 @@ static struct page **uts_prep_vdso_pages_locked(int map)
 	copy_page(page_address(new_pages[0]), page_address(vdso32_pages[0]));
 
 	addr = page_address(new_pages[0]);
-	uts_ns->vdso32.addr = addr;
 	*((int *)(addr + uts_ns->vdso32.version_off)) = new_version;
-	*((struct timespec*)(VDSO32_SYMBOL(uts_ns->vdso32.addr, ve_start_timespec))) = ve->start_timespec;
 	smp_wmb();
 
 	pages = uts_ns->vdso32.pages = new_pages;
@@ -411,6 +411,7 @@ static struct page **uts_prep_vdso_pages_locked(int map)
 
 out_unlock:
 	mutex_unlock(&vdso32_mutex);
+out:
 	down_write(&mm->mmap_sem);
 	return pages;
 }


More information about the Devel mailing list