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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D305DC64EC4 for ; Fri, 17 Feb 2023 13:24:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229836AbjBQNY3 (ORCPT ); Fri, 17 Feb 2023 08:24:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbjBQNY1 (ORCPT ); Fri, 17 Feb 2023 08:24:27 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00CDE64B1B; Fri, 17 Feb 2023 05:24:24 -0800 (PST) Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31H8EIhH001822; Fri, 17 Feb 2023 13:24:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=date : from : to : cc : subject : message-id : reply-to : references : mime-version : content-type : in-reply-to; s=qcppdkim1; bh=s0uOKg5aV0ejVOsToOLWLV1+gB9lbFKlo0HhvFNJLY0=; b=awb1frPf56+SCjtG83gRFh9k01yiRuPvPLMuFkLshJFq3quMInXyJVdnmE+0KY7S0EFw iBW04reDqBfJqvFjEjwxjgqaMybMPffzky8LGl8U1cJlQkKPYO9oSX+d/fm9Ms2UDtvS gzdG1U+VYPcd6N5sVhrImRQKxFmkczkbYDDCSZOKxGu9P5nw9dkcxfI7PXgJToPmX6pC 9lw3eNzowh+6ACmRZdL7fuUDy5wVOk9B2GTkMimfWrsfXh3gUREuigIsZfuo0/+F1Hrb SU2byAQQWoZl0CpoqQztKW1+19Hc6V5+4q3WTuiMzX/w7Cdyo8ya6IQiR/JwImvrp2X6 PA== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3nsjyw3n4n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Feb 2023 13:24:07 +0000 Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 31HDO6gR020473 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Feb 2023 13:24:06 GMT Received: from quicinc.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Fri, 17 Feb 2023 05:23:59 -0800 Date: Fri, 17 Feb 2023 18:53:55 +0530 From: Srivatsa Vaddagiri To: Elliot Berman CC: Alex Elder , Srinivas Kandagatla , Prakruthi Deepak Heragu , Jonathan Corbet , Murali Nalajala , Trilok Soni , "Carl van Schaik" , Dmitry Baryshkov , Bjorn Andersson , "Konrad Dybcio" , Arnd Bergmann , "Greg Kroah-Hartman" , Rob Herring , Krzysztof Kozlowski , Bagas Sanjaya , Catalin Marinas , Jassi Brar , , , , , Subject: Re: [PATCH v10 19/26] gunyah: vm_mgr: Add framework to add VM Functions Message-ID: <20230217132355.GM332@quicinc.com> Reply-To: Srivatsa Vaddagiri References: <20230214211229.3239350-1-quic_eberman@quicinc.com> <20230214212531.3323284-1-quic_eberman@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline In-Reply-To: <20230214212531.3323284-1-quic_eberman@quicinc.com> X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: KRR_a9lcYglbWn6jsltsgy7s7niCH1GT X-Proofpoint-ORIG-GUID: KRR_a9lcYglbWn6jsltsgy7s7niCH1GT X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-17_08,2023-02-17_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 adultscore=0 phishscore=0 spamscore=0 clxscore=1011 mlxscore=0 bulkscore=0 malwarescore=0 impostorscore=0 mlxlogscore=885 suspectscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302170120 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Elliot Berman [2023-02-14 13:25:30]: > +static long gh_vm_add_function(struct gh_vm *ghvm, struct gh_fn_desc *f) > +{ > + struct gh_vm_function_instance *inst; > + void __user *argp; > + long r = 0; > + > + if (f->arg_size > GH_FN_MAX_ARG_SIZE) > + return -EINVAL; > + > + inst = kzalloc(sizeof(*inst), GFP_KERNEL); > + if (!inst) > + return -ENOMEM; > + > + inst->arg_size = f->arg_size; > + if (inst->arg_size) { > + inst->argp = kzalloc(inst->arg_size, GFP_KERNEL); > + if (!inst->arg) { if (!inst->argp) ? > + r = -ENOMEM; > + goto free; > + }