From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6B20C43381 for ; Thu, 21 Mar 2019 06:41:20 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A00D2218AE for ; Thu, 21 Mar 2019 06:41:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QscqSdRa" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A00D2218AE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jKmu5oBbsj1VTwZA3LnAJKCjRqBs2l6AoUHS05VtKeA=; b=QscqSdRa3zguS859MOwsuMiME 7PNe6CtS3JDh8zw+AaR+gHEftvLnEwm7ycFO/Mrvc2IaSaNKfuJgPBBNXUIIBSJL0IDbZTYyzaXN6 sqnza+Bk0gENBkn2+v9P1EjauNRhEZL+7/X/NB765p7X9TvutjgbevRrq2JmsYDWcCQdn+KBqCc+d yjj4dr1lE/AEKMB0lFFBKRyxEjXHQpmw9DYhfQIPzmU7LzQo18tG7WyFFVGhKVkzs+g3Nq9PRpeHT wkxptuobqNB2c/zerxUsvkOvKcDUZDTxOyPYWNPuvvvdv5VxGxZSY1o0nBTPGfpGcDJ7sWcU62Ghm P8idIOrUg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6rO5-0003BH-Cn; Thu, 21 Mar 2019 06:41:13 +0000 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6rO2-0003Ax-7f for linux-arm-kernel@lists.infradead.org; Thu, 21 Mar 2019 06:41:11 +0000 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 42DB0A78; Wed, 20 Mar 2019 23:41:08 -0700 (PDT) Received: from [10.162.0.144] (a075553-lin.blr.arm.com [10.162.0.144]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7C4B13F59C; Wed, 20 Mar 2019 23:41:04 -0700 (PDT) Subject: Re: [PATCH v7 9/10] KVM: arm64: docs: document KVM support of pointer authentication To: Kristina Martsenko , Julien Thierry , linux-arm-kernel@lists.infradead.org References: <1552984243-7689-1-git-send-email-amit.kachhap@arm.com> <1552984243-7689-10-git-send-email-amit.kachhap@arm.com> <7bf19035-02ba-ae47-b08c-7d7622a45dbf@arm.com> <648d66dd-519c-7567-a3e1-c23208f68cf2@arm.com> <52d3f9c8-fc27-bf3d-f8f3-1b3921508a8c@arm.com> <6d84723d-e00e-e89f-4c42-d48d0eb03443@arm.com> From: Amit Daniel Kachhap Message-ID: <462c5f79-b0d6-8c4b-ce43-2dfcc0f3b7a6@arm.com> Date: Thu, 21 Mar 2019 12:11:01 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <6d84723d-e00e-e89f-4c42-d48d0eb03443@arm.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190320_234110_296427_710C5D95 X-CRM114-Status: GOOD ( 27.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Andrew Jones , Marc Zyngier , Catalin Marinas , Will Deacon , Christoffer Dall , kvmarm@lists.cs.columbia.edu, James Morse , Ramana Radhakrishnan , Dave Martin , linux-kernel@vger.kernel.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Julien/Kristina, On 3/21/19 2:26 AM, Kristina Martsenko wrote: > On 20/03/2019 18:06, Julien Thierry wrote: >> >> >> On 20/03/2019 15:04, Kristina Martsenko wrote: >>> On 20/03/2019 13:37, Julien Thierry wrote: >>>> Hi Amit, >>>> >>>> On 19/03/2019 08:30, Amit Daniel Kachhap wrote: >>>>> This adds sections for KVM API extension for pointer authentication. >>>>> A brief description about usage of pointer authentication for KVM guests >>>>> is added in the arm64 documentations. >>> >>> [...] >>> >>>>> diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt >>>>> index 7de9eee..b5c66bc 100644 >>>>> --- a/Documentation/virtual/kvm/api.txt >>>>> +++ b/Documentation/virtual/kvm/api.txt >>>>> @@ -2659,6 +2659,12 @@ Possible features: >>>>> Depends on KVM_CAP_ARM_PSCI_0_2. >>>>> - KVM_ARM_VCPU_PMU_V3: Emulate PMUv3 for the CPU. >>>>> Depends on KVM_CAP_ARM_PMU_V3. >>>>> + - KVM_ARM_VCPU_PTRAUTH_ADDRESS: >>>>> + - KVM_ARM_VCPU_PTRAUTH_GENERIC: >>>>> + Enables Pointer authentication for the CPU. >>>>> + Depends on KVM_CAP_ARM_PTRAUTH and only on arm64 architecture. If >>>>> + set, then the KVM guest allows the execution of pointer authentication >>>>> + instructions. Otherwise, KVM treats these instructions as undefined. >>>>> >>>> >>>> Overall I feel one could easily get confused to whether >>>> PTRAUTH_ADDRESS/GENERIC are two individual features, whether one is a >>>> superset of the other, if the names are just an alias of one another, etc... >>>> >>>> I think the doc should at least stress out that *both* flags are >>>> required to enable ptrauth in a guest. However it raises the question, >>>> if we don't plan to support the features individually (because we >>>> can't), should we really expose two feature flags? I seems odd to >>>> introduce two flags that only do something if used together... >>> >>> Why can't we support the features individually? For example, if we ever >>> get a system where all CPUs support address authentication and none of >>> them support generic authentication, then we could still support address >>> authentication in the guest. >>> >>> >> >> That's a good point, I didn't think of that. >> >> Although, currently we don't have a way to detect that we are in such a >> configuration. So as is, both flags are required to enable either >> feature, and I feel the documentation should be clear on that aspect. > > For now we only support enabling both features together, so both flags > need to be set. I agree that the documentation should be made clear on this. > > In the future, if we need to, we can add "negative" cpucaps to detect > that a feature is absent on all CPUs. > >> >> Another option would be to introduce a flag that enables both for now, >> and if one day we decide to support the configuration you mentioned we >> could add "more modular" flags that allow you to control those features >> individually. While a bit cumbersome, I would find that less awkward >> than having two flags that only do something if both are present. > > That would work too. > > I find it more logical to have two flags since there are two features > (two ID register fields), and KVM enables two features for the guest. > The fact that KVM does not currently support enabling them separately is > a KVM implementation choice, and could change in the future. Kristina, this comments of yours is actually what this patch series is trying to do. I should have added more details about the necessity of keeping two flags and enhancement of them is actually a future work. Thanks, Amit Daniel > > Thanks, > Kristina > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel