Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp3300278rwi; Tue, 1 Nov 2022 19:11:51 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6/Kll6NLqg92Er92T6vLye9IBR7qluprvB6JdGPTJ2qjtqzE65BQs+qJz7fKMQME9FA/AY X-Received: by 2002:a17:902:a412:b0:185:43a2:3d16 with SMTP id p18-20020a170902a41200b0018543a23d16mr22294699plq.146.1667355110933; Tue, 01 Nov 2022 19:11:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667355110; cv=none; d=google.com; s=arc-20160816; b=rwyEMh9aJvQb7zQ+scviTsYzCle8DUx4QX8LGjxuYZlpDKIBdx2xrhE6wTZZS6sTFG UgavZEKlxcWi/K73vhaJHM+uwPUeKEfQVJ3kc5ObrndvHogoP0TwOf4kAzBFu5VugsqO Bd265y0UY/vMuvRUjj/H8CcxQVYndNmIwy4704AYIaOb7Qzmjxym+MG/zEkjRZhL8YRo hv8s1Oj1MrHEpbQS3zkzpPZi29fDIz6rDRV0I0TjOmNLXyyXDS/uRFy/yPIA07Y30LrB K66Qs/UdG/9xjcGdcf1rVK50eeu78Q7iRxiaDSLwXhO7XqIqZHLO3TyFiBZ/uWwazlUj QMNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=wpkpMG7UiwPayNiAZQIqA2owOEcKN042OlaP9NIKByQ=; b=ZCw1foNYujelzDwRu4IiZ/uhw5T7FJjtl/rp59Ekaq4a/SUiyvC7ZX01aGc9TEd1gC fPbN85y0fw6NnMDs26EK0m7GBcAAA5TiffNIdmrWjdj37JLrzoBcQGcGZJ8+ry3qErpW dbM4JLRDVWN+X7ZKBvd0erVImqtVKVOkdx2cyFmUc9tMnYPNRkeGxdImKus5Na/4aJB/ ZNiDB9VdJdZHgJ8W6aOde3QoB0k/0QC3ccR64B2fRmQzme6APzyu7823Te6SKmZMHlqf 0uo+zBP4IeiyoDllDDWxE84GAF4EwSJrFpZNHcwIKzfyP85iazusBcaF+mVGh9VPL5uR sfIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=PSI3BxsZ; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nd14-20020a17090b4cce00b0020f8385ca87si647248pjb.94.2022.11.01.19.11.37; Tue, 01 Nov 2022 19:11:50 -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=@gmail.com header.s=20210112 header.b=PSI3BxsZ; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230000AbiKBCBX (ORCPT + 98 others); Tue, 1 Nov 2022 22:01:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229770AbiKBCBU (ORCPT ); Tue, 1 Nov 2022 22:01:20 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB7B512ACA; Tue, 1 Nov 2022 19:01:17 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id kt23so41609838ejc.7; Tue, 01 Nov 2022 19:01:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=wpkpMG7UiwPayNiAZQIqA2owOEcKN042OlaP9NIKByQ=; b=PSI3BxsZxQhkVlAwBWePeEx4KtAfoo+szxImTtRUReTiDfr9ZDx6Sm5NPHqenJcNxT C1Cc1XtX2d+q26GnaWUsavd/r/VG2SddcvxNhRrceGmgd8jXDP3zO8nuuVuiXE9yg8Hv VromHHJwnoFv47aFFD6im43jbHCHm0qV2ut4Mm6hghqXVKBTtMMrOPSX4Es8NmfRxURn Y2nNK2sDRLTEQ4u2C+01zkX51+PYOkgLN2dDilBwbJVMVTnY515pXXOwSNQHmXwZgrRC ZExHO0WidqM2hqoKFAVYfQ30DpWzZE83Qd9SU2LqqYcsm7iUQBgPH/cZK8jnKEybEFn/ rKrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wpkpMG7UiwPayNiAZQIqA2owOEcKN042OlaP9NIKByQ=; b=cgRV5/DyRKhMj01OIeUrLC6eWhGYLbnLGj5xQZeRvEQN0czm4IOkAvgIBr1u5Vn+4o 1RMmg2shoMW5l7mRnCzsQpldKVoAUFo3RpTHoH/VsFdKHoY4I9Ge1GZrjt105SSJex0Q C9MyQrlnobGjz8cE7Tl4uuBuZlvqYXkoy1BcnEh093jL2d0e8dXxTm2lm4bej5ffDQUF 4Al2Y1IaOonsfKDLsW8uI51x3m7ZLflyWafQxaNn5/NQU/B5dDBSCIh2VgOw2im3lH9t F7ep5+lj5LtaTgc34z/yaAwBbKPTFHToPX5taKLfJW44dbcZ99vtsMe4BawFLeQrfdQl PwzQ== X-Gm-Message-State: ACrzQf1LEj69j6zNOfBDQruvaCua3lfpdAzPQMAtOPfb2Zn2tLrz/32M zbkg4ho9d72OKhakyxVmeaKwgnbM7yWAj4KD7DU= X-Received: by 2002:a17:906:8a7b:b0:7ac:baef:6de1 with SMTP id hy27-20020a1709068a7b00b007acbaef6de1mr21277925ejc.734.1667354476420; Tue, 01 Nov 2022 19:01:16 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <62f7402d-f0e7-8e8a-e1a4-958ddbcf8d8b@quicinc.com> From: Jassi Brar Date: Tue, 1 Nov 2022 21:01:04 -0500 Message-ID: Subject: Re: [PATCH v6 02/21] dt-bindings: Add binding for gunyah hypervisor To: Elliot Berman Cc: Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Murali Nalajala , Trilok Soni , Srivatsa Vaddagiri , Carl van Schaik , Prakruthi Deepak Heragu , Andy Gross , Dmitry Baryshkov , linux-arm-kernel@lists.infradead.org, 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 , devicetree@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, 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 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. -j