[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171129220359.GA24360@roeck-us.net>
Date: Wed, 29 Nov 2017 14:03:59 -0800
From: Guenter Roeck <linux@...ck-us.net>
To: Ingo Molnar <mingo@...nel.org>
Cc: linux-kernel@...r.kernel.org,
Dave Hansen <dave.hansen@...ux.intel.com>,
Andy Lutomirski <luto@...capital.net>,
Thomas Gleixner <tglx@...utronix.de>,
"H . Peter Anvin" <hpa@...or.com>,
Peter Zijlstra <peterz@...radead.org>,
Borislav Petkov <bp@...en8.de>,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [08/24] x86/mm/kaiser: Map the dynamically-allocated LDTs
On Mon, Nov 27, 2017 at 11:49:07AM +0100, Ingo Molnar wrote:
> From: Dave Hansen <dave.hansen@...ux.intel.com>
>
> Normally, a process has a NULL mm->context.ldt. But, there is a
> syscall for a process to set a new one. If a process does that,
> the LDT be mapped into the user page tables, just like the
> default copy.
>
> The original KAISER patch missed this case.
>
> Signed-off-by: Dave Hansen <dave.hansen@...ux.intel.com>
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> Cc: Andy Lutomirski <luto@...nel.org>
> Cc: Borislav Petkov <bp@...en8.de>
> Cc: Brian Gerst <brgerst@...il.com>
> Cc: Denys Vlasenko <dvlasenk@...hat.com>
> Cc: H. Peter Anvin <hpa@...or.com>
> Cc: Josh Poimboeuf <jpoimboe@...hat.com>
> Cc: Linus Torvalds <torvalds@...ux-foundation.org>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Rik van Riel <riel@...hat.com>
> Cc: daniel.gruss@...k.tugraz.at
> Cc: hughd@...gle.com
> Cc: keescook@...gle.com
> Cc: linux-mm@...ck.org
> Cc: michael.schwarz@...k.tugraz.at
> Cc: moritz.lipp@...k.tugraz.at
> Cc: richard.fellner@...dent.tugraz.at
> Link: https://lkml.kernel.org/r/20171123003455.275397F7@viggo.jf.intel.com
> Signed-off-by: Ingo Molnar <mingo@...nel.org>
> ---
> arch/x86/kernel/ldt.c | 25 ++++++++++++++++++++-----
> 1 file changed, 20 insertions(+), 5 deletions(-)
>
...
> +
> /* The caller must call finalize_ldt_struct on the result. LDT starts zeroed. */
> static struct ldt_struct *alloc_ldt_struct(unsigned int num_entries)
> {
> struct ldt_struct *new_ldt;
> unsigned int alloc_size;
> + int ret;
>
> if (num_entries > LDT_ENTRIES)
> return NULL;
> @@ -89,6 +100,12 @@ static struct ldt_struct *alloc_ldt_struct(unsigned int num_entries)
> return NULL;
> }
>
> + ret = kaiser_add_mapping((unsigned long)new_ldt->entries, alloc_size,
> + __PAGE_KERNEL | _PAGE_GLOBAL);
This results in:
arch/x86/kernel/ldt.c: In function ‘alloc_ldt_struct’:
arch/x86/kernel/ldt.c:104:6: warning: large integer implicitly truncated to
unsigned type [-Woverflow]
__PAGE_KERNEL | _PAGE_GLOBAL);
^
in ARCH=i386 builds with CONFIG_X86_PAE enabled. See
https://groups.google.com/forum/#!topic/cros-kernel-buildreports/8R41aX07daU
Guenter
Powered by blists - more mailing lists