Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2672721imu; Sun, 9 Dec 2018 06:55:40 -0800 (PST) X-Google-Smtp-Source: AFSGD/WX1aqzcMoP3rDmAFQOcwz/0zsZFWBcmd4CIxEXIdEfpq8kuBP2muYAoWbIO8mOmqr4Lwuc X-Received: by 2002:a17:902:27a8:: with SMTP id d37mr9028440plb.182.1544367340553; Sun, 09 Dec 2018 06:55:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544367340; cv=none; d=google.com; s=arc-20160816; b=MjjT/Nlp3oPIvphCtT8G6EthehMurXvZJcsEp2Bzg5PufwyYjW/8xdibv7Lq9d6v6d 0DfhvOJZnzmimxvUeZuEzVAPK8dfC1ee6MkvPaSFj1AhDPRbQZbwJj+2RsCXnx3wssrv gFGYlu+hjpN0UcW7D35kUh3Cg9YRsavUcknNStK+Zg8gDkJe46vbQk0h06yU8jOXx0V0 PYMCDhFwZmZLObzES6jyZor8BgTHobkheg1lxFYi5navDOL+LL+n1YwGvHJwBE4/6LyW 9nKVzblIBX4HDusPrLQH0uW6jQi0b1LjV1BlbudiiW3D4ur+SdCH8iVnCEVOwk/4LJfX jLOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:openpgp:from:references:cc:to:subject:dkim-signature; bh=8q3h34D+ijHUeMnXl1JgT1WVE0pSvnjtsDGTiKr2glA=; b=LbyUm/ezWzVjfN2RVpY/G3cmUX2Q+2BDbJaPHCqxZMsW0siI16h6e3mlPtRg3EG24g O2DX8s8+7fMzQ9fEAOJ+A/RQeuBksezulN3vkIyXt7tRg8KoJEFlykt6mKVfVH4kOFAo ymT5+0jZ2E+tklV0eRa/WabOMyUh8txXj2L3CGvhYOsFBkKINvUQdsSASTll/U5cRMue hsnQfAISfWmoZsrCnEvDQbslrkO6puDdYM99hXRTorc48Je5rPps7t+mngEGl/rCp+/p MvPB74BGHUaQ5lwW31qlifT4saRdfoIhp00K56OZqDpgdGmWPxBEQK+3DMccu24HkNVq DnLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c462RHqa; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d16si8005477pfn.169.2018.12.09.06.55.24; Sun, 09 Dec 2018 06:55:40 -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=@linaro.org header.s=google header.b=c462RHqa; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726279AbeLIOyt (ORCPT + 99 others); Sun, 9 Dec 2018 09:54:49 -0500 Received: from mail-oi1-f193.google.com ([209.85.167.193]:44075 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726227AbeLIOyt (ORCPT ); Sun, 9 Dec 2018 09:54:49 -0500 Received: by mail-oi1-f193.google.com with SMTP id m6so7013340oig.11 for ; Sun, 09 Dec 2018 06:54:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:openpgp:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=8q3h34D+ijHUeMnXl1JgT1WVE0pSvnjtsDGTiKr2glA=; b=c462RHqaFAiIp6tR/25rD6U3kKPR4EQ4TrilxO8vggdlc9UBw2QaMC1j+54WQyOVhZ BWvpjE/INDonXdYnB0jXLc207GVjhScWe6BzhTuLwbBseclGB7tN/7TinEU3UHwWpgke DG1fpEVM45X3tvh0EZqZ2SB3/G04zNvpk4mvs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=8q3h34D+ijHUeMnXl1JgT1WVE0pSvnjtsDGTiKr2glA=; b=E8lJaQVerdATdhvA15BA7/mXSLAUk67yBseQGVjoESNBDn22sdLRrjuMC70aZT7gjx xF3Neym7Uf6aTxzl/AnXvVx1lfXmA+xjxle31zhETjvFHyc+cKA3ZXEoH4a1wXJ25P6h LLzm0Mn6n8+E8r7AtpgslwmE/x69sB1NU+tEZ7Jy7+dN71JHsCbG4oPa/sxLK5FSxlNV EYasFMB2W3rWI+xyn8Bs2GG4DSXGrKqXsDb3ArAArtRIEKMSuKsu7D4JyW7UN3J1wefh xMTyzhDFRjaR4fp9UmgyCIL+EHjWhYrz3jhYxIOQc3IqZH7pq7HApqDAsOZ/qJlD8F8g WwWA== X-Gm-Message-State: AA+aEWZrYV15FN7s7wmgnvwZpimNGj7F+KNGiFOQA3C8Lsp9kseR90iu DTAIC90oqzWjLg+mJHhsieK/1OTBBxcQxg== X-Received: by 2002:aca:5641:: with SMTP id k62mr5722322oib.339.1544367287779; Sun, 09 Dec 2018 06:54:47 -0800 (PST) Received: from cloudburst.twiddle.net ([187.217.227.243]) by smtp.gmail.com with ESMTPSA id z191sm5933824oig.3.2018.12.09.06.54.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Dec 2018 06:54:47 -0800 (PST) Subject: Re: [PATCH v6 05/13] arm64: Don't trap host pointer auth use to EL2 To: Kristina Martsenko , linux-arm-kernel@lists.infradead.org Cc: Adam Wallis , Amit Kachhap , Andrew Jones , Ard Biesheuvel , Catalin Marinas , Christoffer Dall , Cyrill Gorcunov , Dave P Martin , Jacob Bramley , Kees Cook , Marc Zyngier , Mark Rutland , Ramana Radhakrishnan , Suzuki K Poulose , Will Deacon , kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org References: <20181207183931.4285-1-kristina.martsenko@arm.com> <20181207183931.4285-6-kristina.martsenko@arm.com> From: Richard Henderson Openpgp: preference=signencrypt Message-ID: Date: Sun, 9 Dec 2018 08:54:44 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: <20181207183931.4285-6-kristina.martsenko@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/7/18 12:39 PM, Kristina Martsenko wrote: > From: Mark Rutland > > 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. > > 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 host EL0 (TGE && E2H) is unaffected by these settings, > and it doesn't matter how we configure HCR_EL2.{API,APK}, so we don't > bother setting them. > > This does not enable support for KVM guests, since KVM manages HCR_EL2 > itself when running VMs. > > Signed-off-by: Mark Rutland > Signed-off-by: Kristina Martsenko > Acked-by: Christoffer Dall > Cc: Catalin Marinas > Cc: Marc Zyngier > Cc: Will Deacon > Cc: kvmarm@lists.cs.columbia.edu > --- > arch/arm64/include/asm/kvm_arm.h | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) Reviewed-by: Richard Henderson r~