[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cfcd0693-e5ea-ddbe-622a-bde24e58f84a@intel.com>
Date: Mon, 13 Nov 2017 11:19:25 -0800
From: Dave Hansen <dave.hansen@...el.com>
To: Andy Lutomirski <luto@...nel.org>, X86 ML <x86@...nel.org>
Cc: Borislav Petkov <bpetkov@...e.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Brian Gerst <brgerst@...il.com>,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [RFC 5/7] x86/asm: Rearrange struct cpu_tss to enlarge
SYSENTER_stack and fix alignment
On 11/10/2017 08:05 PM, Andy Lutomirski wrote:
> struct tss_struct {
> /*
> + * Space for the temporary SYSENTER stack. Used for the entry
> + * trampoline as well. Size it such that tss_struct ends up
> + * as a multiple of PAGE_SIZE. This calculation assumes that
> + * io_bitmap is a multiple of PAGE_SIZE (8192 bytes) plus one
> + * long.
> + */
> + unsigned long SYSENTER_stack_canary;
> + unsigned long SYSENTER_stack[(PAGE_SIZE - sizeof(struct x86_hw_tss)) / sizeof(unsigned long) - 2];
> +
> + /*
> * The hardware state:
> */
> struct x86_hw_tss x86_tss;
> @@ -337,15 +347,9 @@ struct tss_struct {
> * be within the limit.
> */
> unsigned long io_bitmap[IO_BITMAP_LONGS + 1];
> -
> - /*
> - * Space for the temporary SYSENTER stack.
> - */
> - unsigned long SYSENTER_stack_canary;
> - unsigned long SYSENTER_stack[64];
> } ____cacheline_aligned;
If io_bitmap[] is already page-size-aligned, how does it help us to move
SYSENTER_stack[]?
It seems like it would be easier to just leave SYSENTER_stack[] where it
is, make it SYSENTER_stack[0], and just find somewhere else to choose
how much to bloat the tss_struct *allocation* instead of trying to make
sure that sizeof(tss_struct) matches the allocation.
That SYSENTER_stack[] size calculation is pretty hideous. :)
Powered by blists - more mailing lists