From: "H. Peter Anvin" <[email protected]> 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) <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Chang S. Bae <[email protected]> Cc: Markus T. Metzger <[email protected]> --- 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

