Messages in this thread Patch in this message | | | From | "H. Peter Anvin, Intel" <> | Subject | [PATCH v3 5/7] x86/segment: add #define for the last user-visible GDT slot | Date | Thu, 21 Jun 2018 14:17:52 -0700 |
| |
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
| |