Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp3048937imd; Mon, 29 Oct 2018 00:28:39 -0700 (PDT) X-Google-Smtp-Source: AJdET5dTUbn5iPZEijWkehXxrGb2qpteIP4Vwd+VnDDC5SN0ICsir7ZbAXSPJRgdo6pOZvp4Shds X-Received: by 2002:a65:6295:: with SMTP id f21-v6mr12813502pgv.167.1540798119434; Mon, 29 Oct 2018 00:28:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540798119; cv=none; d=google.com; s=arc-20160816; b=H5wNdZ3N1nLA6DUQBGRGWvLkpeF17tNSO0Mu76saUq+0fLlOG5V04GeKTVN0rWaiPE a2rST/jyKc1GJmHqczCNaF3zsSGVsuo1X4mWvJl5cP+2eXSkF8jrjvyvOm29bjuExXs9 b75ydKLYovs9w+1sF5KMQXhbe08Y1uBvMNu0TL8oJEXua/8bxvfESz3ycPeiQvjI3vRD OY1jDqb09noBgHPC0ZMgQyMSS1LeDifWgnID82C1c1Wj1vT9pwjuhsIFbw/GaHbgICyo eLjWaa6jtn0yMOXI/zpdk8xfKAGguUQkKNV7HzqcPlDTweT1DDf432j4ozcezioeA+us pd7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from; bh=dVR5AsvcBLpRK/qOWAi0zFfLeoq1ypRRaU2S9cH5WwA=; b=yu2VAAJPvwCa+xyXEQV/MJOoYnQlg3zRqW3ZWL9W4ehD3ZErqTswx0rUAzamNEzrtu HfEvBaT4FY2CIsDFZrBKubT9ZCsrDNSavUPWiOPRCNx6KeBZi52by4zrPrpo5vA6Tywl bPvC18UkGV5KEDDriD+ZEYZlbAW12pBnxcWo2lV6CRlYTrUx3cARq5W/EA1qtCcbkKOl l9XY7FUZ+TpydbFp2AcG+Io2AVjFk3z42G7jTHtBuS55FXMOnleQyvfMpoQ8IToDm3zi SLpklkmmdh7fJgOrOUOV+0tKyoXDSVRYzPvokRH9T9nhM6IZ0BoBc+tdbAgVV5QhPQlP YrYw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d11-v6si8800901plo.184.2018.10.29.00.28.24; Mon, 29 Oct 2018 00:28:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729526AbeJ2QN6 convert rfc822-to-8bit (ORCPT + 99 others); Mon, 29 Oct 2018 12:13:58 -0400 Received: from mga03.intel.com ([134.134.136.65]:36886 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729295AbeJ2QN6 (ORCPT ); Mon, 29 Oct 2018 12:13:58 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Oct 2018 00:26:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,439,1534834800"; d="scan'208";a="269612290" Received: from orsmsx102.amr.corp.intel.com ([10.22.225.129]) by orsmga005.jf.intel.com with ESMTP; 29 Oct 2018 00:26:32 -0700 Received: from orsmsx114.amr.corp.intel.com ([169.254.8.128]) by ORSMSX102.amr.corp.intel.com ([169.254.3.81]) with mapi id 14.03.0415.000; Mon, 29 Oct 2018 00:26:31 -0700 From: "Prakhya, Sai Praneeth" To: Ingo Molnar CC: "linux-efi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "x86@kernel.org" , Borislav Petkov , "Andy Lutomirski" , "Hansen, Dave" , "Bhupesh Sharma" , Thomas Gleixner , "Peter Zijlstra" , Ard Biesheuvel Subject: RE: [PATCH V2 1/2] x86/efi: Unmap EFI boot services code/data regions from efi_pgd Thread-Topic: [PATCH V2 1/2] x86/efi: Unmap EFI boot services code/data regions from efi_pgd Thread-Index: AQHUbXSDlG5yxQFZuUKIGr9tlrL5CKU2Na4A//+f6EA= Date: Mon, 29 Oct 2018 07:26:30 +0000 Message-ID: References: <20181026213845.28166-1-sai.praneeth.prakhya@intel.com> <20181026213845.28166-2-sai.praneeth.prakhya@intel.com> <20181029060708.GB128403@gmail.com> In-Reply-To: <20181029060708.GB128403@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOWY1MzhiZmUtYTNhZS00NTlkLThlYWMtYzM1ZDljZjI5NGUyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoic0R3NGFPRW5ZZUNKTDFBcGhaQlk3MWw2UW5BQ09GS1E4K2lOSFpuck9yU0dvekhIYnNFYTBUTHRNdm5PQVp6TSJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.22.254.138] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > +int kernel_unmap_pages_in_pgd(pgd_t *pgd, unsigned long address, > > + unsigned long numpages) > > +{ > > + int retval; > > + > > + /* > > + * The typical sequence for unmapping is to find a pte through > > + * lookup_address_in_pgd() (ideally, it should never return NULL > because > > + * the address is already mapped) and change it's protections. > > + * As pfn is the *target* of a mapping, it's not useful while unmapping. > > + */ > > + struct cpa_data cpa = { > > + .vaddr = &address, > > + .pgd = pgd, > > + .numpages = numpages, > > + .mask_set = __pgprot(0), > > + .mask_clr = __pgprot(_PAGE_PRESENT | _PAGE_RW), > > + .flags = 0, > > + }; > > + > > + retval = __change_page_attr_set_clr(&cpa, 0); > > + __flush_tlb_all(); > > So, just to clarify, 'pfn' is kept at 0 here? Might make sense to write it out > explicitly like 'flags', even if it's not used by __change_page_attr_set_clr(). Sure! Makes sense. I will add it. Regards, Sai