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 38EAAC636D3 for ; Mon, 30 Jan 2023 21:46:54 +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=xycJFrkrHodDf9f7UmVaQgB+ycFYKHPPrB6UV+1EwhI=; b=diV6cWPGMbrmUz ZWZrxXv+bi5X0MnW7GIMP9T0P6wP3uPc1HJDm8t2T/29Dg3L2YyeZP/cza6fYfvQz+LiylZdX9Doe Prfb5b0Ia2bHTvOKknZR8mxmmETcEBglNIzJwLhHXfoshlrLWikV9ynJtLli+7StqpwxYDoJuJaul Y8pKKUnzqx9V+8OOs1+1CjmlKuDgOyvMK27L+UWnWmAGngGrMxGyX1ELdHpidbdhqmrVWjkhtdAGl H7ksgVcmifQsPDITvajAEqN5hm/AI2QQ3vSDlwJSCMTm5Bkzg7nO4nuYj9LemiEGkBStK5D9xKWhR ceorV4vzsEuITH5GfbXg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pMbyR-005XOJ-M6; Mon, 30 Jan 2023 21:45:59 +0000 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pMbyL-005XMC-DN for linux-arm-kernel@lists.infradead.org; Mon, 30 Jan 2023 21:45:54 +0000 Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30ULUVkD022923; Mon, 30 Jan 2023 21:45:40 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=NhrOGJv0wHfmhC/EZl8LNpCyTCrJjvuMMumnsh4PgOQ=; b=Bw/8SaIYvYfjbeIBNyr1rtCyJReNxEedIswnX1EPkEZo98fizFZMU7R7zwyIRd3Wjhj2 vw9MO5arBJCPOtp5XVMoK/dOEA9dxnLYn9Tv4C0D/Yiy2UUcEiPuhIXK5CM+eLxYZtwQ I4T2n0Wxzq/lqh7PYZgXq/zibkmHgdQvTsx8HxFL2lA0TlZbKSRuLYsih+Znvxtgevi5 IBey4nY8L+o1MdvL0HLIDAk9xU3RcE+XE4rn8/VIq9aQtA9kgsFOKQTCDcC3zac5+Q2m CyyWS6DnW+xw1JN9ghknnFVmS5JlRkTGfHmZFGP5RNWpz7ggCB2ZMp8SSFGv45N/JNIm jQ== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3ncvfpcm57-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 Jan 2023 21:45:39 +0000 Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 30ULjd2L001184 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 Jan 2023 21:45:39 GMT Received: from [10.134.67.48] (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Mon, 30 Jan 2023 13:45:38 -0800 Message-ID: <40a44366-69b8-7efa-e9b4-5b585a4dd929@quicinc.com> Date: Mon, 30 Jan 2023 13:45:38 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH v9 12/27] gunyah: rsc_mgr: Add RPC for sharing memory To: Srivatsa Vaddagiri CC: Bjorn Andersson , Alex Elder , Murali Nalajala , Trilok Soni , Carl van Schaik , Prakruthi Deepak Heragu , Dmitry Baryshkov , Arnd Bergmann , "Greg Kroah-Hartman" , Rob Herring , Krzysztof Kozlowski , Jonathan Corbet , Bagas Sanjaya , Catalin Marinas , Will Deacon , Marc Zyngier , Jassi Brar , Sudeep Holla , , , , , References: <20230120224627.4053418-1-quic_eberman@quicinc.com> <20230120224627.4053418-13-quic_eberman@quicinc.com> <20230130101445.GB332@quicinc.com> Content-Language: en-US From: Elliot Berman In-Reply-To: <20230130101445.GB332@quicinc.com> X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: fUSjbwmTBrAXM-qkK38e4YinJ314pGtj X-Proofpoint-ORIG-GUID: fUSjbwmTBrAXM-qkK38e4YinJ314pGtj X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-30_17,2023-01-30_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 adultscore=0 spamscore=0 mlxscore=0 lowpriorityscore=0 suspectscore=0 malwarescore=0 priorityscore=1501 phishscore=0 mlxlogscore=999 bulkscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301300201 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230130_134553_502589_6C86DDE3 X-CRM114-Status: GOOD ( 17.65 ) 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 1/30/2023 2:14 AM, Srivatsa Vaddagiri wrote: > * Elliot Berman [2023-01-20 14:46:11]: > >> +static int gh_rm_mem_lend_common(struct gh_rm *rm, u32 message_id, struct gh_rm_mem_parcel *p) >> +{ >> + size_t msg_size = 0, initial_n_mem_entries = p->n_mem_entries; >> + void *msg; >> + __le32 *resp; >> + struct gh_mem_share_req_header *req_header; >> + struct gh_mem_share_req_acl_section *acl_section; >> + struct gh_mem_share_req_mem_section *mem_section; >> + u32 *mem_attr_section; >> + size_t resp_size; >> + int ret; >> + >> + if (!p->acl_entries || !p->n_acl_entries || !p->mem_entries || !p->n_mem_entries || >> + p->n_acl_entries > U8_MAX || p->mem_handle != GH_MEM_HANDLE_INVAL) >> + return -EINVAL; >> + >> + if (initial_n_mem_entries > GH_RM_MAX_MEM_ENTRIES) >> + initial_n_mem_entries = GH_RM_MAX_MEM_ENTRIES; >> + >> + /* The format of the message goes: >> + * request header >> + * ACL entries (which VMs get what kind of access to this memory parcel) >> + * Memory entries (list of memory regions to share) >> + * Memory attributes (currently unused, we'll hard-code the size to 0) >> + */ >> + msg_size += sizeof(struct gh_mem_share_req_header); >> + msg_size += offsetof(struct gh_mem_share_req_acl_section, entries[p->n_acl_entries]); >> + msg_size += offsetof(struct gh_mem_share_req_mem_section, entries[initial_n_mem_entries]); >> + msg_size += sizeof(u32); /* for memory attributes, currently unused */ >> + >> + msg = kzalloc(msg_size, GFP_KERNEL); >> + if (!msg) >> + return -ENOMEM; >> + >> + ret = gh_rm_platform_pre_mem_share(rm, p); > > Hmm ..I think gh_rm_platform_pre_mem_share() is not yet defined as of this > patch, so you probably want this in a later patch. > Seems I fell victim to trusting automatic fixup tools. Fixed. >> + if (ret) { >> + kfree(msg); >> + return ret; >> + } >> + _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel