Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp3181970rwi; Tue, 1 Nov 2022 17:17:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5o7uRSqBXO2CYvDjxUpXxSm05/KFXg+usBR+yfP1jTNMZchJRZd4tnlH2d1dZwLTeAtNqE X-Received: by 2002:a05:6402:114a:b0:454:85e4:2295 with SMTP id g10-20020a056402114a00b0045485e42295mr22264386edw.348.1667348254586; Tue, 01 Nov 2022 17:17:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667348254; cv=none; d=google.com; s=arc-20160816; b=Acf5Nt7psxPZAiRynEcgMhJBUAljAl9xxL/SFD2mcqyGDFsRH5MuAR7lBJSRQRiRoh XrPSdEXlhhn0o57CCQeGbzUQv2hTUf6ige+t2tfuEpwXKlxpYNE/7BRsTeHV2ZElUn78 TydBbvVGhJtshB6eGcArV2Bmh0+GzcZcoIdHEdvu5xYMm+TzK82DpDKtIUmMVATJ31op 0BcGKd1NGTe2k23gpkAqoUf1I9SHm4Bme2oudA+PU+hHjoUCg8HPgy4oeoGAri4fykuz RiZEHKwv626UMH5V+dnCWGGMZ7ZEflMt+VzbxcYzwis+kM/emj4+QdfzcyFSI21zrNYK daig== 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=3SQlBo9rCGUizTjGv+/lpKep+OjbGeKOVJdVW8QOZL4=; b=C8LtkVEDZrP7aT/nzi1DD6pB3C/jdwmJo0NxOunkH9W/R1TeHPf1Vph6LqsbCBpSJL 4qTi6NWNYv8VU3IeB1nF8MlYF05RC6IueVEBEZdvBp9g88jqaQe02D4kHIIPiMglmy3m FmxsaFyO+jIVSoCejA0xwADseCCcIDxUnXWDkOjfwEpFm73Dj2PnL2fIynZpF0Hq89KJ aaZSWz/lnuGbHgDuHFg9amY3gHi990i68zE0xxi2Sp/nh4cQlyEUqu4KxxLOmYUPl4wz 97hnMqu2nBuOLvARIfuxAwwzpQS9tcoN3826yCtJ18NLt839J9vCyLqlAAzpWJ1ECnk4 XV/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=EHNO81Sa; 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 a4-20020a05640233c400b004587e99bcc2si12791587edc.383.2022.11.01.17.17.09; Tue, 01 Nov 2022 17:17:34 -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=EHNO81Sa; 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 S229637AbiKBAMo (ORCPT + 98 others); Tue, 1 Nov 2022 20:12:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229528AbiKBAMm (ORCPT ); Tue, 1 Nov 2022 20:12:42 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F050D262F; Tue, 1 Nov 2022 17:12:40 -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 2A1NqOH2001930; Wed, 2 Nov 2022 00:12:17 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=3SQlBo9rCGUizTjGv+/lpKep+OjbGeKOVJdVW8QOZL4=; b=EHNO81SaEVaVpjYOCo3mU4Ns3wWhKZhulFmhNiXdxlU+h7iWvuZtp/XZibn+XwT7E+Bu 3Ye/HBNexC0Mh0kWwiK1ghjhQTKJwQVCLUTOT+YZowb427Z9U2vmS7rEq10VTvanLW89 u33QVh5PTyMuF3cqpikAY2aMC3hWwp+25yPNRSljrwt1op384A6n+0XA1BIRpHqkaAL1 tnx0cUNWn+WhQO3XNPLBPYpwQ+337N4FTaTXHXpcrwsklX9FnGQNgrbHZuqBP1RFAzSm 61b8tTWyyYxaALtelv9IazFqKoHAzxohhDwN3cmHSDgqXp9RP2J3hF4C34po7Grnbt2M cQ== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3kkcvx82uh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 02 Nov 2022 00:12:17 +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 2A20CGWo023853 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 2 Nov 2022 00:12:16 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; Tue, 1 Nov 2022 17:12:15 -0700 Message-ID: <62f7402d-f0e7-8e8a-e1a4-958ddbcf8d8b@quicinc.com> Date: Tue, 1 Nov 2022 17:12:14 -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> 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: nasanex01a.na.qualcomm.com (10.52.223.231) 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: Xy9mO6pF7ziragwStahIJnlfiYG5CsQG X-Proofpoint-ORIG-GUID: Xy9mO6pF7ziragwStahIJnlfiYG5CsQG 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-01_11,2022-11-01_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 malwarescore=0 suspectscore=0 clxscore=1015 bulkscore=0 phishscore=0 priorityscore=1501 impostorscore=0 mlxlogscore=850 lowpriorityscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211010163 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 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. Thanks, Elliot