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 0A891FED2F7 for ; Thu, 12 Mar 2026 09:39:47 +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=FUMdtSRPZWsIqUj1grRsjNOkiXySAN7eADGHZxngzho=; b=dM2fs6UPy04ZZhCxCstGQB7JHj x392XSgbVLtxGs1kEyYS25yfjVS1SqEkmffkXHXgjE5rD1tXNOUChTTGHnUxxVW4YxV9ZbfjD/1KM Pz4crN0hyhvhJfO16xouWV33sT9eZxUHAQdi6C5jRBPPwJBRRGqpuMcGEPJb0odscR1eJXB17zl7j fXPZfsi0DkKeWt3XB04VbXrYZDM3E2s9vnksVEgalQEB/HZT2hjnZ1a1AKX5qwMrXo7h4g0AWZj33 5tgupAWnMh538LuOXb9ZDlH6gr+F0dL2hfV4AOTAqrz756BBg//pKy2YIiNaoeavvTmOAmM+7fkHg JgKPxFQg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1w0cW6-0000000DnGG-2VWX; Thu, 12 Mar 2026 09:39:42 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1w0cW5-0000000DnFv-16HL for linux-arm-kernel@lists.infradead.org; Thu, 12 Mar 2026 09:39:41 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 4535B60142; Thu, 12 Mar 2026 09:39:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E54A0C116C6; Thu, 12 Mar 2026 09:39:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773308380; bh=UAk43NccrQPWgbH1hCQpxC1aL/SVilMfAUwhDR2PNQ4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=X77W/luMGxn5rnJvKDveNysjMQI0AFl+bwO7xgb29XxpB0CWy/BimckvNIwrRw2C2 yDfn16LCaPnobMcdqiTG1S0ccaualO+FKkyILLROZhIxpUn3l8RpQyQoOppexOQ81d 2eDORczRtYNVVQCmqcv8tn2ckwVNvcrgj3tBYF5Tsrhkn+x86RupwplsiRKnXcgOKW hgJ4JHv2FNQg9NZVFgYpU3r6/Z5hz/d9DL4gUE4n552wTez+B3DVskBUsQM6fVvjHx gR+P+PyPZfvp3CvY+n0kg5gZyiNd/MdpBo3ZngdGwgEvUy0o1SmPcZCCVEwPUXh/Fx DdZ3SIm4Oou4Q== 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.98.2) (envelope-from ) id 1w0cW1-00000001CjM-1BME; Thu, 12 Mar 2026 09:39:37 +0000 Date: Thu, 12 Mar 2026 09:39:36 +0000 Message-ID: <86342575ev.wl-maz@kernel.org> From: Marc Zyngier To: Suzuki K Poulose Cc: Steven Price , kvm@vger.kernel.org, kvmarm@lists.linux.dev, Catalin Marinas , Will Deacon , James Morse , Oliver Upton , Zenghui Yu , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Joey Gouly , Alexandru Elisei , Christoffer Dall , Fuad Tabba , linux-coco@lists.linux.dev, Ganapatrao Kulkarni , Gavin Shan , Shanker Donthineni , Alper Gun , "Aneesh Kumar K . V" , Emi Kisanuki , Vishal Annapurve Subject: Re: [PATCH v12 06/46] arm64: RMI: Define the user ABI In-Reply-To: References: <20251217101125.91098-1-steven.price@arm.com> <20251217101125.91098-7-steven.price@arm.com> <86tsuy8g0u.wl-maz@kernel.org> <33053e22-6cc6-4d55-bc7f-01f873a15d28@arm.com> <87v7f2chde.wl-maz@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/30.1 (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: suzuki.poulose@arm.com, steven.price@arm.com, kvm@vger.kernel.org, kvmarm@lists.linux.dev, catalin.marinas@arm.com, will@kernel.org, james.morse@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, joey.gouly@arm.com, alexandru.elisei@arm.com, christoffer.dall@arm.com, tabba@google.com, linux-coco@lists.linux.dev, gankulkarni@os.amperecomputing.com, gshan@redhat.com, sdonthineni@nvidia.com, alpergun@google.com, aneesh.kumar@kernel.org, fj0570is@fujitsu.com, vannapurve@google.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false 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 Thu, 12 Mar 2026 09:28:16 +0000, Suzuki K Poulose wrote: > > On 11/03/2026 19:10, Marc Zyngier wrote: > > On Mon, 02 Mar 2026 15:23:44 +0000, > > Steven Price wrote: > >> > >>>> + struct kvm_arm_rmi_populate { > >>>> + __u64 base; > >>>> + __u64 size; > >>>> + __u64 source_uaddr; > >>>> + __u32 flags; > >>>> + __u32 reserved; > >>>> + }; > >>>> + > >>>> +Populate a region of protected address space by copying the data from the user > >>>> +space pointer provided. This is only valid before any VCPUs have been run. > >>>> +The ioctl might not populate the entire region and user space may have to > >>>> +repeatedly call it (with updated pointers) to populate the entire region. > >>> > >>> size as a __u64 is odd, as the return value from the ioctl is a signed > >>> int. This implies that you can't really report how many bytes you have > >>> copied. Some form of consistency wouldn't hurt. > >> > >> Good spot. In practice this works because >2GB in one operation is > >> highly unlikely to be processed in one go. But I guess I'll change this > >> to have an output size argument. I guess I could make the kernel update > >> all of base,size,source_uaddr which would simplify user space. > > > > In a conversation with Suzuki, I suggested that splice(2) could be a > > nicer way to express this, and allow asynchronous use with io-uring. > > > > After all, having a guestmem backend for CCA is not exactly > > outlandish, and having a splice implementation realistic enough. > > > > Thoughts? > > One issue that I realised, is about the "flags" for the populate. > Data can be loaded as measured vs unmeasured in CCA (and in TDX > and SNP). I don't see a way to convey this with splice. Surely that should me a property of the memory region, and not the way it is copied, right? M. -- Without deviation from the norm, progress is not possible.