lkml.org 
[lkml]   [2019]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 04/14] x86/exceptions: Make IST index zero based
On Sun, Mar 31, 2019 at 11:40:24PM +0200, Thomas Gleixner wrote:
> The defines for the exception stack (IST) array in the TSS are using the
> SDM convention IST1 - IST7. That causes all sorts of code to subtract 1 for
> array indices related to IST. That's confusing at best and does not provide
> any value.
>
> Make the indices zero based and fixup the usage sites. The only code which
> needs to adjust the 0 based index is the interrupt descriptor setup which
> needs to add 1 now.
>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> ---
> Documentation/x86/kernel-stacks | 8 ++++----
> arch/x86/entry/entry_64.S | 4 ++--
> arch/x86/include/asm/page_64_types.h | 13 ++++++++-----
> arch/x86/kernel/cpu/common.c | 4 ++--
> arch/x86/kernel/dumpstack_64.c | 14 +++++++-------
> arch/x86/kernel/idt.c | 15 +++++++++------
> 6 files changed, 32 insertions(+), 26 deletions(-)
>
> --- a/Documentation/x86/kernel-stacks
> +++ b/Documentation/x86/kernel-stacks
> @@ -59,7 +59,7 @@ If that assumption is ever broken then t
>
> The currently assigned IST stacks are :-
>
> -* DOUBLEFAULT_STACK. EXCEPTION_STKSZ (PAGE_SIZE).
> +* DOUBLEFAULT_IST. EXCEPTION_STKSZ (PAGE_SIZE).
>
> Used for interrupt 8 - Double Fault Exception (#DF).
>
> @@ -68,7 +68,7 @@ The currently assigned IST stacks are :-
> Using a separate stack allows the kernel to recover from it well enough
> in many cases to still output an oops.
>
> -* NMI_STACK. EXCEPTION_STKSZ (PAGE_SIZE).
> +* NMI_IST. EXCEPTION_STKSZ (PAGE_SIZE).
>
> Used for non-maskable interrupts (NMI).
>
> @@ -76,7 +76,7 @@ The currently assigned IST stacks are :-
> middle of switching stacks. Using IST for NMI events avoids making
> assumptions about the previous state of the kernel stack.
>
> -* DEBUG_STACK. DEBUG_STKSZ
> +* DEBUG_IST. DEBUG_STKSZ

What about <name>_STACK_IST, or is that too verbose? It'd be nice to have
the extra mental cue that IST is referring the 64 exception stacks.

>
> Used for hardware debug interrupts (interrupt 1) and for software
> debug interrupts (INT3).
> @@ -86,7 +86,7 @@ The currently assigned IST stacks are :-
> avoids making assumptions about the previous state of the kernel
> stack.
>
> -* MCE_STACK. EXCEPTION_STKSZ (PAGE_SIZE).
> +* MCE_IST. EXCEPTION_STKSZ (PAGE_SIZE).
>
> Used for interrupt 18 - Machine Check Exception (#MC).
>

\
 
 \ /
  Last update: 2019-04-02 18:49    [W:0.959 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site