Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp421039imb; Fri, 1 Mar 2019 04:25:17 -0800 (PST) X-Google-Smtp-Source: APXvYqwi39wGt6H88fU9SrNxocMiCpcic/g8d8ToY/idLMgp4sIZUL2KaAvErTdxMqf81tdz3X4R X-Received: by 2002:a17:902:1c9:: with SMTP id b67mr5130303plb.176.1551443117602; Fri, 01 Mar 2019 04:25:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551443117; cv=none; d=google.com; s=arc-20160816; b=t81hAZ3lsl7glGcp4WucrluzAEZXZMPZ+IN6TTFMUhyCvXts6XM5tjLlAvxgKlF9co eamrXw+g3sKvl3GABUR6MIMVfbpYZbMdjCTTFBV8UuKC0ff/NjEQ6RpJWl8q6ayBWrAc d0NrJEQVFcU9qFFIDlHkx9lZdsLNWlcmptBsonFtQSlt/YXQPBhC5xv9VigHhMrwYH0O U33vHDWw++9VH5s/XjYnXHg/9VZf3lMowH1o96QfuPGaxrN8tROr3ytfT8dIkeRzetjg QaR22F80vAwrZhPQWzWS7rcDixWzfh11hVlkdJ0siXysL9pnI9PdDjhIhFKyfkfePVQh m7Mw== 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 :content-id:user-agent:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:subject:cc:to :from:dkim-signature; bh=vt3XGWCkAvk8xyzjHn+dfI9Ufitf73f50bPQh7P+YeM=; b=h8u6hDQbJ1IQ3/vdhiSUlJUpL/K0TpSvFu1YJPPlVudltb+eFkkF258JNp+ChkvSCs 0qCtn+tU9msiwB5cRfXSV1Tf/UbMBjrKcTkY+yPcTUHjZGJWbQCMI8Z2iPzZBDQM0fnO zhDTLnLv/mE4FQ4g5K+qjdufH5Bw3fFJCJbaWaI2wxO2ciz5SFjOJMq7Vcu+74OEAQ7H fbrdBrL76iry0tdCmxBpYKN8PIs3DjF2fKHzAQiYnPyLYrsf9Ya6lZt03Eo70evw4MYg mPMdBmDC0y/l8D5QDQgxiiqGIsS4RbEv5GXsjR1GFayZDQZmWSJz+AFhwGBt6QYPCEcJ dgTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector1-arm-com header.b=oyIiRAYl; 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 z18si20646616pgf.66.2019.03.01.04.25.02; Fri, 01 Mar 2019 04:25:17 -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=@armh.onmicrosoft.com header.s=selector1-arm-com header.b=oyIiRAYl; 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 S1732637AbfCAMWc (ORCPT + 99 others); Fri, 1 Mar 2019 07:22:32 -0500 Received: from mail-eopbgr30080.outbound.protection.outlook.com ([40.107.3.80]:49543 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728149AbfCAMWc (ORCPT ); Fri, 1 Mar 2019 07:22:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vt3XGWCkAvk8xyzjHn+dfI9Ufitf73f50bPQh7P+YeM=; b=oyIiRAYlR/8N/9xy1YP3DGaC40TJJDQNRNOrhxCZv1AbdyWguGAuToV+Nh0UpTuB/i0xXw9l7iQP9iwB1q8NSpSo9elbiAyEv9uPYSr0I1GuStDaVN6ow3ygXSQyqSF+FTqTyOU3zoIpxdCdzqQ2Ije8Hk7ZWL/McVRoW6koaYk= Received: from DB5PR0801MB1590.eurprd08.prod.outlook.com (10.167.230.14) by DB5PR0801MB1543.eurprd08.prod.outlook.com (10.167.229.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1665.15; Fri, 1 Mar 2019 12:22:13 +0000 Received: from DB5PR0801MB1590.eurprd08.prod.outlook.com ([fe80::ac52:cef2:374a:afbd]) by DB5PR0801MB1590.eurprd08.prod.outlook.com ([fe80::ac52:cef2:374a:afbd%2]) with mapi id 15.20.1643.022; Fri, 1 Mar 2019 12:22:13 +0000 From: Dave P Martin To: Amit Kachhap CC: "linux-arm-kernel@lists.infradead.org" , Marc Zyngier , Catalin Marinas , Will Deacon , Kristina Martsenko , "kvmarm@lists.cs.columbia.edu" , Ramana Radhakrishnan , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v6 4/6] arm64/kvm: add a userspace option to enable pointer authentication Thread-Topic: [PATCH v6 4/6] arm64/kvm: add a userspace option to enable pointer authentication Thread-Index: AQHUyDUHomsoycWuT0aO9zX8kUcTe6X2lXv/gAAs5YA= Date: Fri, 1 Mar 2019 12:22:13 +0000 Message-ID: <20190301122211.GT16031@e103592.cambridge.arm.com> References: <1550568271-5319-1-git-send-email-amit.kachhap@arm.com> <1550568271-5319-5-git-send-email-amit.kachhap@arm.com> <20190221155350.GY3567@e103592.cambridge.arm.com> <56edb86f-7205-4714-823a-d26005d175ab@arm.com> In-Reply-To: <56edb86f-7205-4714-823a-d26005d175ab@arm.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Mutt/1.5.23 (2014-03-12) x-originating-ip: [217.140.106.49] x-clientproxiedby: LNXP265CA0037.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5c::25) To DB5PR0801MB1590.eurprd08.prod.outlook.com (2603:10a6:0:3b::14) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Dave.Martin@arm.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 608fd9d8-ca4f-40dc-72eb-08d69e408915 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020);SRVR:DB5PR0801MB1543; x-ms-traffictypediagnostic: DB5PR0801MB1543: x-microsoft-exchange-diagnostics: 1;DB5PR0801MB1543;20:w9uE29gx1TZC+UD1pHkdlFN7CI94hBNxG+vUEF+Ve90gc792GYPkMiGpEMTrKDj9widBEGl6CcLIEEPq4XahADaHsZ65ENMfMFTEssaw4fzdNsERCrRygOGSGSNbRa+jlG9Z8TY+/sum4TzxfDApLo3AumySnJD1Un7aEnZ6GbU= x-microsoft-antispam-prvs: x-forefront-prvs: 09634B1196 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39860400002)(136003)(346002)(366004)(396003)(376002)(199004)(189003)(40434004)(446003)(6862004)(71190400001)(53936002)(8676002)(71200400001)(68736007)(6246003)(386003)(53546011)(6506007)(66066001)(476003)(5660300002)(11346002)(72206003)(97736004)(478600001)(14444005)(5024004)(256004)(229853002)(6436002)(81166006)(6116002)(81156014)(3846002)(6486002)(486006)(25786009)(6512007)(305945005)(86362001)(93886005)(14454004)(8936002)(76176011)(6636002)(316002)(105586002)(33656002)(106356001)(58126008)(186003)(54906003)(99286004)(4326008)(26005)(102836004)(52116002)(7736002)(1076003)(2906002)(18370500001);DIR:OUT;SFP:1101;SCL:1;SRVR:DB5PR0801MB1543;H:DB5PR0801MB1590.eurprd08.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: MATtJzummZy2aylwttEqvu7TLB16jbX/hpaTL1b2LpWItgXpLAsJFBBuAtjwjUTZ4NqaqqFaEKfZIUaHGiIQgX62BQmmcNjJxMLHbTErBkyqq0lNLsQDN6DW/cPlqb3vYBJrrTZytevNeaRpEYfJy14Z6/C3FPeYBqgh7yws//F8Jzdno3PDi6Sa7Q3WOJajzfUOCkl10+c1e2ySZ58N/bGN7vHtfOJJJAc2wvs3o0Lrrn2R2XBcUjk9kUaIkEmpAUINUwf8KbSuXCAWy+1g9f4dYLouTr9fxkntUORbxOKHAKWXLGve8bBm0hugRhXZEurzm1y/I22w8thNRUO6igAbJVdDKpmV+EeM1TNX1ybx2ZGpuRlTDw1G/VFYvLUooHapgQ28kuiaEhF27naS3+igwF57uT9k1q5rr3aX4PU= Content-Type: text/plain; charset="us-ascii" Content-ID: <54399122237D6D478067621271C8CF64@eurprd08.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 608fd9d8-ca4f-40dc-72eb-08d69e408915 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Mar 2019 12:22:13.2892 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR0801MB1543 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 01, 2019 at 09:41:20AM +0000, Amit Daniel Kachhap wrote: > Hi, > > On 2/21/19 9:23 PM, Dave Martin wrote: > > On Tue, Feb 19, 2019 at 02:54:29PM +0530, Amit Daniel Kachhap wrote: > >> This feature will allow the KVM guest to allow the handling of > >> pointer authentication instructions or to treat them as undefined > >> if not set. It uses the existing vcpu API KVM_ARM_VCPU_INIT to > >> supply this parameter instead of creating a new API. > >> > >> A new register is not created to pass this parameter via > >> SET/GET_ONE_REG interface as just a flag (KVM_ARM_VCPU_PTRAUTH) > >> supplied is enough to enable this feature. > >> > >> Signed-off-by: Amit Daniel Kachhap > >> Cc: Mark Rutland > >> Cc: Marc Zyngier > >> Cc: Christoffer Dall > >> Cc: kvmarm@lists.cs.columbia.edu [...] > >> diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c > >> index 12529df..f7bcc60 100644 > >> --- a/arch/arm64/kvm/sys_regs.c > >> +++ b/arch/arm64/kvm/sys_regs.c > >> @@ -1055,7 +1055,7 @@ static bool access_cntp_cval(struct kvm_vcpu *vc= pu, > >> } > >> > >> /* Read a sanitised cpufeature ID register by sys_reg_desc */ > >> -static u64 read_id_reg(struct sys_reg_desc const *r, bool raz) > >> +static u64 read_id_reg(struct kvm_vcpu *vcpu, struct sys_reg_desc con= st *r, bool raz) > >> { > >> u32 id =3D sys_reg((u32)r->Op0, (u32)r->Op1, > >> (u32)r->CRn, (u32)r->CRm, (u32)r->Op2); > >> @@ -1071,7 +1071,7 @@ static u64 read_id_reg(struct sys_reg_desc const= *r, bool raz) > >> (0xfUL << ID_AA64ISAR1_API_SHIFT) | > >> (0xfUL << ID_AA64ISAR1_GPA_SHIFT) | > >> (0xfUL << ID_AA64ISAR1_GPI_SHIFT); > >> -if (!kvm_supports_ptrauth()) { > >> +if (!kvm_arm_vcpu_ptrauth_allowed(vcpu)) { > >> kvm_debug("ptrauth unsupported for guests, suppressing\n"); > >> val &=3D ~ptrauth_mask; > >> } > >> @@ -1095,7 +1095,7 @@ static bool __access_id_reg(struct kvm_vcpu *vcp= u, > >> if (p->is_write) > >> return write_to_read_only(vcpu, p, r); > >> > >> -p->regval =3D read_id_reg(r, raz); > >> +p->regval =3D read_id_reg(vcpu, r, raz); > >> return true; > >> } > > > > The SVE KVM series makes various overlapping changes to propagate vcpuo > > into the relevant places, but hopefully the rebase is not too painful. > > Many of the changes are probably virtually identical between the two > > series. > > > > See for example [1]. Maybe you could cherry-pick and drop the > > equivalent changes here (though if your series is picked up first, I > > will live with it ;) > Yes no issue. I will cherry-pick your specific patch and rebase mine on i= t. OK, thanks. Unfortunately it is likely to churn a bit due to review-- my v6 series will rename some stuff. Hopefully it will be stable from then on. Cheers ---Dave IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.