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=-17.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 DE0FCC433FE for ; Fri, 10 Sep 2021 01:00:51 +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 AB89A610C9 for ; Fri, 10 Sep 2021 01:00:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AB89A610C9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.183811.332154 (Exim 4.92) (envelope-from ) id 1mOUuF-0003SI-88; Fri, 10 Sep 2021 01:00:39 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 183811.332154; Fri, 10 Sep 2021 01:00:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mOUuF-0003RO-4I; Fri, 10 Sep 2021 01:00:39 +0000 Received: by outflank-mailman (input) for mailman id 183811; Fri, 10 Sep 2021 01:00:37 +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 1mOUuD-0002nF-IV for xen-devel@lists.xenproject.org; Fri, 10 Sep 2021 01:00:37 +0000 Received: from mail.kernel.org (unknown [198.145.29.99]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 81f0d8ce-11d2-11ec-b206-12813bfff9fa; Fri, 10 Sep 2021 01:00:36 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id B8D5F610C9; Fri, 10 Sep 2021 01:00:35 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 81f0d8ce-11d2-11ec-b206-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631235635; bh=ijbpxVEv2WqN6U7QSvEPX/gA8Hrre+cnWPsQKbMPbxE=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=qjwp1h+uEAie4pfQh0jQiw2tOs+4vmQfugGcegniEN4Ybr1+EgSNlkrHgIeALz6Ba 3y4hqE8DhSgO084XehcFOuA1ICUCMSRoFnGcqoPDqbNPAU3pNZ5GKxk2Dl8uvG4fvL J3u8ESfJuweXdhCjBye7RwsKT3CIsQiKmkhxKkH3KWGrJTKnP3uz8Ue9pioT6D64Zz qYCmX757iyR0ThuB/IERkm28MNoWD+HwxuWio4YFvz+0hcViMeBwrayuHJjhy/dz7i n+j2exdRA7MVRT2oHAnvuE6JmwQbIqGs5QVfKXadNoH4qaiwwlsMjBg/JXz1v1YjK/ qrUNTL3v98fNw== Date: Thu, 9 Sep 2021 18:00:35 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-T480s To: Rahul Singh cc: xen-devel@lists.xenproject.org, bertrand.marquis@arm.com, Stefano Stabellini , Julien Grall , Volodymyr Babchuk Subject: Re: [PATCH v1 14/14] xen/arm: Add linux,pci-domain property for hwdom if not available. In-Reply-To: <0b979ccab6a4c9b2070748709f737f41fa108a42.1629366665.git.rahul.singh@arm.com> Message-ID: References: <0b979ccab6a4c9b2070748709f737f41fa108a42.1629366665.git.rahul.singh@arm.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII On Thu, 19 Aug 2021, Rahul Singh wrote: > If the property is not present in the device tree node for host bridge, > XEN while creating the dtb for hwdom will create this property and > assigns the already allocated segment to the host bridge > so that XEN and linux will have the same segment for the host bridges. > > Signed-off-by: Rahul Singh > --- > xen/arch/arm/domain_build.c | 18 ++++++++++++++++++ > xen/arch/arm/pci/pci-host-common.c | 21 +++++++++++++++++++++ > xen/include/asm-arm/pci.h | 3 +++ > 3 files changed, 42 insertions(+) > > diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c > index 6c86d52781..e0cf2ff19d 100644 > --- a/xen/arch/arm/domain_build.c > +++ b/xen/arch/arm/domain_build.c > @@ -581,6 +581,24 @@ static int __init write_properties(struct domain *d, struct kernel_info *kinfo, > return res; > } > > +#ifdef CONFIG_HAS_PCI > + if ( dt_device_type_is_equal(node, "pci") ) > + { > + if ( !dt_find_property(node, "linux,pci-domain", NULL) ) > + { > + uint16_t segment; > + > + res = pci_get_host_bridge_segment(node, &segment); > + if ( res < 0 ) > + return res; > + > + res = fdt_property_cell(kinfo->fdt, "linux,pci-domain", segment); > + if ( res ) > + return res; > + } > + } > +#endif If param_pci_enable is false it might be possible that Xen didn't allocate a segment. In that case, we should just let Linux do whatever it wants in terms of segment allocation. So I think the code here should not return error if param_pci_enable is false. returning an error instead.