From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752793AbdKXGfT (ORCPT ); Fri, 24 Nov 2017 01:35:19 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:43881 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751507AbdKXGfS (ORCPT ); Fri, 24 Nov 2017 01:35:18 -0500 X-Google-Smtp-Source: AGs4zMarClnQG38/vEa6EALjWnRkPp7kiQIDxUr+VhUAWutbrwgqoXxvLPTcJjnx7W98tgd6YclJAg== Date: Fri, 24 Nov 2017 07:35:14 +0100 From: Ingo Molnar To: Dave Hansen Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, moritz.lipp@iaik.tugraz.at, daniel.gruss@iaik.tugraz.at, michael.schwarz@iaik.tugraz.at, richard.fellner@student.tugraz.at, luto@kernel.org, torvalds@linux-foundation.org, keescook@google.com, hughd@google.com, x86@kernel.org, jgross@suse.com Subject: Re: [PATCH 00/23] [v4] KAISER: unmap most of the kernel from userspace page tables Message-ID: <20171124063514.36xlqnh5seszy4nu@gmail.com> References: <20171123003438.48A0EEDE@viggo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Dave Hansen wrote: > I've updated these a bit since yesterday with some minor fixes: > * Fixed KASLR compile bug > * Fixed ds.c compile problem > * Changed ulong to pteval_t to fix 32-bit compile problem > * Stop mapping cpu_current_top_of_stack (never used until after CR3 switch) > > Rather than re-spamming everyone, the resulting branch is here: > > https://git.kernel.org/pub/scm/linux/kernel/git/daveh/x86-kaiser.git/log/?h=kaiser-414-tipwip-20171123 > > If anyone wants to be re-spammed, just say the word. So the pteval_t changes break the build on most non-x86 architectures (alpha, arm, arm64, etc.), because most of them don't have an asm/pgtable_types.h file. pteval_t is an x86-ism. So I left out the changes below. Thanks, Ingo diff --git a/arch/x86/include/asm/kaiser.h b/arch/x86/include/asm/kaiser.h index 35f12a8a7071..2198855f7de9 100644 --- a/arch/x86/include/asm/kaiser.h +++ b/arch/x86/include/asm/kaiser.h @@ -18,6 +18,8 @@ #ifndef __ASSEMBLY__ #ifdef CONFIG_KAISER +#include + /** * kaiser_add_mapping - map a kernel range into the user page tables * @addr: the start address of the range @@ -31,7 +33,7 @@ * table. */ extern int kaiser_add_mapping(unsigned long addr, unsigned long size, - unsigned long flags); + pteval_t flags); /** * kaiser_add_mapping_cpu_entry - map the cpu entry area diff --git a/arch/x86/mm/kaiser.c b/arch/x86/mm/kaiser.c index 1eb27b410556..58cae2924724 100644 --- a/arch/x86/mm/kaiser.c +++ b/arch/x86/mm/kaiser.c @@ -431,7 +431,7 @@ void __init kaiser_init(void) } int kaiser_add_mapping(unsigned long addr, unsigned long size, - unsigned long flags) + pteval_t flags) { return kaiser_add_user_map((const void *)addr, size, flags); } diff --git a/include/linux/kaiser.h b/include/linux/kaiser.h index 83d465599646..f662013515a1 100644 --- a/include/linux/kaiser.h +++ b/include/linux/kaiser.h @@ -4,7 +4,11 @@ #ifdef CONFIG_KAISER #include #else + #ifndef __ASSEMBLY__ + +#include + /* * These stubs are used whenever CONFIG_KAISER is off, which * includes architectures that support KAISER, but have it @@ -20,7 +24,7 @@ static inline void kaiser_remove_mapping(unsigned long start, unsigned long size } static inline int kaiser_add_mapping(unsigned long addr, unsigned long size, - unsigned long flags) + pteval_t flags) { return 0; }