Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp408680imb; Fri, 1 Mar 2019 04:06:00 -0800 (PST) X-Google-Smtp-Source: APXvYqyl1b+AfiEUe0hKhcsuV6W/uIAC9nET7jNlCLU4DQASkbYp9Pc88LC+C3be43xoVMTE7SiS X-Received: by 2002:a63:3d4b:: with SMTP id k72mr4392381pga.362.1551441960283; Fri, 01 Mar 2019 04:06:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551441960; cv=none; d=google.com; s=arc-20160816; b=SaTAQRVlgfKZ9QE6G+JSS4rdamzpuU0dcxjPo4NrozTuHT2bLeQ+NP5tVhgwwZx/n5 enviE+E9qbw0JmBF0MCoCVMcEK5DlBBsrGgWOVvvO/c3ZnTVOQIyf+aouRfoWttLuhO9 kDLuZOKwQDQtqSNOO++E26tyKKasSA7cnJYBOS94Avku+3acGIN/3aa+tNF74CkxeMp3 xc+y9oXUgwwATExsn6UIvKupx2sicawowH5zAgK+N1C9j61as6uVr3Jc/z2OnRu3HGeG nZJ8OgpVVh0wV1sfbl3/iBH8BC/ZrkCYBEum71nht2Sono1WfnlEh3t4XvBYlyTewAns qOZg== 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=tLxH7+9FvP9SCJC58TYtKbEMAGhdngc8QCK4XxuWzec=; b=zVrISrU1zdq01ka/CWVb683wmY2Ykq9FlfjXeCU2jTE1j0d7vKwNUxoi7SB6OTRO7k uSd2URAKSQoSs+T7FJZ1UfEPMuuOfD+w6hiHtlV4KRcscHlCUJ4L/osbtK1ascr7HtjH 0h/mi2g5t3Vuic227e3f/8+3mSesqDmyaQ4lqTBwI6fLoqYU/ryAxqNxDZ0iruNcc7Wd v/2KLq21bsPCIbo4NCgtW3ZloKQuDu0GO6CCBpm042lidBOPn9X42fdlqm6dCkvs4mfm iyKyYmt7ZNdfvRSDFzNqFHc17cPFnKyo9GRJP9/lFnmcUHi6wyaQyZFW7d2dDWrXh9LQ bqtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector1-arm-com header.b=IW4LnsC8; 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 u21si17114281pgk.295.2019.03.01.04.05.43; Fri, 01 Mar 2019 04:06:00 -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=IW4LnsC8; 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 S2387510AbfCALY7 (ORCPT + 99 others); Fri, 1 Mar 2019 06:24:59 -0500 Received: from mail-eopbgr30061.outbound.protection.outlook.com ([40.107.3.61]:45954 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727952AbfCALY6 (ORCPT ); Fri, 1 Mar 2019 06:24:58 -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=tLxH7+9FvP9SCJC58TYtKbEMAGhdngc8QCK4XxuWzec=; b=IW4LnsC8aKZNU7FJZlxTQb02fInkfFU1ncH1lXMUIo1gIvJz0dglNm3j0hBcErMHLz1PEfbbq0XpberzPecpE3+so/eqgh13VucvmI6T6TDD84ReHgwC6jduBSajc1RxAqjgc3gw0nkS5YCpFXDLIRKXF1fZLMlZPxu8vwREBa4= Received: from DB5PR0801MB1590.eurprd08.prod.outlook.com (10.167.230.14) by DB5PR0801MB1544.eurprd08.prod.outlook.com (10.167.229.154) 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 11:24:55 +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 11:24:54 +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: [kvmtool PATCH v6 6/6] arm/kvm: arm64: Add a vcpu feature for pointer authentication Thread-Topic: [kvmtool PATCH v6 6/6] arm/kvm: arm64: Add a vcpu feature for pointer authentication Thread-Index: AQHUyDUOH0S96lHnNUqqzBY6pIzdJ6X2pUibgAANFAA= Date: Fri, 1 Mar 2019 11:24:54 +0000 Message-ID: <20190301112452.GS16031@e103592.cambridge.arm.com> References: <1550568271-5319-1-git-send-email-amit.kachhap@arm.com> <1550568271-5319-7-git-send-email-amit.kachhap@arm.com> <20190221155409.GA3567@e103592.cambridge.arm.com> <048f772a-1faf-5fa3-d82c-25212a5104af@arm.com> In-Reply-To: <048f772a-1faf-5fa3-d82c-25212a5104af@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: LO2P265CA0214.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9e::34) 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: 9d4b22a2-b484-4b63-e4ba-08d69e38874d 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:DB5PR0801MB1544; x-ms-traffictypediagnostic: DB5PR0801MB1544: x-microsoft-exchange-diagnostics: 1;DB5PR0801MB1544;20:aHQrxyivKDmjAmeQrAHc0s9uUME3LR3qU51DDq5BDIFcdBTClD+asyY2xXFnauInm0cEgb6b41OE4eoUQcHIg3K2p+BxuiDfNkpFQjpxlpigbZvdwyN3JJcLR/ZD4AfE5+VUS28cif7SSfFgPI+8oFb0/NS1+kfCKDN0zzc7jag= x-microsoft-antispam-prvs: x-forefront-prvs: 09634B1196 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(366004)(39860400002)(396003)(376002)(136003)(40434004)(199004)(189003)(256004)(14444005)(486006)(5024004)(1076003)(52116002)(71200400001)(71190400001)(93886005)(186003)(2906002)(446003)(76176011)(86362001)(316002)(102836004)(33656002)(6506007)(386003)(26005)(53546011)(58126008)(99286004)(476003)(54906003)(11346002)(66066001)(229853002)(53936002)(6486002)(72206003)(105586002)(4326008)(8676002)(305945005)(7736002)(478600001)(5660300002)(97736004)(6512007)(68736007)(14454004)(81156014)(81166006)(6636002)(106356001)(8936002)(6246003)(6116002)(3846002)(6436002)(6862004)(25786009)(18370500001);DIR:OUT;SFP:1101;SCL:1;SRVR:DB5PR0801MB1544;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: pWdgY5RmmNPKnW8CL+uZhuSVVDzAhLtNUX+SrSYUuNm9Ls2DMMqchee0uhJfnDiElTSjreNk7BTiR1JdqcCJQgYZqPWzU6IQI6wG2/7EGmRqQRb21M5KIbAh+G6yQWv6GNdjOMrSENT9fC0lr5ILfLWxv+6NvvIzjeoAsZNd4Loqcsd70ToX6wf4WcIlDM6mgpaECQvSKbUmXNUo9djLJh5QM4h0lwfVCjpLiw1XOi71Ns5Kc3F8dB816vZW+YqaZpFI7TJ6p+1pwBLMqsbM4piJR12nNhW2UZ0VkzwiEZqfdtSh6LKrryEBBM7NYlyh/aPlS7h1lNliwLBS1ScXDsM5vvrkVo4JfG9FN4Sdp/z0KgwlgA/b5GkxJjQ12r2IbSt3oHD3aP1T711jk5HKrGQyR+uEr2ADHnjlxGAdNj4= Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9d4b22a2-b484-4b63-e4ba-08d69e38874d X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Mar 2019 11:24:54.3198 (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: DB5PR0801MB1544 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 10:37:54AM +0000, Amit Daniel Kachhap wrote: > Hi, > > On 2/21/19 9:24 PM, Dave Martin wrote: > > On Tue, Feb 19, 2019 at 02:54:31PM +0530, Amit Daniel Kachhap wrote: [...] > >> diff --git a/arm/aarch64/include/kvm/kvm-config-arch.h b/arm/aarch64/i= nclude/kvm/kvm-config-arch.h > >> index 04be43d..2074684 100644 > >> --- a/arm/aarch64/include/kvm/kvm-config-arch.h > >> +++ b/arm/aarch64/include/kvm/kvm-config-arch.h > >> @@ -8,7 +8,9 @@ > >> "Create PMUv3 device"),\ > >> OPT_U64('\0', "kaslr-seed", &(cfg)->kaslr_seed,\ > >> "Specify random seed for Kernel Address Space "\ > >> -"Layout Randomization (KASLR)"), > >> +"Layout Randomization (KASLR)"),\ > >> +OPT_BOOLEAN('\0', "ptrauth", &(cfg)->has_ptrauth,\ > >> +"Enable address authentication"), > > > > Nit: doesn't this enable address *and* generic authentication? The > > discussion on what capababilities and enables the ABI exposes probably > > needs to conclude before we can finalise this here. > ok. > > > > However, I would recommend that we provide a single option here that > > turns both address authentication and generic authentication on, even > > if the ABI treats them independently. This is expected to be the commo= n > > case by far. > ok > > > > We can always add more fine-grained options later if it turns out to be > > necessary. > Mark suggested to provide 2 flags [1] for Address and Generic > authentication so I was thinking of adding 2 features like, > > +#define KVM_ARM_VCPU_PTRAUTH_ADDR4 /* CPU uses pointer address > authentication */ > +#define KVM_ARM_VCPU_PTRAUTH_GENERIC5 /* CPU uses pointer generic > authentication */ > > And supply both of them concatenated in VCPU_INIT stage. Kernel KVM > would expect both feature requested together. Seems reasonable. Do you mean the kernel would treat it as an error if only one of these flags is passed to KVM_ARM_VCPU_INIT, or would KVM simply treat them as independent? [...] > >> diff --git a/arm/kvm-cpu.c b/arm/kvm-cpu.c > >> index 7780251..4ac80f8 100644 > >> --- a/arm/kvm-cpu.c > >> +++ b/arm/kvm-cpu.c > >> @@ -68,6 +68,12 @@ struct kvm_cpu *kvm_cpu__arch_init(struct kvm *kvm,= unsigned long cpu_id) > >> vcpu_init.features[0] |=3D (1UL << KVM_ARM_VCPU_PSCI_0_2); > >> } > >> > >> +/* Set KVM_ARM_VCPU_PTRAUTH if available */ > >> +if (kvm__supports_extension(kvm, KVM_CAP_ARM_PTRAUTH)) { > >> +if (kvm->cfg.arch.has_ptrauth) > >> +vcpu_init.features[0] |=3D ARM_VCPU_PTRAUTH_FEATURE; > >> +} > >> + > > > > I'm not too keen on requiring a dummy #define for AArch32 here. How do > > we handle other subarch-specific feature flags? Is there something we > > can reuse? > I will check it. OK 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.