Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp5917992rwl; Mon, 9 Jan 2023 01:26:33 -0800 (PST) X-Google-Smtp-Source: AMrXdXvEBUYAnLGvxsMMY4mwvTq5mk37qvxNxPwa3oSEf/nQRxztLE1hIRyBsOA8c3LzUaLfFrsD X-Received: by 2002:a05:6402:e09:b0:479:3ffb:9243 with SMTP id h9-20020a0564020e0900b004793ffb9243mr57781276edh.25.1673256393424; Mon, 09 Jan 2023 01:26:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673256393; cv=none; d=google.com; s=arc-20160816; b=SwEb3T5jOEkq263gTBdtuS/Hq0P0zdQUBRGC87mpah2+cW3sgrqA8wTVpWVJj+twpP AIxtuMFLb+49AIjTFjvaNGUFufb/G4XlYDBuLbpxgEzSGyenu4lnOZUxLS+S6UjYOujk gPCBigkHY7pOSrM698W/sHPJkmaOC43DAJaYbnNcu+n3bkTK9iHJnBWjukfQzZmxreXi NmNe/Y8bJkHU4jLXRuSoaJWBteyhOJLIv+WFT7iXfYq4KoaHxit3nfvw4T+a7DB17MDE Ov245YlVyWLI+USI8zo85qEKB8khs3HFDCpCEQ6ohokIa21pmF385lwUr7ebq2sl3rai jwJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=XxHuIQPh1jtnEpxWMwNDr1Y0CAe06b1+6mK5HGVQu5w=; b=wZFPNeqbFcenfN24oYGbEFBpxJ7wyU6tCXWhaNr3vEZ0BtIg8vPzzOzqX8qao3DslG llsYAO/aVCb0h5AgyByLK0W/l8NTEfSM8joc3L079+ZqAmlMfyglZs3gLO1hmFwQQrVy TWoDMrX5Y2BXy/UsJUuJMoSi+hPKodAc6gnmBmguE1TaUBSE+vXOJH7/QYv07y4aM3pn w4kvYZIuTYW865jfWc8wAARymwbDaPmq/WR7840a4IERHI/6WpOeA088es/a18I+mnYI 2PZALGppklzyZqwOLnfKRTSqXn4aLyVOXf65fp72Iqtw2K/As9EZ9WDL0FqIh/DVj/Fe ByOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=EVgqWEiY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i9-20020a0564020f0900b0048371af9a90si9038030eda.397.2023.01.09.01.26.17; Mon, 09 Jan 2023 01:26:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=EVgqWEiY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236874AbjAIJLV (ORCPT + 54 others); Mon, 9 Jan 2023 04:11:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236907AbjAIJKP (ORCPT ); Mon, 9 Jan 2023 04:10:15 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9624516495; Mon, 9 Jan 2023 01:06:24 -0800 (PST) Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3097r7Cv001816; Mon, 9 Jan 2023 09:06:06 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=XxHuIQPh1jtnEpxWMwNDr1Y0CAe06b1+6mK5HGVQu5w=; b=EVgqWEiYLZ3+ztYFCe27IWCHuT6TjM9JoUdIhwAU1VzVPhez43C14F9ngot+0olMkFlp 11/AomqEJjq7b5aD5hOrz0cFkggHfD8AszKSDeitiFf/WjIRK31xKtXVzxInYAly8R12 xXYNx9XuAXRGc+Y/AwcwW5rqDaIfVB9AMLi9AVzWOJpEHX0RHxzJ4ynfh5eiX3u/96l6 7TuWrwY0eh3NsUMWQGSJ1pe/D4zjJE9n8oubKB5Wt/aR8G9lYTiQlKVAIG9VdT8ELW8j vV/pktMaZjxTzEg3qZoRzedPpqrX3o5gzNGHA1GSQN8nT2/ba+ouPnrzZrYxKMadFYEP fg== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3my02t2q55-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 Jan 2023 09:06:06 +0000 Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 309965Gk021644 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 9 Jan 2023 09:06:05 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.36; Mon, 9 Jan 2023 01:05:57 -0800 Date: Mon, 9 Jan 2023 14:35:53 +0530 From: Srivatsa Vaddagiri To: Elliot Berman CC: Bjorn Andersson , Jonathan Corbet , Murali Nalajala , Trilok Soni , Carl van Schaik , Prakruthi Deepak Heragu , Arnd Bergmann , Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Bagas Sanjaya , Catalin Marinas , Will Deacon , Jassi Brar , Sudeep Holla , Mark Rutland , Lorenzo Pieralisi , Dmitry Baryshkov , , , , , , Subject: Re: [PATCH v8 12/28] gunyah: vm_mgr: Introduce basic VM Manager Message-ID: <20230109090553.GA1737564@quicinc.com> Reply-To: Srivatsa Vaddagiri References: <20221219225850.2397345-1-quic_eberman@quicinc.com> <20221219225850.2397345-13-quic_eberman@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline In-Reply-To: <20221219225850.2397345-13-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: AykUCM4ocXnB41CGW_xT6GSACgEI0PMz X-Proofpoint-ORIG-GUID: AykUCM4ocXnB41CGW_xT6GSACgEI0PMz X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-09_03,2023-01-06_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 clxscore=1015 bulkscore=0 impostorscore=0 suspectscore=0 lowpriorityscore=0 priorityscore=1501 mlxscore=0 malwarescore=0 mlxlogscore=794 phishscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301090064 X-Spam-Status: No, score=1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_SBL_CSS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Elliot Berman [2022-12-19 14:58:33]: > +config GUNYAH_VM_MANAGER Any reason why this needs to be a separate config? IOW CONFIG_GUNYAH should enable VM management functionality also. > @@ -550,14 +580,29 @@ static int gh_rm_drv_probe(struct platform_device *pdev) > rsc_mgr->msgq_client.rx_callback = gh_rm_msgq_rx_data; > rsc_mgr->msgq_client.tx_done = gh_rm_msgq_tx_done; > > - return gh_msgq_init(&pdev->dev, &rsc_mgr->msgq, &rsc_mgr->msgq_client, > + ret = gh_msgq_init(&pdev->dev, &rsc_mgr->msgq, &rsc_mgr->msgq_client, > &rsc_mgr->tx_ghrsc, &rsc_mgr->rx_ghrsc); Bail on error here. [snip] > +static __must_check struct gunyah_vm *gunyah_vm_alloc(struct gh_rm_rpc *rm) > +{ > + struct gunyah_vm *ghvm; > + int vmid; > + > + vmid = gh_rm_alloc_vmid(rm, 0); > + if (vmid < 0) > + return ERR_PTR(vmid); > + > + ghvm = kzalloc(sizeof(*ghvm), GFP_KERNEL); > + if (!ghvm) dealloc_vmid here (as well as few other error paths)? > + return ghvm; > + > + get_gh_rm(rm);