Received: by 10.223.185.116 with SMTP id b49csp2334746wrg; Mon, 12 Feb 2018 08:03:44 -0800 (PST) X-Google-Smtp-Source: AH8x224vRqjlu4D/RqfuPQ1CvKdrpr/jT4PGVn8VJer7C3Tmpmwx1HGMO9xJUe8JciP9LK35CBAh X-Received: by 10.99.37.7 with SMTP id l7mr9676797pgl.311.1518451424568; Mon, 12 Feb 2018 08:03:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518451424; cv=none; d=google.com; s=arc-20160816; b=RuNH2HBW/Fwy7O49wWHznKHgjfiVZsY7vAl838XiAwIF73vhpdqj6RcDbQPLDDGWj7 cr2IHshdP5jLgoPRePdy7VldeLvmd+VqNjx3s5v75NFQG36zjPHMsDyS+RoDxgpjv4e9 4rwchhtf6DLA6ZYUKof0gbRGzuSz9f7O0S+NopXfcpFWWD/AFf3GOk+5mStT3gYcQLgQ co2cGjvL2anaaTcMnznzEMaClpKfwtj0YEGoTs5Rq3A2yeWoNm3y73ZTm9ENI6IJXNS/ M8S9ginZdCIuidHT4eOO433/1uX5ZVnA3hk+wPa97hgtzf0Moru7mQXLmtbrEOOGz610 2+FA== 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:arc-authentication-results; bh=dBKaZ0juvIT9KJwAM79awEnX2jPL4/eCYJFV6EKFZYQ=; b=NnswE//+uIsq7KIUiBouLqP4GxEMgDailjvpytVtul9uMWWpyKkfNh8SWEAdDJ+pMA EALf9h9jNfbX8GckQBkbYQIeg7cZvNZefhev0+OzLfqHPglrI88RWdhxl9/vOcAN0Pwg SCE2Rjc1E1nNG6y+krxXSDKN6ofP+wPDzXKOA2j0A/cVqLcAo4si+ktM8Bn51avriXTj F70eGrDX5Ey2LaXtG2vhanswdSNwDot1hwWfYqSlakcEoUxqJqNECa6dcnFnUhklww+l zU9jsda3ABKnrMi4TKMw/UiKUUVW1Q+kge6Dop32QypKcVAd2DoCwgCt6+Hm4PlgmBMH CH0A== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b129si1127153pgc.89.2018.02.12.08.03.18; Mon, 12 Feb 2018 08:03:44 -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; 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 S934569AbeBLQAs (ORCPT + 99 others); Mon, 12 Feb 2018 11:00:48 -0500 Received: from foss.arm.com ([217.140.101.70]:42660 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932878AbeBLQAr (ORCPT ); Mon, 12 Feb 2018 11:00:47 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 01B451435; Mon, 12 Feb 2018 08:00:47 -0800 (PST) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9AF713F24D; Mon, 12 Feb 2018 08:00:44 -0800 (PST) Date: Mon, 12 Feb 2018 16:00:39 +0000 From: Mark Rutland To: Christoffer Dall Cc: linux-arm-kernel@lists.infradead.org, arnd@arndb.de, catalin.marinas@arm.com, cdall@linaro.org, kvmarm@lists.cs.columbia.edu, linux-arch@vger.kernel.org, marc.zyngier@arm.com, suzuki.poulose@arm.com, will.deacon@arm.com, yao.qi@arm.com, kernel-hardening@lists.openwall.com, linux-kernel@vger.kernel.org, awallis@codeaurora.org Subject: Re: [PATCHv2 05/12] arm64: Don't trap host pointer auth use to EL2 Message-ID: <20180212160039.br2emy3zt6ftmwfu@lakrids.cambridge.arm.com> References: <20171127163806.31435-1-mark.rutland@arm.com> <20171127163806.31435-6-mark.rutland@arm.com> <20180206123906.GZ21802@cbox> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180206123906.GZ21802@cbox> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 06, 2018 at 01:39:06PM +0100, Christoffer Dall wrote: > Hi Mark, > > On Mon, Nov 27, 2017 at 04:37:59PM +0000, Mark Rutland wrote: > > To allow EL0 (and/or EL1) to use pointer authentication functionality, > > we must ensure that pointer authentication instructions and accesses to > > pointer authentication keys are not trapped to EL2 (where we will not be > > able to handle them). > > ...on non-VHE systems, presumably? For EL0 usage, we don't want to trap even in the absence of VHE, so I'll drop the bit in brackets entirely. > > This patch ensures that HCR_EL2 is configured appropriately when the > > kernel is booted at EL2. For non-VHE kernels we set HCR_EL2.{API,APK}, > > ensuring that EL1 can access keys and permit EL0 use of instructions. > > For VHE kernels, EL2 access is controlled by EL3, and we need not set > > anything. > > > for VHE kernels host EL0 (TGE && E2H) is unaffected by these settings, > and it doesn't matter how we configure HCR_EL2.{API,APK}. > > (Because you do actually set these bits when the features are present if > I read the code correctly). Ah, true. I've taken your proposed wording. > > This does not enable support for KVM guests, since KVM manages HCR_EL2 > > itself. > > (...when running VMs.) > > > Besides the nits: > > Acked-by: Christoffer Dall Cheers! Mark.