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.3 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,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 07EF5C433E1 for ; Fri, 24 Jul 2020 18:32:38 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 CDBF7206F0 for ; Fri, 24 Jul 2020 18:32:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="DWiaD/PY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CDBF7206F0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jz2UX-0005bU-Ga; Fri, 24 Jul 2020 18:32:21 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jz2UW-0005bP-HZ for xen-devel@lists.xenproject.org; Fri, 24 Jul 2020 18:32:20 +0000 X-Inumbo-ID: 01d82bd2-cddc-11ea-a45b-12813bfff9fa Received: from mail.kernel.org (unknown [198.145.29.99]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 01d82bd2-cddc-11ea-a45b-12813bfff9fa; Fri, 24 Jul 2020 18:32:20 +0000 (UTC) Received: from localhost (c-67-164-102-47.hsd1.ca.comcast.net [67.164.102.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C29EE206F0; Fri, 24 Jul 2020 18:32:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595615539; bh=edzJ0zO5I70t7wGG5vAuUCZOGjGxj2xutns/fJYnx64=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=DWiaD/PYL6DTyiNtfZga4WXYYdArgvsHGz9FUo9BhDK96Con/hc8CNV8pGtJM0veC S6K40lR07tmsCIbDnAPgSnH0GHZ1xZ49KbUBK2vgBMOci/LRlN815BDDDF7gxZ1FyR ME6aFIdXcYwWDzscDQJRn8HFJqGPGf1kdnBA0jOw= Date: Fri, 24 Jul 2020 11:32:18 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-T480s To: Julien Grall Subject: Re: [RFC PATCH v1 1/4] arm/pci: PCI setup and PCI host bridge discovery within XEN on ARM. In-Reply-To: <40582d63-49c7-4a51-b35b-8248dfa34b66@xen.org> Message-ID: References: <64ebd4ef614b36a5844c52426a4a6a4a23b1f087.1595511416.git.rahul.singh@arm.com> <9f09ff42-a930-e4e3-d1c8-612ad03698ae@xen.org> <40582d63-49c7-4a51-b35b-8248dfa34b66@xen.org> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: nd@arm.com, Stefano Stabellini , andrew.cooper3@citrix.com, Bertrand.Marquis@arm.com, jbeulich@suse.com, xen-devel@lists.xenproject.org, Rahul Singh , Volodymyr Babchuk , roger.pau@citrix.com Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" On Fri, 24 Jul 2020, Julien Grall wrote: > On 24/07/2020 18:41, Stefano Stabellini wrote: > > On Fri, 24 Jul 2020, Julien Grall wrote: > > > On 24/07/2020 00:38, Stefano Stabellini wrote: > > > The segment number is just a value defined by the software. So as long as > > > Linux and Xen agrees with the number, then we should be ok. > > > > As far as I understand a Linux "domain" (linux,pci-domain in device > > tree) is a value defined by the software. The PCI segment has a > > definition in the PCI spec and it is returned by _SEG on ACPI systems. > > > > The link above suggests that a Linux domain corresponds to (_SEG, > > _BBN) where _SEG is the segment and _BBN is the "Bus Number". > > > > I just would like to be precise with the terminology: if we are talking > > about domains in the linux sense of the word, as it looks like we are > > doing, then let's call them domain instead of segments which seem to > > have a different definition. > > You seem to argue on the name but this doesn't resolve the underlying problem. > Indeed, all our external interfaces are expecting a segment number. Yes, you are right, that is a bigger problem. > If they are not equal, then I fail to see why it would be useful to have this > value in Xen. I think that's because the domain is actually more convenient to use because a segment can span multiple PCI host bridges. So my understanding is that a segment alone is not sufficient to identify a host bridge. From a software implementation point of view it would be better to use domains. > In which case, we need to use PHYSDEVOP_pci_mmcfg_reserved so > Dom0 and Xen can synchronize on the segment number. I was hoping we could write down the assumption somewhere that for the cases we care about domain == segment, and error out if it is not the case.