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 65E5FC9830D for ; Fri, 25 Sep 2026 09:03:40 +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-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=cWihEX/LNMg2JeV4HNtUE2MAnoHe+L0E+l/b3zuEULk=; b=v5kmt8Fxota64tjFJkTjU3fWwq gWVuaKM/0gcanYCSgdu9A2uHCdmfocx26kUCLs9EgwY0sz2j+LIMR7AcVZue1l1Li9N5OTKB5XmF1 5jV2/Z4fKzKMSnknRxSeDBal+BrtDYH2pv8DaU5C7d5WtYtngqyJJMGuqFHcIvYhsmQLgXbsy8MOc 4EFRMl1KGyn6sZO8geuyZqRdN7Papkbf+r3jWR1F7OknL5UkBTcNLwWJizaQDvvoVrZmgTCjTcd94 FV02uQcbAdb0jC8Dh+aUw7RTirjTWeaXWz4GqwCA1OAi548Q2LNH2mDzDU0LHZpRtZBPSBVxag45n KTU8GgQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1xA1q9-0000000Cxqi-2qxa; Fri, 25 Sep 2026 09:03:33 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1xA1q6-0000000CxqM-0nij for linux-arm-kernel@lists.infradead.org; Fri, 25 Sep 2026 09:03:32 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3C4DE1758; Fri, 25 Sep 2026 02:03:25 -0700 (PDT) Received: from [10.57.10.88] (unknown [10.57.10.88]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 57A9A3F86C; Fri, 25 Sep 2026 02:03:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1790327008; bh=sOAlpYevyEEeqo1Lx6FnS3Y7E3aUZb0OVhb2WCb8c0o=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=ule2hsFwr8aED801DCcqIgLrUcWuQutUQXVi9350MdfOoGlVbmTrOv7pRQ7HqRVnV gGCzsDpOqeDYg8meXD0+euDrJXWydl1ypuJ6Jvwv4Ofhui1FX7gF81H2fkpJy0kamF eQv78mxZEV1sYyrBH7fDPXjnD3kqprKDEvQuPnHk= Message-ID: <0c41a8a4-c4b5-4ca7-b1c9-8aaa1958e4bb@arm.com> Date: Fri, 25 Sep 2026 10:03:23 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v19 0/7] firmware: arm_rmm: Add RMM v2.0 base RMI support Content-Language: en-GB To: Gavin Shan , kvm@vger.kernel.org, kvmarm@lists.linux.dev Cc: maz@kernel.org, will@kernel.org, catalin.marinas@arm.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, steven.price@arm.com, aneesh.kumar@kernel.org, oupton@kernel.org, joey.gouly@arm.com, tabba@google.com, yuzenghui@huawei.com, linux-coco@lists.linux.dev, gankulkarni@os.amperecomputing.com, sdonthineni@nvidia.com, alpergun@google.com, fj0570is@fujitsu.com, WeiLin.Chang@arm.com, lpieralisi@kernel.org, enju.kohei@fujitsu.com, sudeep.holla@arm.com, jonathan.cameron@oss.qualcomm.com References: <20260924135201.850038-1-suzuki.poulose@arm.com> From: Suzuki K Poulose In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260925_020330_314855_65477CFE X-CRM114-Status: GOOD ( 30.70 ) 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 25/09/2026 07:29, Gavin Shan wrote: > On 9/24/26 11:51 PM, Suzuki K Poulose wrote: >> This series adds the generic firmware layer for talking to the Realm >> Management Monitor (RMM), as specified by the RMM v2.0-bet3 >> specification[1]. It is the first part of the Arm CCA host support that >> was previously posted as part of the larger KVM series. >> >> The split allows this RMM support to be used as a base for other work, >> including Aneesh's PCI IDE support with Arm CCA RMM as the TSM, >>   without depending on the KVM Realm support that will follow as separate >>   series. (See more on that below) >> >> The series adds: >> >>   * The RMI SMC definitions and direct-call wrappers. >> >>   * RMM discovery and version checks during firmware init. >> >>   * RMM host configuration, including the host page size. >> >>   * Stateful RMI Operation (SRO) infrastructure for commands which the >> RMM >>     can complete across multiple SMC calls while requesting or returning >>     memory to the host. >> >>   * Verification that granule tracking is available at fine granularity. >>     Fine-grained tracking allows each granule in the system to be tracked >>     independently, which is required before individual granules can be >>     delegated. A future series will add support for dynamically supplying >>     memory to the RMM for this tracking. >> >>   * Support for fully firmware-managed systems, where the Granule >> Protection >>     Tables for memory regions are allocated and managed by firmware. >> RMM v2.0 >>     also allows dynamic GPT creation on demand; support for that will >> be added >>     in a later series. >> >>   * Wrappers for the RMI commands that are used for managing the >> "Realm VM" >>     lifecycle. This is added in to make it easier for the on-going KVM >> support >>     to evolve in parallel pieces. >> >> If the platform firmware cannot manage the granule tracking or the >> GPTs, we >> bail out and deactivate the RMM, reclaiming any memory that we have >> donated. >> >> The RMM v2.0 spec introduces Stateful RMI Operations (SROs), which allow >> the RMM to complete an operation over several SMC calls while requesting >> or returning memory to the host. This allows interrupts to be handled in >> the middle of an operation and lets the RMM dynamically allocate memory >> for internal tracking purposes. For example, RMI_REC_CREATE no longer >> needs auxiliary granules to be provided up front, and can instead >> request memory during the operation. >> >> This series applies on v7.3-rc2 and a branch is available at [2]. The KVM >> CCA support that builds on this series is available at [3] as an >> integration >> branch. The KVM support depends on guest-memfd-in-place conversion >> support v13 >> from Ackerley [4], we plan to split that into parts, which apply >> cleanly on >> v7.3-rcx without any dependency and is in progress. This will be made >> available >> as soon as it is ready. Until then [3] shows how this base series >> enables KVM >> CCA support. You may find the tf-RMM [5] and kvmtool support [6] below. >> >> [1] RMM spec : https://support.arm.com/documentation/den0137/2-0bet3/ >> [2] This series: https://gitlab.arm.com/linux-arm/linux-cca.git cca/ >> cca-host/fw_rmm/v19 >> [3] KVM CCA v17 integration branch: https://gitlab.arm.com/linux-arm/ >> linux-cca.git cca/cca/cca-host/kvm-v20/integration > > s/v17/v20 ? Yikes, I have pushed this in the kvm-v20, with the changes to the RMI_RESULT instead of RMI_RETURN etc. So the branch is correct, but the description is not. I will rectify that >> [4] Gmem inplace conversion https://github.com/googleprodkernel/linux- >> cc/tree/guest_memfd-inplace-conversion-v13 >> [5] TF-RMM https://git.trustedfirmware.org/TF-RMM/tf-rmm.git main >> (commit: 134266ae) >> [6] kvmtool https://gitlab.arm.com/linux-arm/kvmtool-cca.git tag:cca- >> kvm-v20 (Also cca/kvm-v18) >> >> Known issues: RMMv2.0 spec. >>   * RmiOpMemDonateReq:count (Uint14) is incompatible with >> RmiAddrRangeDesc4KB >>    (Uint10) and RmiAddrRangeDesc16KB (Uint12). i.e., a larger >> contiguous request >>    may not be satisfiable by the host. This is resolved in the RMM >> spec, by clamping >>    the upper limit on the number to match the RmiAddrRangeDesc* and >> will be published >>    in the next release. >>   * RMM to clarify the scenarios that triggers the RMI_BLOCKED and the >>     recommendations to limit the cases. >> > > Applied this series on top of upstream linux v7.3.rc4. The built kernel > can boot up on > GH200 machine and CCA host emulated by QEMU with various combinations: > 4KB or 64KB base > page size, CONFIG_ARM_RMM_RMI is {Y, N}. The RMI is only detected and > configured on CCA > host when the base page size is 4KB because RMM only support 4KB granule > size at present. > Details can be found from TF-RMM/runtime/rmi/ > granule.c::smc_rmm_config_set(). Besides, > some of the added functions based on the RMI calls aren't covered by the > tests obviously. > So I think this series doesn't introduce regressions at least. > > Tested-by: Gavin Shan Thanks Gavin ! Much appreciated Cheers Suzuki