Received: by 10.223.176.46 with SMTP id f43csp1179490wra; Fri, 26 Jan 2018 13:17:25 -0800 (PST) X-Google-Smtp-Source: AH8x226BPppwWkxXAvYpw7gsagWCVZBsgMZc6crhvL4UBRSk4WNtAUWiMGny/mbUqQTMRBJrSnQj X-Received: by 10.98.68.91 with SMTP id r88mr20349750pfa.52.1517001445113; Fri, 26 Jan 2018 13:17:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517001445; cv=none; d=google.com; s=arc-20160816; b=SDhk3x0ss09oz7FCm3RUWoB9whjWXCmcXsXBnic5IkXVFuQ8jExfQGUXwFF7MazfcY ss2mX5JfQP1ITTr9YS5EgFCirnJqsnEfHSWfUiG4wYNQjeHIXWX0lcJrfa7UqLnxjzU9 6coyo0astCmcchxJugq9hxFiSWbHdxwrSHOxcjHD+StSoXY2XS8jnURCLlw8J988g4bi LP/rD+ibYi+5tzhjzVQNzUWXOf6uO8RGteyHrrBdOJf9hQNaldyZxaaftTV4COTXyIMY ytqf9wtoKyYjr4HrRTfrvXrNlO5fvviPUU33UeHt3qlsGVIzjy6ktOxVMMpcBfcH+WZw GhKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=+9zOnBbiRhTmOy+wKsLOjt0neN1d1aseRg3ykECK9RI=; b=hOVCUNX9B2OjceQyRs3iuLKAPTJvJJBf2lBLi1IBM9YWMLiZdBZQlmgrtWgj1juoCn iqb8y4zyF+HSs27uU60/DYDrhPeWPmADrYea2eWuHe8HS1eHXNsD3HF7fbFLoGTAVqnu i1MQXcLzl7uNJOwHiTGQjFTtH6WKTt7aW7hda+YTafBIWlz97xGzrNELnzkHk9UzWjdb gj2AWlbalK3vKaBEZ2q0nxWu4gz9EoiuK3FxnlK2Ont2MfMiHk6woBkWB8Phz2yg/W49 9RLIvwQDSYtCegHg2FBclvbyfjz13p7n0IiSeAGU1gEwVmNJ7AAFAGmXBdANAdINO5DT 4bxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeblueprint-co-uk.20150623.gappssmtp.com header.s=20150623 header.b=CJMNE9Oh; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h3-v6si4224704pld.110.2018.01.26.13.17.10; Fri, 26 Jan 2018 13:17:25 -0800 (PST) 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; dkim=pass header.i=@codeblueprint-co-uk.20150623.gappssmtp.com header.s=20150623 header.b=CJMNE9Oh; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751606AbeAZVQr (ORCPT + 99 others); Fri, 26 Jan 2018 16:16:47 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:52691 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751257AbeAZVQp (ORCPT ); Fri, 26 Jan 2018 16:16:45 -0500 Received: by mail-wm0-f65.google.com with SMTP id g1so3757336wmg.2 for ; Fri, 26 Jan 2018 13:16:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codeblueprint-co-uk.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=+9zOnBbiRhTmOy+wKsLOjt0neN1d1aseRg3ykECK9RI=; b=CJMNE9OhfM+FhK0K+V4a/KGvBhgob+88nmxfvwqI2OK+gbxv1Etl7Mo9Mt1mmDsIyj 3WuK8I6b2ijgS/HgqfP6N6TsTvBG0QRuCBTNFc2WdseHrY8isKX73ofyAAD7dWfn4jFf kgpP0zFcrpTrzTUKT9sx/UcIv43ueeSgaPZtvWrOZrau7+MHZuIDKOffOYol+BIPxGYh 0sKVZIsaUXMwI9yOHIoW+yw+saXer4pm421l94BtYU1NTco+ETYwPHu+Dq7cJHw8C9ei kgxiBfDbn9heQAhl8iWfk31v50cNrPqbweAV2o5Wy0haI4B7FbrB4VBcpN0QzKyIvF9J gScA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+9zOnBbiRhTmOy+wKsLOjt0neN1d1aseRg3ykECK9RI=; b=EdeuLj+9wB3NMHA9strnudm9dNkAD8iiylSY4fiDRjC6aZTBp6Ae8MZ11IdvTJSpQT A+FaTtHGyqza6tso4gO4vCDbqCcu98ybSgqd0lNvct93ADf2pKATNtPaZ6SppajTbQWH 93fsdBAZuiP5YLjrMl68kEUnDN41l10b9AUEIEmxjcPGNt4TdnVPFXWSwKoxS89TaGi+ +vNvCqhgcrQtxmHHPIQXtc0R701TeW01oN4IOL5E1Zvewb5MWaoVTMDZf2PC5YA9MXXK zu4Ah+5hpmroBD6WD1M/P+5TR9vjjEj8YVusmyGWfdyB8xtI7r5Tzssxo6mgh/ABq3jK CwyA== X-Gm-Message-State: AKwxytcpGPcIiO7SrGk9qg8OCfSwlDBXgVZIOMVT/PlU0GToPNvba9zl Em1S6daGpOAxpAd0yPfST8t/VNTk X-Received: by 10.28.184.131 with SMTP id i125mr12845713wmf.44.1517001404640; Fri, 26 Jan 2018 13:16:44 -0800 (PST) Received: from localhost (97e0e0b1.skybroadband.com. [151.224.224.177]) by smtp.gmail.com with ESMTPSA id d195sm4952107wmd.2.2018.01.26.13.16.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Jan 2018 13:16:44 -0800 (PST) Date: Fri, 26 Jan 2018 21:16:43 +0000 From: Matt Fleming To: Sai Praneeth Prakhya Cc: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, "Lee, Chun-Yi" , Borislav Petkov , Tony Luck , Andy Lutomirski , "Michael S. Tsirkin" , Ricardo Neri , Ard Biesheuvel , Ravi Shankar Subject: Re: [PATCH V4 0/3] Use mm_struct and switch_mm() instead of manually Message-ID: <20180126211643.GB6520@codeblueprint.co.uk> References: <1516309264-23926-1-git-send-email-sai.praneeth.prakhya@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1516309264-23926-1-git-send-email-sai.praneeth.prakhya@intel.com> User-Agent: Mutt/1.5.24+42 (6e565710a064) (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 18 Jan, at 01:01:04PM, Sai Praneeth Prakhya wrote: > From: Sai Praneeth > > Presently, in x86, to invoke any efi function like > efi_set_virtual_address_map() or any efi_runtime_service() the code path > typically involves read_cr3() (save previous pgd), write_cr3() > (write efi_pgd) and calling efi function. Likewise after returning from > efi function the code path typically involves read_cr3() (save efi_pgd), > write_cr3() (write previous pgd). We do this couple of times in efi > subsystem of Linux kernel, instead we can use helper function > efi_switch_mm() to do this. This improves readability and maintainability. > Also, instead of maintaining a separate struct "efi_scratch" to store/restore > efi_pgd, we can use mm_struct to do this. FWIW this series looks OK to me. Reviewed-by: Matt Fleming