[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <SA1PR11MB6734106794B247091E84D1CFA8829@SA1PR11MB6734.namprd11.prod.outlook.com>
Date: Sat, 18 Mar 2023 08:14:59 +0000
From: "Li, Xin3" <xin3.li@...el.com>
To: "Li, Xin3" <xin3.li@...el.com>,
"Hansen, Dave" <dave.hansen@...el.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"x86@...nel.org" <x86@...nel.org>
CC: "tglx@...utronix.de" <tglx@...utronix.de>,
"mingo@...hat.com" <mingo@...hat.com>,
"bp@...en8.de" <bp@...en8.de>,
"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
"hpa@...or.com" <hpa@...or.com>,
"bigeasy@...utronix.de" <bigeasy@...utronix.de>,
"Liu, Yujie" <yujie.liu@...el.com>,
"Kang, Shan" <shan.kang@...el.com>
Subject: RE: [PATCH 1/1] x86/vdso: use the right GDT_ENTRY_CPUNODE for 32-bit
getcpu() on 64-bit kernel
> > I think I'd much rather if we define all of the GDT_ENTRY_* macros in
> > *one* place, then make that *one* place depend on BUILD_VDSO32_64.
>
> Sounds a better way, let me try.
Hi Dave,
I tried the following patch, and it works:
diff --git a/arch/x86/include/asm/segment.h b/arch/x86/include/asm/segment.h
index 794f69625780..9d6411c65920 100644
--- a/arch/x86/include/asm/segment.h
+++ b/arch/x86/include/asm/segment.h
@@ -56,7 +56,7 @@
#define GDT_ENTRY_INVALID_SEG 0
-#ifdef CONFIG_X86_32
+#if defined(CONFIG_X86_32) && !defined(BUILD_VDSO32_64)
/*
* The layout of the per-CPU GDT under Linux:
*
It's simpler and looks reasonable to me. Is it what you suggested?
Thanks!
Xin
>
> > Also, about the *silent* failure... Do we not have a selftest for this
> somewhere?
>
> When lsl is used, we should check ZF which indicates whether the segment limit is
> loaded successfully. Seems we need to refactor vdso_read_cpunode() a bit.
>
> Xin
Powered by blists - more mailing lists