From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 497CEC432BE for ; Fri, 27 Aug 2021 11:05:34 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9F00760551 for ; Fri, 27 Aug 2021 11:05:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9F00760551 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ilande.co.uk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:53084 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJZfw-00027Z-I7 for qemu-devel@archiver.kernel.org; Fri, 27 Aug 2021 07:05:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34602) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJZeN-0001H2-VT for qemu-devel@nongnu.org; Fri, 27 Aug 2021 07:03:57 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:50766 helo=mail.default.ilande.bv.iomart.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJZeM-0008Kl-45 for qemu-devel@nongnu.org; Fri, 27 Aug 2021 07:03:55 -0400 Received: from host86-179-186-93.range86-179.btcentralplus.com ([86.179.186.93] helo=[192.168.50.176]) by mail.default.ilande.bv.iomart.io with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mJZds-00034T-3v; Fri, 27 Aug 2021 12:03:29 +0100 To: Peter Maydell References: <20210826200720.2196827-1-philmd@redhat.com> <20210826200720.2196827-4-philmd@redhat.com> <44d7475b-0d4a-58e0-59e1-bba24cb1ca7e@ilande.co.uk> From: Mark Cave-Ayland Message-ID: <2d1bb979-9bea-73b0-e6a2-f80ba4b85e1d@ilande.co.uk> Date: Fri, 27 Aug 2021 12:03:42 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 86.179.186.93 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: Re: [PATCH v3 3/3] hw/usb/xhci: Always expect 'dma' link property to be set X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.bv.iomart.io) Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.default.ilande.bv.iomart.io X-Spam_score_int: -38 X-Spam_score: -3.9 X-Spam_bar: --- X-Spam_report: (-3.9 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-2.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , Richard Henderson , QEMU Developers , Gerd Hoffmann , Paolo Bonzini , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 27/08/2021 11:14, Peter Maydell wrote: > On Fri, 27 Aug 2021 at 10:14, Mark Cave-Ayland > wrote: >> Ah so the plan moving forward is to always have an explicit MR passed in for DMA use. >> Sorry if I missed that in earlier versions of the patchset, I'm still getting back up >> to speed on QEMU hacking. >> >> Was there a decision as to what the property name should be? I see "dma_mr" used >> quite a bit, and if there will be more patches to remove the system_memory default >> from other devices then it would be nice to try and use the same name everywhere. > > No, I don't think we have a convention; it might be nice to add one. > Currently a quick git grep for DEFINE_PROP_LINK and eyeballing of > the results shows that we have: > > "memory" x 7 > "dram" x 4 > "downstream" x 3 > "dma-memory" x 3 > "dma" x 2 > "source-memory" > "dram-mr" > "ddr" > "ddr-ram" > "gic" > "cpc" > "port[N]" > "dma_mr" > "ahb-bus" > "system-memory" > "main-bus" > > This list includes all our TYPE_MEMORY_REGION link properties; a few of these > are special-purpose, and reasonably have specialized names. 2 out of 3 users > of "downstream" are devices which pass on (or filter out) memory transactions > from the CPU (tz-msc, tz-mpc), and I think that name makes sense there. > (The 3rd is pl080.c, which is a plain old DMA controller, and the naming > there is not so well-suited.) > > "memory" is mostly SoC and CPU objects taking a link to whatever they should > have as the CPU's view of memory. > > I don't have a strong view on what we ought to try to standardize on, > except that I don't like the "_mr" or "-mr" suffix -- I don't think we > need to try to encode the type of the link property in the property name. > > It is probably reasonable to have different naming conventions for: > * SoC and CPU objects, which take a link to the MR which represents > the CPU/SoC's view of the outside world > * Endpoint devices which can be DMA masters and take a link giving > them their view of what they can DMA to > * filtering/control devices which take incoming transactions from > an upstream port, filter some and pass the rest through to a > downstream port > > In pretty much all cases, these link properties are used only internally > to QEMU, so if we decide on a naming convention we can fairly easily > rename existing properties to match. I quite like "cpu-memory" for SoC/CPU objects and "dma-memory" for endpoint devices that can be DMA masters. Perhaps the last case is specialised enough that a convention there doesn't make sense? ATB, Mark.