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 86402EB64DA for ; Wed, 19 Jul 2023 06:43:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id: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=7G3QWKn+p9MZZUwUVu+fhOw6lqLBRk3kZwa0+ErhJFo=; b=RI6taBjXO4uHDX T7wi2NnzXNY7KDtPXRZfJsMfBVlld+rEDm2vBe3LNVd7Nu8Usn6YwbObleFjX22xLaNegLQAYTczF QbI2Pnd70fs+qpBJ6ZOmsIr3z+yIhfHHrYJk6CbdlNFlTHJ5xO/p5tnMxGkcrdEIxYaz/r2Sq4ahj YiCEJJP+QMms5PqJA24wLPBxhYRw5jCnC0RS6QgjYOWlZ3nDZpmPNEEzhbo5a10LZhm0ziBGmpFuz 9FNdT/ygAuk+bMVxfDamSHVNnmT9S+WJU0k6pVe9c0+VlBqz1v7D85WPUhpYtV74o8v4qkQ3O/WKk L01IpMb5tuc5Fy64iDTA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qM0ta-005rC9-2z; Wed, 19 Jul 2023 06:42:46 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qM0tZ-005rBn-2K for linux-arm-kernel@bombadil.infradead.org; Wed, 19 Jul 2023 06:42:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :In-Reply-To:From:References:CC:To:Subject:MIME-Version:Date:Message-ID: Sender:Reply-To:Content-ID:Content-Description; bh=8rFBmX5DgEEydXEcTIyomIWP4zWEITCUOjOBSX0Y8vI=; b=cqRI7wdQwmpZIkh8HRvSeTHV6Z KsrDS05o07KQhyVz6h5v2ROzDZYk9lhVIeY+3+RT1VkUFEOplzleqJM0e/r2ZyoZnnM6D0Ja0DeXS kgXlu0cB1ECdTzTUmgqN22oQ/uKNtFsA6dEZDdVDuLfmI7/1uTqE97WIjE7tosAKLQu5qXcW73bZL 3MhAY9Wufh/MeLbuMZ7uhAuewPW2iT1JS4plaarVM50ZtRcdAJKzHGZW/EoUlKbBSDA+jGqs+T80o 5Qf80CwNyZxqJoJQS8UDD/tyIV688hkIW1B5+6AjV4tWGuRdNyWU1afpTgr/kYlL7jbVhaMFRZWCJ H1lxsTaw==; Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qLsoy-00C7Wn-2l for linux-arm-kernel@lists.infradead.org; Tue, 18 Jul 2023 22:05:33 +0000 Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36IKpN5l008353; Tue, 18 Jul 2023 22:05:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=8rFBmX5DgEEydXEcTIyomIWP4zWEITCUOjOBSX0Y8vI=; b=VrQ24uCRWyFr9t1BpscO3IXZFINEy/9H0fTfedwdDZWTWey44NeY/bisvD/ofuI9Gn7h 7I3v+zeaOm74ELnUfHtdU2aZSCDYvhYuS4ujnGX9u0YuNeyscrAGESQJPKuAyS8Bm0fb 4iDGYa5QkiUysjStdvXxoXG0/Gs+7zp4OmCDh9rZAy678S2QwyVfWxGllKTZusO9tDpO 6RDyPwF7ii+uFsRSq1JSmgrc+Hkso8Z4zegCMxibGrBIP5jQ8Vo61xh+EpZ+PQIRZFAC gw+S67n3cv0ehu3M5rSaq3DmjpwqniS/GIc1aXuajWtlM+kMrTeitrUAxF3E6XYthPhP 4w== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3rwnrrhws2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Jul 2023 22:05:18 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 36IM5HMJ016014 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Jul 2023 22:05:17 GMT Received: from [10.110.49.60] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Tue, 18 Jul 2023 15:05:17 -0700 Message-ID: <46bd234c-0b0c-0787-1824-e7cbff768393@quicinc.com> Date: Tue, 18 Jul 2023 15:05:16 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH 2/2] firmware: arm_scmi: Add qcom hvc/shmem transport To: Bjorn Andersson CC: , , , , , , , , , , References: <20230718160833.36397-1-quic_nkela@quicinc.com> <20230718160833.36397-3-quic_nkela@quicinc.com> <5c76250b-4415-950e-6aab-7ccbdc6ca83a@quicinc.com> <6uelwa7fpzbw757rbb2j3u4ogagypdzyqj5mykyhlkkkvrnfin@ttonjpfn7nxc> Content-Language: en-US From: Nikunj Kela In-Reply-To: X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 8zvWIFlvkw91mb8rppe_7bCZ8VFZlnlB X-Proofpoint-ORIG-GUID: 8zvWIFlvkw91mb8rppe_7bCZ8VFZlnlB X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-18_17,2023-07-18_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 phishscore=0 malwarescore=0 suspectscore=0 adultscore=0 spamscore=0 lowpriorityscore=0 mlxlogscore=999 priorityscore=1501 impostorscore=0 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307180199 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230718_230531_551584_62AF161E X-CRM114-Status: GOOD ( 22.75 ) 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: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 7/18/2023 12:30 PM, Bjorn Andersson wrote: > On Tue, Jul 18, 2023 at 12:10:16PM -0700, Nikunj Kela wrote: >> On 7/18/2023 12:07 PM, Bjorn Andersson wrote: >>> On Tue, Jul 18, 2023 at 11:53:24AM -0700, Nikunj Kela wrote: >>>> On 7/18/2023 11:29 AM, Bjorn Andersson wrote: >>>>> On Tue, Jul 18, 2023 at 09:08:33AM -0700, Nikunj Kela wrote: >>>>>> diff --git a/drivers/firmware/arm_scmi/qcom_hvc.c b/drivers/firmware/arm_scmi/qcom_hvc.c >>> [..] > [..] >>>>>> +#ifdef CONFIG_ARM64 >>>>>> + cap_id = readq((void *)(scmi_info->shmem) + size + >>>>>> + sizeof(unsigned long)); >>>>>> +#else >>>>>> + cap_id = readl((void *)(scmi_info->shmem) + size + >>>>>> + sizeof(unsigned long)); >>>>>> +#endif >>>>> Please don't make the in-memory representation depend on architecture >>>>> specific data types. Quite likely you didn't compile test one of these >>>>> variants? >>>>> >>>>> Just define the in-memory representation as u32 + u64. >>>> I tested this for ARM64, I didn't test it for 32bit since Hypervisor doesn't >>>> support it currently. In future, it may add 32 bit support too. >>> I'd not be surprised if the capability id is 64 bit on a 32-bit machine >>> as well, it's not really a property of the architecture. >> on 32bit machine, you will have to use SMC32 convention. lt will mean that >> the parameters can only be 32 bit long. If you keep cap-id 64 bit in 32bit >> machines, then it has to be passed in two parameters. Are you suggesting, I >> make this driver dependent on ARM64 and only care about 64 bit for now? >> > I'm suggesting that the calling convention is one thing and the > in-memory format for passing the information to the driver is a > different thing. > > Keep the arguments passed in memory architecture-independent (i.e. make > it u64). > > If you're saying that the calling convention would be different on a > 32-bit system, then you are also saying that your driver _is_ 64-bit > specific. Please confirm what the size of your capability id would be in > such a system and make sure the Kconfig and/or the code, reflects > reality. > > Thanks, > Bjorn It is confirmed that cap-id will be 32 bit long on 32bit machines. That said, I will make changes to use last 16bytes irrespective of the architecture. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel