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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id BA5F9C52D7C for ; Wed, 21 Aug 2024 16:50:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=s/G9gjxb6NomFROT8B575ZsnZNhrcjwASWeuVNaJPGs=; b=rkOdM00E1Zn8m9VNexv3JFvJ6T SFlxXcoLxjul14VkZ6wPaXZHlvqfkW1Iz7+0nyQC///U76bnS/FYmj4BPtzyUM+SMu+/6sYtC/QIF zP+u38IQ9qzhDpFPAy3xt/Ra9gkwC32c3RuSw7tIWkfLPJ3E0/ZGQlk13qHvclYm2laDJnEpcBfy8 M9hZU7ipswsE7jjqvURB1QZK4KIYfGWO8cng8IvbOf/5QcQashxvRRLyP/PvF3n6qJqquSUCtIFev I6FvMOs7Ep9YaxgXignB5IbCBPcgS0xEceCjXHdwLu0IFQF0vKbEoFeNfIL079VUT4yYlvIPch9m4 OUZFF8wQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgoXa-00000009oe3-2mHX; Wed, 21 Aug 2024 16:50:34 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgoWr-00000009oa8-1YJU for linux-arm-kernel@lists.infradead.org; Wed, 21 Aug 2024 16:49:50 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id C5A6BA40FF4; Wed, 21 Aug 2024 16:49:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A264C32781; Wed, 21 Aug 2024 16:49:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1724258988; bh=gVCczsfFXEHQPlei2oJJ0nXJXjcYso0oIlLwuq+N1r0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=FJoQgt2VnSRSEEzoRYbVkV9Z7FJF1bRGrIXhOE9KzVRtyKDiC8b3UiMMS7O3iXCyp rAfZacBuI8IP1arVNFO9/pOxKwIA5okU9hdbPqSbmmecgNTB2e25+/AxIFgOAlb4qT 3bPooeqiPKHlbfyH9T9OhR3VG2iD83FKhqfZX20T2EV+leiTsGrXsS1abZK1LYUMVJ xmY1b+gukN5idxxqODlHlXpJvwg0xDbRUUfHabBfwgjdXULSkU7qEpZvsJ1qobT+3B Aw1smF0GZqTIMmpvYglhUC06RpVZcSkrK4Hfi9qllWjALYI2rEYy7Wp+dnJMCCoHhv BVtsvS7zEM9/g== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1sgoWo-005fhU-1H; Wed, 21 Aug 2024 17:49:46 +0100 Date: Wed, 21 Aug 2024 17:49:45 +0100 Message-ID: <86a5h5yg5y.wl-maz@kernel.org> From: Marc Zyngier To: Will Deacon Cc: linux-arm-kernel@lists.infradead.org, Sudeep Holla , Catalin Marinas , Lorenzo Pieralisi , Suzuki Poulose , Steven Price , Oliver Upton , linux-coco@lists.linux.dev Subject: Re: [PATCH 4/6] drivers/virt: pkvm: Hook up mem_encrypt API using pKVM hypercalls In-Reply-To: <20240730151113.1497-5-will@kernel.org> References: <20240730151113.1497-1-will@kernel.org> <20240730151113.1497-5-will@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.4 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: will@kernel.org, linux-arm-kernel@lists.infradead.org, sudeep.holla@arm.com, catalin.marinas@arm.com, lpieralisi@kernel.org, suzuki.poulose@arm.com, steven.price@arm.com, oliver.upton@linux.dev, linux-coco@lists.linux.dev X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240821_094949_496388_34588E09 X-CRM114-Status: GOOD ( 19.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 30 Jul 2024 16:11:10 +0100, Will Deacon wrote: > > If we detect the presence of pKVM's SHARE and UNSHARE hypercalls, then > register a backend implementation of the mem_encrypt API so that things > like DMA buffers can be shared appropriately with the host. > > Signed-off-by: Will Deacon > --- > Documentation/virt/kvm/arm/hypercalls.rst | 50 +++++++++++++++++ > drivers/virt/coco/pkvm-guest/arm-pkvm-guest.c | 55 +++++++++++++++++++ > include/linux/arm-smccc.h | 14 +++++ > 3 files changed, 119 insertions(+) > [...] > diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h > index 16b6dcc54e02..9cb7c95920b0 100644 > --- a/include/linux/arm-smccc.h > +++ b/include/linux/arm-smccc.h > @@ -116,6 +116,8 @@ > #define ARM_SMCCC_KVM_FUNC_FEATURES 0 > #define ARM_SMCCC_KVM_FUNC_PTP 1 > #define ARM_SMCCC_KVM_FUNC_HYP_MEMINFO 2 > +#define ARM_SMCCC_KVM_FUNC_MEM_SHARE 3 > +#define ARM_SMCCC_KVM_FUNC_MEM_UNSHARE 4 > #define ARM_SMCCC_KVM_FUNC_FEATURES_2 127 > #define ARM_SMCCC_KVM_NUM_FUNCS 128 As you will certainly add a bunch of other calls (hopefully soon-ish), how about reserving an actual range for those, so that we can future-proof the ABI early? Grab 64 right away, and we don't have to worry about new stuff for a while. What do you think? M. -- Without deviation from the norm, progress is not possible.