From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4DDFE40F736 for ; Sat, 26 Sep 2026 13:39:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790429950; cv=none; b=EBuwk/LSKIMZy0C4sHFkz1p+/3U+Fcguf3M/FnezO7MhymSM3wa9hG4S1IB54STuDasySautPrtEJwqYUs93f2CnZAW3LDrfGAtnXhh6/IbYLGkISvLDZpOD4XDibpsB3tWdN5Bw3Iyqr69ErCQmjv42hAxnX4zyBJK0BlBXIqQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790429950; c=relaxed/simple; bh=kxpM4woXbVN3C61iCkKOMRV76lDdpJXI6TiGREDFTAA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=D5stludT/GaYMkf1OBjnhETrF/Tc2prkSbb7X+aapBh8uzABiEPeGlBmrElIoybawD2xozIdxa3sVC9ud61Pdy0N2OZ7Mk4LqBXq8CgZBj/J+rm9TjDb81giG5jR5Sc1WUqdjk5UXYLhyhY2a4AHyeqnzMiEwrGp/tx3ZFjRKvg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=U3LxcIkF; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=kCY/x/x0; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="U3LxcIkF"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="kCY/x/x0" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68QAo81D3955503 for ; Sat, 26 Sep 2026 13:39:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= ryy0TaceLombIiL4TAr0+o046iePkO13SoMlmGHBezM=; b=U3LxcIkFYFlytTfx jKLMqAGBDdHcRGSfy0eyL488h3TuiAXRHbKaj7yFfM6RsQi2DGKYQR1l4GU8vTBH FVsE9fjpyCIH3hhsfyWB+2RtyVBl3cHaimRcA5bJUME2qFn3NxV9PW6qvlRrnXje EZ3Yoxe81pVs0c+0h7OdHZyjv/eXPVRL+0tpz+AtiYFTdUjz3FwVVLMvt6p9J4aG +9uAgrGKAbdbrQLIfqt+o6hQvMaF5Wm0jGf6WunNnLuB4j6x6IDi9/4r5dyzDMjm HMl/oSGx736WTdqJY+JoJM8PGofxMkuJj6k/k/fcnWf+rYABFktjTvUsdb3aTKio ojh1iw== Received: from mail-dy1-f198.google.com (mail-dy1-f198.google.com [74.125.82.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gx6938y06-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sat, 26 Sep 2026 13:39:08 +0000 (GMT) Received: by mail-dy1-f198.google.com with SMTP id 5a478bee46e88-3437d0cc8c7so1166386eec.0 for ; Sat, 26 Sep 2026 06:39:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790429948; x=1791034748; darn=lists.linux.dev; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=ryy0TaceLombIiL4TAr0+o046iePkO13SoMlmGHBezM=; b=kCY/x/x0QY7N+VOO8LPiYWEo+pqfQz2AXsZz0fZrlYt5UsmYtV7byxDe9theAwuN9G KEV3VPyxFuEYTQfWltsC1sIhCYFGa5rf1UmTROX346tSnqQNM8yZZFmsHwpMYEhYJ/bC W7y6uWJz4/xvo/vpBqqBUHhgu8qOuT5XYoIX8M0OtolzwH+7jSGQUDGL9OMRhWUx0kKt 9lp1NISOZ8AOWR0XO/bW8dbc1QPbo7SKs7jbBRV1bHXMAQXyrcURq7vDzO4Fe4GGhyU9 FsUAeu3v0eFWpHQiEJe7bMJgANRpbi4x9OdKBv/3zG6aimjOmUwPFeRwLPXVFDjkpL79 GIyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790429948; x=1791034748; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=ryy0TaceLombIiL4TAr0+o046iePkO13SoMlmGHBezM=; b=eQE6hxUNEbCnBTuwSSo8d62dG3mRpSwZOG1AGvi5mvr7Xtn6mBEwq+0txbk4CdWK4V UiHsZ6f1U069l0wUHmnnOO5QOYqjnNp0V4shc86ROHZmD7MCF/nXNAASCZQYzI8goeZL 2kn/kkSIoMpw/WugLaks5NYveu+qdyqgPZaMgsm3uRGN3Tup3+E3ZkdhBb4jybYB59vJ 6xu/18CufPdDGmKgbmRd/Ds76caov/arc/2LpuwUiFUw01JEX6B3No+lM6RoOzFcSm4+ sYbpPxJWFURp+VU7lIIxpNinvM5pTPqHEHBAv5vf3xOlJ/lUqbSl65jOHagn8mYUoBcL 4hfw== X-Forwarded-Encrypted: i=1; AKwUvBy+zXZMqinAqyiwYrwXbmZVZgc3IDPxJL+FLgVjN5e/vaR6vh4t541ztWarfjUPWpU4s+KUVhvU1SRx@lists.linux.dev X-Gm-Message-State: AFq9FYJDvY/mXiiKQ/t6s6WQt7NX4bgC8DBPFRLur5YDnd3YhnkQof4s qVczjFK4RvaUDTVJFrTcPZ9YnnkJxFtHWfnnY38Ath/rm1x5rAjKebJHpnqQEHggiTuM0feNxyf LJnjd1ZlT8TkfWzpI/3Mpx7g9j1pARibLKyKnU2p7wZqQhR5VlGnE6HQz6sJ8xdCE X-Gm-Gg: AYBFou2Xx7fuRpz1t2PwaWC/lsIeBdwzM6aAKHrvvtxYS3P2u37+Z+5TT/SPFs19Iv+ womJyKj6TQE414ByZt0sCY1FgeeS8IZBHWH+u81LJOnzIRl7qVOs6/NDmT8RuSbTJ0JMS4mKTAJ m/jnrJfpl2SaPEQrj03MeVGd+8RuyP3g8BT+ARE0ydpIx+1ozb5sejrC8HMoP9TmnIREGT08XJF jw3qooTQnI8jFKIcQM/20tvdZTdOHnDPCEhtBOl6g1kjGUq7Ohjw8OxLi+uJYGRhTwUQ+hIHX/1 UAxH1DG9aB1V+qJIvY1QjTW9eDpXWqkpSa6OlBLLdRe+7bWcpZuj0Jgc7P1C6zOtzWPDGVvLBiF uhfBnr/WAj0w7dFpm5UKzBlR9fFASFqLMBuc= X-Received: by 2002:a05:7300:3b28:b0:328:2ea5:bd39 with SMTP id 5a478bee46e88-342705b94bcmr4840008eec.4.1790429947084; Sat, 26 Sep 2026 06:39:07 -0700 (PDT) X-Received: by 2002:a05:7300:3b28:b0:328:2ea5:bd39 with SMTP id 5a478bee46e88-342705b94bcmr4839926eec.4.1790429945792; Sat, 26 Sep 2026 06:39:05 -0700 (PDT) Received: from [192.168.68.104] ([49.207.195.115]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-34141a4a00dsm15522844eec.1.2026.09.26.06.38.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Sep 2026 06:39:05 -0700 (PDT) Message-ID: <23f281ef-d724-4fdb-aa1d-408c368d941c@oss.qualcomm.com> Date: Sat, 26 Sep 2026 19:08:38 +0530 Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v19 3/7] firmware: arm_rmm: Configure the RMM with the host's page size To: Suzuki K Poulose , Jonathan Cameron Cc: kvm@vger.kernel.org, kvmarm@lists.linux.dev, 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, gshan@redhat.com, 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, trilok.soni@oss.qualcomm.com References: <20260924135201.850038-1-suzuki.poulose@arm.com> <20260924135201.850038-4-suzuki.poulose@arm.com> <20260924100313.00003be7@oss.qualcomm.com> Content-Language: en-US From: Venkata Rao Kakani In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI2MDA1NCBTYWx0ZWRfX0kPKSwDVxiNq wG4iLm0bMxyW635hBroaT7GGSky4pU7Nzfab6wwZSbRT9cSKlqi93PgHT+6et3p6gi5Bow5NrX0 571UA39q0I0hI6aYwRiy+PtEbCX85VA= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTI2MDA1NCBTYWx0ZWRfX/xXymuK2XnCD EiAnofWTKDWpAHhTRfXr0pJEqCJ2ln1h1RuD9NTFNOoTW0aIDLJMOg4Lwj835fRFi6TqlkgtDsg fnhyMtdwf3DPTHfwhR3PjHPI/WZQJgSIMMLTwJjUSchzSHRIewsN3H/BhQhLWlmHboC9t/N53FZ JdTWaQnd+hDtgYrvpx6SDS8umB+ze7NUGxeflEZvqUrWHhiKrqexAaLIcOnkdsTEWdtTTV0Y5Ww GA2S+jez9pV357VkPiHiNP8uLr2j2FMKkLmdKES7r2IKbq9OrumLBlKE48PL1xjF8JPrrW+8Y0N D79ck83cQcCov+pMp59kReInxRbgDv9gpQL9nC1FDyndwnHKwJFk5II7rU+q/malWThFHBJOppf Xv4eSatl9RmbJizPRhW+lrK/2dO6I5+UqQyhuzC3OFwU0k+MNcOwnVEnQHHocVlLfpOc6Wzc1mN f3jqjShhrYY2jhz0Yng== X-Proofpoint-GUID: M9JXK9Nz1GRAF7v8lcEjEFAwBAs52Kd0 X-Authority-Analysis: v=2.4 cv=f6Pdl+yM c=1 sm=1 tr=0 ts=6ab7cafc cx=c_pps a=wEP8DlPgTf/vqF+yE6f9lg==:117 a=lfboiZ0IWGQn+/ls2+s3/g==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=7CQSdrXTAAAA:8 a=EUspDBNiAAAA:8 a=VEZfdOmQvSGR4K_WtDcA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=bBxd6f-gb0O0v-kibOvt:22 a=a-qgeE7W1pNrGK8U0ZQC:22 X-Proofpoint-ORIG-GUID: M9JXK9Nz1GRAF7v8lcEjEFAwBAs52Kd0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-26_03,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 lowpriorityscore=0 adultscore=0 impostorscore=0 malwarescore=0 clxscore=1015 bulkscore=0 spamscore=0 suspectscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609260054 On 25-09-2026 08:26 pm, Suzuki K Poulose wrote: > On 25/09/2026 14:23, Venkata Rao Kakani wrote: >> Hi Suzuki, >> > > Hi Venkat, > >> Now, with this patch Host can set RMM Granule size equal to >> PAGE_SIZE. Does RMM send the request to root to set GPT physical >> granule size = PAGE_SIZE? > > I don't think FIRME lets you do that and it would be too complex. Please > remember that the GPT is not just for the Non-secure/Realm world, but > also for the Secure world. > So, the Physical Granule size would be statically configured to 4KB on a > platform unless it supports the 4KB granule size, to support all > possible Sofware components. > > >> >> In a scenario where, GPT granule size (|GPCCR_EL3|) set to 64K and >> Host PAGE_SIZE set to 4K, how does root handle GPT granule mappings, >> when Host send RMI_GRANULE_DELEGATE(PAGE_SIZE)? > > If GPCCR_EL3 is set to 64K, RMM must not report it supports 4K GRANULE > size. > > nit: Please avoid top posting your comments and use plain text for > discussions on the list. > > Suzuki > > > > >> >> >> -- Venkat >> >> On 24-09-2026 10:33 pm, Jonathan Cameron wrote: >>> On Thu, 24 Sep 2026 14:51:57 +0100 >>> Suzuki K Poulose wrote: >>> >>>> RMM v2.0 brings the ability to set the RMM's granule size. Check the >>>> feature registers and configure the RMM so that it matches the host's >>>> page size. This means that operations can be done with a granularity >>>> equal to PAGE_SIZE. >>>> >>>> Signed-off-by: Steven Price >>>> Signed-off-by: Suzuki K Poulose >>> Hi Suzuki, >>> >>> Some trivial stuff inline.  Assuming that is addressed. >>> >>> Reviewed-by: Jonathan Cameron >>> >>>> --- >>>>   drivers/firmware/arm_rmm/rmi.c | 70 >>>> ++++++++++++++++++++++++++++++++++ >>>>   1 file changed, 70 insertions(+) >>>> >>>> diff --git a/drivers/firmware/arm_rmm/rmi.c >>>> b/drivers/firmware/arm_rmm/rmi.c >>>> index 3baba931f92e4..c9ea964fd9081 100644 >>>> --- a/drivers/firmware/arm_rmm/rmi.c >>>> +++ b/drivers/firmware/arm_rmm/rmi.c >>>> + >>>> +static int rmi_configure(void) >>>> +{ >>>> +    unsigned long granule_feature; >>>> +    unsigned long granule_size; >>>> +    int ret = 0; >>> Value not used.  Fine if it is future churn reduction, but I didn't >>> spot >>> where if so. I'm guessing left over from refactoring >>> >>>> + >>>> +    switch (PAGE_SIZE) { >>>> +    case SZ_4K: >>>> +        granule_size = RMI_GRANULE_SIZE_4KB; >>>> +        granule_feature = RMI_FEATURE_REGISTER_1_RMI_GRAN_SZ_4KB; >>>> +        break; >>>> +    case SZ_16K: >>>> +        granule_size = RMI_GRANULE_SIZE_16KB; >>>> +        granule_feature = RMI_FEATURE_REGISTER_1_RMI_GRAN_SZ_16KB; >>>> +        break; >>>> +    case SZ_64K: >>>> +        granule_size = RMI_GRANULE_SIZE_64KB; >>>> +        granule_feature = RMI_FEATURE_REGISTER_1_RMI_GRAN_SZ_64KB; >>>> +        break; >>>> +    default: >>>> +        BUILD_BUG(); >>>> +    } >>>> + >>>> +    if (!(rmi_feat_reg(1) & granule_feature)) { >>>> +        pr_err("RMM does not support %luKB granules\n", >>>> +               PAGE_SIZE >> 10); >>>> +        return -ENXIO; >>>> +    } >>>> + >>>> +    struct rmm_config *config __free(free_page) = >>>> +        (struct rmm_config *)get_zeroed_page(GFP_KERNEL); >>>> + >>>> +    if (!config) { >>>> +        pr_err("Unable to allocate memory for RMM config\n"); >>>> +        return -ENOMEM; >>>> +    } >>>> + >>>> +    config->rmi_granule_size = granule_size; >>>> + >>>> +    /* >>>> +     * For now we set the tracking_region_size to 0 which is the >>>> only option >>>> +     * for 4KB PAGE_SIZE (1GB for 4KB PAGE_SIZE, 32MB/512MB for >>>> 16KB/64KB). >>>> +     * TODO: Support other tracking sizes via Kconfig option for >>>> other >>>> +     * PAGE_SIZES >>>> +     */ >>>> +    config->tracking_region_size = 0; >>>> + >>>> +    ret = rmi_rmm_config_set(virt_to_phys(config)); >>>> +    if (ret) { >>>> +        pr_err("RMM config set failed (%d)\n", ret); >>>> +        ret = -EINVAL; >>>         return -EINVAL; >>> >>>> +    } >>>> + >>>> +    return ret; >>>     return 0; >>> >>> So obvious this is the good path without anyone having to think >>> about it! >>> >>> I did quick check on whether this was to reduce churn due to later >>> changes >>> but couldn't immediately spot anything >>> >>> >>>> +} > Understood. Thanks Suzuki.