Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp242768rwi; Wed, 2 Nov 2022 11:22:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6c/yNhzYHSn+fuL4PeEpEBePjYepLb1p34a+YcX3mT29bYY+GdExb3gg5OKjdQYel3S5n1 X-Received: by 2002:a17:907:3e02:b0:782:1267:f2c8 with SMTP id hp2-20020a1709073e0200b007821267f2c8mr24877995ejc.585.1667413335309; Wed, 02 Nov 2022 11:22:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667413335; cv=none; d=google.com; s=arc-20160816; b=jg/cgfD84WRGlwTdR2VTrFMtFjmulWMNcqSgPMj+nct+1EOcnzkBLcRslHJNuQaBO7 QgPyu0AfbZf63IqeMLMVXGZgFfDUYmWppjfKS7kCG2P5MEDAupKdwA4nW5ryU1hx8dnY 5i68aEIhNyjczvs60ZWZuCnOyHdSnrLO7hv+0ObLtl5dziX67N+2xxpF90BrAS1mwZuu pDi+ukoSE4sgonths98m1ek2G0kMR3N6U+rhJtNfnsx2BOqQsOr/bkTkLuFYoC0gRd/J mQA0fvMKtB2KAbgCrer8QdmQ+/8tRGav0ySODsAcC1A1wdZy+eHPaGMLHMKTUYhda6js URUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=9bd16qJOxFxmn3WuYuWKXuBoDrhtl72XvI6Qp1P+n1A=; b=qz1bT0131ZksG4iip1xxuss667Gugxsp9mFsbWdRzR6CuAQM5H1BAKJl3AyywRga0W +XNPQ3nr5DG/xAA0t4SI+oBeVTMSMs4OT3D4uZ9eoZwds4ceLMOpbP1p8KZ+g6DZgwfb o8tk0rueNGJGBDVqcrYSFvEEXBVXCqkTYCcMi4EZWKs5+wl6h1meo0/CEEo7ih30uqOH P0eGoGXZbWvec4pwdgb7l09RJu3/cvkredjMuOrAKqn8Mw73qlkIWof8lyVvIgOZ6aHp mOkNcRwf/+/YZ0BFmFUv7o4UW66in66YWXdcNIFyC0QQc2RyWmsLoUYYt5BHOzjpsrEM GZSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=dYhgQ32b; 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 jg26-20020a170907971a00b007a3fbdb825asi17243439ejc.707.2022.11.02.11.21.51; Wed, 02 Nov 2022 11:22:15 -0700 (PDT) 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=dYhgQ32b; 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 S230209AbiKBSGY (ORCPT + 98 others); Wed, 2 Nov 2022 14:06:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229688AbiKBSGW (ORCPT ); Wed, 2 Nov 2022 14:06:22 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E660521278; Wed, 2 Nov 2022 11:06:20 -0700 (PDT) Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2A2I0B8U032383; Wed, 2 Nov 2022 18:05:55 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=9bd16qJOxFxmn3WuYuWKXuBoDrhtl72XvI6Qp1P+n1A=; b=dYhgQ32blGE3d2HIJ/kzqiQTidud8dXQ9N8sDv9bi6l3+ynTQAKx8iUJiI8zn7trV5S0 vWURgtF8O6OSIqcRMkBaYFzSR+kMRSLj99P1GdYhf6SoHWr8ymnOl2uk8mTsdb5VzF8f x8INJ/YEBMUQqQwGaFzck/bFY7/+NKbQlZ9+ECFkj7Dzl+itWDh2P6Y1baitEX8t0oWm lyAkeA0VQ/qi0xPvLj5jepQ7YHZUsF3CzBDTkbMoaXsYRW6mOJgzCHAUVNEwQyBseuxR lA9w/MzNe4o4Cf8C7UUSgcYXVTaGG9wdVKlaHh+jXORuLBUj5EqT16XWkfuF99+Q7InM zQ== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3kkweg80h7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 02 Nov 2022 18:05:54 +0000 Received: from nasanex01b.na.qualcomm.com (corens_vlan604_snip.qualcomm.com [10.53.140.1]) by NASANPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2A2I5rNQ021036 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 2 Nov 2022 18:05:54 GMT Received: from [10.134.65.5] (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.29; Wed, 2 Nov 2022 11:05:53 -0700 Message-ID: <840d876c-6a09-59cf-fc66-c5752ad22d7e@quicinc.com> Date: Wed, 2 Nov 2022 11:05:52 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH v6 02/21] dt-bindings: Add binding for gunyah hypervisor Content-Language: en-US To: Jassi Brar CC: Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Murali Nalajala , Trilok Soni , "Srivatsa Vaddagiri" , Carl van Schaik , Prakruthi Deepak Heragu , Andy Gross , Dmitry Baryshkov , , "Mark Rutland" , Lorenzo Pieralisi , Sudeep Holla , "Marc Zyngier" , Jonathan Corbet , Will Deacon , Catalin Marinas , Arnd Bergmann , Greg Kroah-Hartman , "Srinivas Kandagatla" , Amol Maheshwari , Kalle Valo , , , , References: <20221026185846.3983888-1-quic_eberman@quicinc.com> <20221026185846.3983888-3-quic_eberman@quicinc.com> <4cb58489-cd42-1868-9add-0c360065de23@quicinc.com> <62f7402d-f0e7-8e8a-e1a4-958ddbcf8d8b@quicinc.com> From: Elliot Berman In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit 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: xgq7az1uubtFEhv7QA1MXokBI2i9xs46 X-Proofpoint-ORIG-GUID: xgq7az1uubtFEhv7QA1MXokBI2i9xs46 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-02_14,2022-11-02_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 phishscore=0 mlxlogscore=854 impostorscore=0 adultscore=0 malwarescore=0 mlxscore=0 spamscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211020118 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 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 Hi Jassi, On 11/1/2022 7:01 PM, Jassi Brar wrote: > On Tue, Nov 1, 2022 at 7:12 PM Elliot Berman wrote: >> >> >> >> On 11/1/2022 2:58 PM, Jassi Brar wrote: >>> On Tue, Nov 1, 2022 at 3:35 PM Elliot Berman wrote: >>>> >>>> >>>> >>>> On 11/1/2022 9:23 AM, Jassi Brar wrote: >>>>> On Mon, Oct 31, 2022 at 10:20 PM Elliot Berman wrote: >>>>>> >>>>>> Hi Jassi, >>>>>> >>>>>> On 10/27/2022 7:33 PM, Jassi Brar wrote: >>>>>> > On Wed, Oct 26, 2022 at 1:59 PM Elliot Berman >>>>>> wrote: >>>>>> > ..... >>>>>> >> + >>>>>> >> + gunyah-resource-mgr@0 { >>>>>> >> + compatible = "gunyah-resource-manager-1-0", >>>>>> "gunyah-resource-manager"; >>>>>> >> + interrupts = , /* TX >>>>>> full IRQ */ >>>>>> >> + ; /* RX >>>>>> empty IRQ */ >>>>>> >> + reg = <0x00000000 0x00000000>, <0x00000000 0x00000001>; >>>>>> >> + /* TX, RX cap ids */ >>>>>> >> + }; >>>>>> >> >>>>>> > All these resources are used only by the mailbox controller driver. >>>>>> > So, this should be the mailbox controller node, rather than the >>>>>> > mailbox user.> One option is to load gunyah-resource-manager as a >>>>>> module that relies >>>>>> > on the gunyah-mailbox provider. That would also avoid the "Allow >>>>>> > direct registration to a channel" hack patch. >>>>>> >>>>>> A message queue to another guest VM wouldn't be known at boot time and >>>>>> thus couldn't be described on the devicetree. >>>>>> >>>>> I think you need to implement of_xlate() ... or please tell me what >>>>> exactly you need to specify in the dt. >>>> >>>> Dynamically created virtual machines can't be known on the dt, so there >>>> is nothing to specify in the DT. There couldn't be a devicetree node for >>>> the message queue client because that client is only exists once the VM >>>> is created by userspace. >>>> >>> The underlying "physical channel" is the synchronous SMC instruction, >>> which remains 1 irrespective of the number of mailbox instances >>> created. >> >> I disagree that the physical channel is the SMC instruction. Regardless >> though, there are num_online_cpus() "physical channels" with this >> perspective. >> >>> So basically you are sharing one resource among users. Why doesn't the >>> RM request the "smc instruction" channel once and share it among >>> users? >> >> I suppose in this scenario, a single mailbox channel would represent all >> message queues? This would cause Linux to serialize *all* message queue >> hypercalls. Sorry, I can only think negative implications. >> >> Error handling needs to move into clients: if a TX message queue becomes >> full or an RX message queue becomes empty, then we'll need to return >> error back to the client right away. The clients would need to register >> for the RTS/RTR interrupts to know when to send/receive messages and >> have retry error handling. If the mailbox controller retried for the >> clients as currently proposed, then we could get into a scenario where a >> message queue could never be ready to send/receive and thus stuck >> forever trying to process that message. The effect here would be that >> the mailbox controller becomes a wrapper to some SMC instructions that >> aren't related at the SMC instruction level. >> >> A single channel would limit performance of SMP systems because only one >> core could send/receive a message. There is no such limitation for >> message queues to behave like this. >> > This is just an illusion. If Gunyah can handle multiple calls from a > VM parallely, even with the "bind-client-to-channel" hack you can't > make sure different channels run on different cpu cores. If you are > ok with that, you could simply populate a mailbox controller with N > channels and allocate them in any order the clients ask. I wanted to make sure I understood the ask here completely. On what basis is N chosen? Who would be the mailbox clients? Thanks, Elliot