lkml.org 
[lkml]   [2018]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3 5/7] x86/segment: add #define for the last user-visible GDT slot
Date
From: "H. Peter Anvin" <hpa@linux.intel.com>

We don't want to advertise to user space how many slots the kernel
GDT has, but user space can trivially find out what the last
user-accessible GDT slot is. Add a #define for that so we can use
that in sizing a regset.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Chang S. Bae <chang.seok.bae@intel.com>
Cc: Markus T. Metzger <markus.t.metzger@intel.com>
---
arch/x86/include/asm/segment.h | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/arch/x86/include/asm/segment.h b/arch/x86/include/asm/segment.h
index e293c122d0d5..5eb809eec048 100644
--- a/arch/x86/include/asm/segment.h
+++ b/arch/x86/include/asm/segment.h
@@ -115,6 +115,11 @@
*/
#define GDT_ENTRIES 32

+/*
+ * Last user-visible GDT slot
+ */
+#define GDT_LAST_USER GDT_ENTRY_DEFAULT_USER_DS
+
/*
* Segment selector values corresponding to the above entries:
*/
@@ -194,6 +199,11 @@
*/
#define GDT_ENTRIES 16

+/*
+ * Last user-visible GDT slot
+ */
+#define GDT_LAST_USER GDT_ENTRY_PER_CPU
+
/*
* Segment selector values corresponding to the above entries:
*
--
2.14.4
\
 
 \ /
  Last update: 2018-06-21 23:18    [W:0.177 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site