Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933683AbeAKWnq (ORCPT + 1 other); Thu, 11 Jan 2018 17:43:46 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:38664 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933341AbeAKWno (ORCPT ); Thu, 11 Jan 2018 17:43:44 -0500 Subject: Re: [PATCH 4.4 00/37] 4.4.110-stable review To: Thomas Gleixner , Linus Torvalds Cc: Pavel Tatashin , Greg Kroah-Hartman , Andy Lutomirski , Hugh Dickins , Thomas Voegtle , Linux Kernel Mailing List , Andrew Morton , Guenter Roeck , Shuah Khan , patches@kernelci.org, Ben Hutchings , lkft-triage@lists.linaro.org, stable , Matt Fleming , Borislav Petkov References: <20180105175229.GA29834@kroah.com> <20180105204557.GA8839@kroah.com> <20180107104540.GB14783@kroah.com> <20180108074645.GA24062@kroah.com> From: Steven Sistare Organization: Oracle Corporation Message-ID: <9a74cb17-fdb7-d8c7-cb3a-c7efb436cc81@oracle.com> Date: Thu, 11 Jan 2018 17:42:05 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8771 signatures=668652 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801110304 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 1/11/2018 5:30 PM, Thomas Gleixner wrote: > On Thu, 11 Jan 2018, Thomas Gleixner wrote: >> On Thu, 11 Jan 2018, Linus Torvalds wrote: >> >>> On Thu, Jan 11, 2018 at 12:37 PM, Thomas Gleixner wrote: >>>> >>>> 67a9108ed431 ("x86/efi: Build our own page table structures") >>>> >>>> got rid of EFI depending on real_mode_header->trampoline_pgd >>> >>> So I think it only got rid of by default - the codepath is still >>> there, the allocation is still there, it's just that it's not actually >>> used unless somebody does that "efi=old_mmap" thing. >> >> Yes, the trampoline_pgd is still around, but I can't figure out how it >> would be used after boot. Confused, digging more. > > So coming back to the same commit. From the changelog: > > This is caused by mapping EFI regions with RWX permissions. > There isn't much we can do to restrict the permissions for these > regions due to the way the firmware toolchains mix code and > data, but we can at least isolate these mappings so that they do > not appear in the regular kernel page tables. > > In commit d2f7cbe7b26a ("x86/efi: Runtime services virtual > mapping") we started using 'trampoline_pgd' to map the EFI > regions because there was an existing identity mapping there > which we use during the SetVirtualAddressMap() call and for > broken firmware that accesses those addresses. > > So this very commit gets rid of the (ab)use of trampoline_pgd and allocates > efi_pgd, which we made use the proper size. > > trampoline_pgd is since then only used to get into long mode in > realmode/rm/trampoline_64.S and for reboot in machine_real_restart(). > > The runtime services stuff does not use it in kernel versions >= 4.6 > > Thanks, > > tglx Yes, and addressing Linus' concern about EFI_OLD_MEMMAP, those paths are independent of it. When EFI_OLD_MMAP is enabled, the efi pgd is not used, and the bug will not bite. - Steve