Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp828202imu; Wed, 23 Jan 2019 06:26:04 -0800 (PST) X-Google-Smtp-Source: ALg8bN5i+Ei+ddIMq3YpR91AK+F51k3Mt2xXk9BKrW5ZrJEvYB8MIzsXJ0473Jodd5MAmk/9Z+T8 X-Received: by 2002:a17:902:7687:: with SMTP id m7mr2377466pll.187.1548253564109; Wed, 23 Jan 2019 06:26:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548253564; cv=none; d=google.com; s=arc-20160816; b=UpJF2ZwYVcuVsAXu/821SXPysUbCti6pHvmqbcPpV1FEDHzt/nIpJXIPBNJs0psg6K gwXLCLkLwdjgTUAPUhyICSfSvqu4leYBENsnkNYebkKOYdbAqj0Ki/8QC4mR410RkT2l fq7Uhz5MdXmNA4hOTMZeye8TOqrR/p9JHkd9JwA1jPNJ6LzlyO4ruvPQo7uGZHYcJvUR GwlybHJ/bEZOo6AS2LOLByC5uqBYtn7E9byDWnXoz0CeIIPokViZ9HdMnbimSEqyrD88 oXFL+9fTSrz7v9B9QdPL9lphEF36+uZDaYWHPM0Vf2Ih1aLU/dDCQocsYKvCIFLGzUZj 2CjQ== 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; bh=mtInZWeP+1nXSBmMf6rmgiXyVE9XvxmUAuy37MI+UwY=; b=p2OZUOCgx1omuRKG2rKsDl5klqfx9GvPNnj+Alx3uHoz8ToN1k/t7y/HcpNoQfXdKv BSdxV+36AaxC64h0xMIJzxnD5h4M11UQbcOIlG00NZgvaVx4/beV8fvnHx0uTvzk6eh1 sc8GJPPA88u8sp0f+whfQ1MgvgpzzEPHdqifZ9kNXY+OAtMZv+YAMaUro7Lnb2FX2LOZ bwRNQXixVy5D0tZIR87FV/Kl0sEynBUSuS+f524FDT1W19CprSX8FPqoE943y4Pq0ILM 8S/0rnbG225qDL+DO0ifb8464H6aHMKwT2m/0N9cDU6FG1tn1tKbIBoAFM5OcYcwxzXb zHxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=JI0+aiuB; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d37si19614911plb.140.2019.01.23.06.25.36; Wed, 23 Jan 2019 06:26:04 -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=@oracle.com header.s=corp-2018-07-02 header.b=JI0+aiuB; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727108AbfAWOXn (ORCPT + 99 others); Wed, 23 Jan 2019 09:23:43 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:32958 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726604AbfAWOXm (ORCPT ); Wed, 23 Jan 2019 09:23:42 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id x0NEJH3B054119; Wed, 23 Jan 2019 14:21:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2018-07-02; bh=mtInZWeP+1nXSBmMf6rmgiXyVE9XvxmUAuy37MI+UwY=; b=JI0+aiuBb0WsolFazGJpEpyEyyB3xA8g/w8jK5piT+iXIyZv6jvTelIVUdWt6wI396Or qIn6//z0LA0EM+cuTP4DmQWHHi6g5RbUEuHPevNTsYkel8t0s5ZPxgEsdRYVZglKq9x4 7f8/khoSLYpL0VIL9UWRc6dOpFwN6M1oc1CFY4ypIi0kJzaksMU+zaEjjzIoaOzGYM1l SdzFv6Ye8da3H7HeBMkC10IJ3DY35T1H2sbinbTxsOhBDud5E8OyRZkuahV6OgsnL8zl ZKB6HWukA3XFkuh/fZ8fzPYf05178nUUBHcl6R17h6bhRlP7zNG5DERZAczssw7i+pfc jg== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2q3sdej8s2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 23 Jan 2019 14:21:46 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x0NELjCD026616 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 23 Jan 2019 14:21:45 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x0NELi9t014770; Wed, 23 Jan 2019 14:21:44 GMT Received: from Konrads-MacBook-Pro.local (/75.104.64.133) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 23 Jan 2019 06:21:44 -0800 Date: Wed, 23 Jan 2019 09:20:49 -0500 From: Konrad Rzeszutek Wilk To: Khalid Aziz Cc: juergh@gmail.com, tycho@tycho.ws, jsteckli@amazon.de, ak@linux.intel.com, torvalds@linux-foundation.org, liran.alon@oracle.com, keescook@google.com, Juerg Haefliger , deepa.srinivasan@oracle.com, chris.hyser@oracle.com, tyhicks@canonical.com, dwmw@amazon.co.uk, andrew.cooper3@citrix.com, jcm@redhat.com, boris.ostrovsky@oracle.com, kanth.ghatraju@oracle.com, joao.m.martins@oracle.com, jmattson@google.com, pradeep.vincent@oracle.com, john.haxby@oracle.com, tglx@linutronix.de, kirill.shutemov@linux.intel.com, hch@lst.de, steven.sistare@oracle.com, kernel-hardening@lists.openwall.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Tycho Andersen Subject: Re: [RFC PATCH v7 05/16] arm64/mm: Add support for XPFO Message-ID: <20190123142047.GB19289@Konrads-MacBook-Pro.local> References: <89f03091af87f5ab27bd6cafb032236d5bd81d65.1547153058.git.khalid.aziz@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <89f03091af87f5ab27bd6cafb032236d5bd81d65.1547153058.git.khalid.aziz@oracle.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9144 signatures=668682 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-1810050000 definitions=main-1901230107 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 10, 2019 at 02:09:37PM -0700, Khalid Aziz wrote: > From: Juerg Haefliger > > Enable support for eXclusive Page Frame Ownership (XPFO) for arm64 and > provide a hook for updating a single kernel page table entry (which is > required by the generic XPFO code). > > v6: use flush_tlb_kernel_range() instead of __flush_tlb_one() > > CC: linux-arm-kernel@lists.infradead.org > Signed-off-by: Juerg Haefliger > Signed-off-by: Tycho Andersen > Signed-off-by: Khalid Aziz > --- > arch/arm64/Kconfig | 1 + > arch/arm64/mm/Makefile | 2 ++ > arch/arm64/mm/xpfo.c | 58 ++++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 61 insertions(+) > create mode 100644 arch/arm64/mm/xpfo.c > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > index ea2ab0330e3a..f0a9c0007d23 100644 > --- a/arch/arm64/Kconfig > +++ b/arch/arm64/Kconfig > @@ -171,6 +171,7 @@ config ARM64 > select SWIOTLB > select SYSCTL_EXCEPTION_TRACE > select THREAD_INFO_IN_TASK > + select ARCH_SUPPORTS_XPFO > help > ARM 64-bit (AArch64) Linux support. > > diff --git a/arch/arm64/mm/Makefile b/arch/arm64/mm/Makefile > index 849c1df3d214..cca3808d9776 100644 > --- a/arch/arm64/mm/Makefile > +++ b/arch/arm64/mm/Makefile > @@ -12,3 +12,5 @@ KASAN_SANITIZE_physaddr.o += n > > obj-$(CONFIG_KASAN) += kasan_init.o > KASAN_SANITIZE_kasan_init.o := n > + > +obj-$(CONFIG_XPFO) += xpfo.o > diff --git a/arch/arm64/mm/xpfo.c b/arch/arm64/mm/xpfo.c > new file mode 100644 > index 000000000000..678e2be848eb > --- /dev/null > +++ b/arch/arm64/mm/xpfo.c > @@ -0,0 +1,58 @@ > +/* > + * Copyright (C) 2017 Hewlett Packard Enterprise Development, L.P. > + * Copyright (C) 2016 Brown University. All rights reserved. > + * > + * Authors: > + * Juerg Haefliger > + * Vasileios P. Kemerlis > + * > + * This program is free software; you can redistribute it and/or modify it > + * under the terms of the GNU General Public License version 2 as published by > + * the Free Software Foundation. > + */ > + > +#include > +#include > + > +#include > + > +/* > + * Lookup the page table entry for a virtual address and return a pointer to > + * the entry. Based on x86 tree. > + */ > +static pte_t *lookup_address(unsigned long addr) The x86 also has level. Would it make sense to include that in here?