From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web08.8587.1631088218259070018 for ; Wed, 08 Sep 2021 01:03:38 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=h4kzbg14; spf=pass (domain: redhat.com, ip: 216.205.24.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631088216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/P/SZFOJJ7NHNpjSyrxi9zixxjEb1eYJ0hBoEZCiXKU=; b=h4kzbg142D1eNkeEC21ERTiCppsCbwipdOJtq3SSNZMM5EPsaWcfKlSFhPexbmOwOhe1Ws OVjbEQdNEsT7OcSUpT3Y+LP67kNxNX7nX7c9D7lxfYiUj2ovhsWcl3n0ekac7kDhdHPWAt hq6fc9eKspCPyvBcCv16odSywNiibHU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-181-cl4Eta2nMOewiRu7vI_gsA-1; Wed, 08 Sep 2021 04:03:35 -0400 X-MC-Unique: cl4Eta2nMOewiRu7vI_gsA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F2C4E809CD8; Wed, 8 Sep 2021 08:03:33 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B1D2860BD8; Wed, 8 Sep 2021 08:03:33 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 10C8118003AA; Wed, 8 Sep 2021 10:03:32 +0200 (CEST) Date: Wed, 8 Sep 2021 10:03:32 +0200 From: "Gerd Hoffmann" To: devel@edk2.groups.io, ncoleon@amazon.com Cc: Alexander Graf Subject: Re: [edk2-devel] [PATCH 1/5] OvmfPkg/PlatformPei: Extend 64-bit PCI range for multiple host bridges Message-ID: <20210908080332.mgq4cs53e6jmpb5f@sirius.home.kraxel.org> References: <2002ab24b91e9007619febab837d2c29aee5f93f.1630676569.git.ncoleon@amazon.com> MIME-Version: 1.0 In-Reply-To: <2002ab24b91e9007619febab837d2c29aee5f93f.1630676569.git.ncoleon@amazon.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline > +// > +// Root bridge resource information for parsing fw-cfg data > +// > +#pragma pack(1) > +typedef struct { > + BOOLEAN set_pxm; > + BOOLEAN mark_prefetchable_resources_as_cacheable; > + > + UINT8 root_bus_nr; > + UINT8 pxm; > + UINT8 num_hot_plug_slots; > + > + UINT8 root_bur_nr_start; > + UINT8 root_bus_nr_end; > + > + UINT32 lowmem_start; > + UINT32 lowmem_end; > + UINT32 lowmem_pref_start; > + UINT32 lowmem_pref_end; > + > + UINT64 highmem_start; > + UINT64 highmem_end; > + UINT64 highmem_pref_start; > + UINT64 highmem_pref_end; > +} HOST_BRIDGE_INFO; > +#pragma pack() Hmm. A number of fields is not used by this patch series, pxm for example. On the other hand it is incomplete, ioports are not there. It looks like you are simply throwing some internal data structure into fw_cfg. This is *not* how things should be done. Is the host-side code for this open source btw? If so, do you have a pointer? I see two reasonable options going forward: (1) Create a format which contains *everything* needed to describe a pci(e) host bridge, not only those parts which you happen to need for your use case. Basically all information needed by PciHostBridgeUtilityInitRootBridge(), and the pcie config space location. Drop fields not needed. And add comments documenting the struct. (2) Use an existing format. Obvious choice coming to mind is device-tree. We already have a parser for that because the arm platform (and riscv too soon) needs it to find the pcie host bridge. take care, Gerd