Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752625AbeAETD7 (ORCPT + 1 other); Fri, 5 Jan 2018 14:03:59 -0500 Received: from mga03.intel.com ([134.134.136.65]:50676 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752162AbeAETD6 (ORCPT ); Fri, 5 Jan 2018 14:03:58 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,319,1511856000"; d="scan'208";a="8191174" Subject: Re: [PATCH 05/23] x86, kaiser: unmap kernel from userspace page tables (core patch) To: Jiri Kosina References: <20171123003438.48A0EEDE@viggo.jf.intel.com> <20171123003447.1DB395E3@viggo.jf.intel.com> <93776eb2-b6d4-679a-280c-8ba558a69c34@linux.intel.com> <20a54a5f-f4e5-2126-fb73-6a995d13d52d@linux.intel.com> Cc: Yisheng Xie , linux-kernel@vger.kernel.org, linux-mm@kvack.org, richard.fellner@student.tugraz.at, moritz.lipp@iaik.tugraz.at, daniel.gruss@iaik.tugraz.at, michael.schwarz@iaik.tugraz.at, luto@kernel.org, Linus Torvalds , keescook@google.com, hughd@google.com, x86@kernel.org, Andrea Arcangeli From: Dave Hansen Message-ID: <282e2a56-ded1-6eb9-5ecb-22858c424bd7@linux.intel.com> Date: Fri, 5 Jan 2018 11:03:56 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 01/05/2018 10:19 AM, Jiri Kosina wrote: > --- a/arch/x86/platform/efi/efi_64.c > +++ b/arch/x86/platform/efi/efi_64.c > @@ -95,6 +95,12 @@ pgd_t * __init efi_call_phys_prolog(void > save_pgd[pgd] = *pgd_offset_k(pgd * PGDIR_SIZE); > vaddress = (unsigned long)__va(pgd * PGDIR_SIZE); > set_pgd(pgd_offset_k(pgd * PGDIR_SIZE), *pgd_offset_k(vaddress)); > + /* > + * pgprot API doesn't clear it for PGD > + * > + * Will be brought back automatically in _epilog() > + */ > + pgd_offset_k(pgd * PGDIR_SIZE)->pgd &= ~_PAGE_NX; > } > __flush_tlb_all(); Wait a sec... Where does the _PAGE_USER come from? Shouldn't we see the &init_mm in there and *not* set _PAGE_USER?