From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web08.5531.1654170214628884529 for ; Thu, 02 Jun 2022 04:43:34 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vNoZ5zVG; spf=pass (domain: kernel.org, ip: 139.178.84.217, mailfrom: ardb@kernel.org) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2033560C98 for ; Thu, 2 Jun 2022 11:43:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30140C36AE2 for ; Thu, 2 Jun 2022 11:43:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654170212; bh=NBShhRxZfaIiP6wwaInUidVXi2ebcm32ZBn31OWIgOA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=vNoZ5zVGvgC6JOGf2f9WhMYJKoveI6ZuBOTUrK5XO65CH+ETrd7nUqtSFfQG3zKIp ch1useDtwrzodEdbfVB2dXzWiJf3a+afFWV8Luclbfs2NcRtnt7d+PIkrhHccD+c0S fJaQ6KNB5TSJ63IhALIncdeklOJUbmYgXGYW2r7oqTcgi2S9fc/fcqLhtqAA1V0hbo Tld4Wq+8gM2E/eDy95wAYWFTTmgcsknYEohChevj6pGmALe0zIKKjpzeimULpCTrab O+Qw6wpl+AlzcNyZE7zok2UAhWoDZzrog8uMqRzOB7gb3AnJZF9V3cnd4CaG0ArR9H fgYnB/g0T+ocg== Received: by mail-oa1-f50.google.com with SMTP id 586e51a60fabf-f16a3e0529so6407024fac.2 for ; Thu, 02 Jun 2022 04:43:32 -0700 (PDT) X-Gm-Message-State: AOAM530YGKYrSve3in8z7fhN1DTeKU/amd5b70vKt2j6L7YYcrkaNbY0 SqTuK21+R7+zOaGsCG+nUkd6xku/HrhmiWlVjyw= X-Google-Smtp-Source: ABdhPJyviKpwJX0odlk9l1fMZTirusfYMpByZw+fLLqXr0gv+hzODpWenf4X8YSK2CQYHdW2eEjDYtvYYcIoeJonklk= X-Received: by 2002:a05:6871:5c8:b0:f3:3c1c:126f with SMTP id v8-20020a05687105c800b000f33c1c126fmr2459014oan.126.1654170211280; Thu, 02 Jun 2022 04:43:31 -0700 (PDT) MIME-Version: 1.0 References: <20220602084216.159028-1-kraxel@redhat.com> <20220602084216.159028-2-kraxel@redhat.com> In-Reply-To: From: "Ard Biesheuvel" Date: Thu, 2 Jun 2022 13:43:20 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v7 1/6] MdeModulePkg/PciHostBridge: io range is not mandatory To: "Ni, Ray" Cc: Gerd Hoffmann , "devel@edk2.groups.io" , "Wu, Hao A" , Pawel Polawski , Ard Biesheuvel , "Albecki, Mateusz" , "Chang, Abner" , Leif Lindholm , "Yao, Jiewen" , Oliver Steffen , "Gao, Liming" , "Wang, Jian J" , "Justen, Jordan L" Content-Type: text/plain; charset="UTF-8" On Thu, 2 Jun 2022 at 12:14, Ni, Ray wrote: > > Gerd, > The fix should work. But I am curious why the if in blow is not hit. > https://github.com/TianoCore/edk2/blob/master/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c#L922 > > The RootBridge->ResAllocNode[TypeIo].Status is assigned as ResNone in: > https://github.com/TianoCore/edk2/blob/master/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c#L263 > > Or maybe your OVMF platform doesn't execute the above code path? > > Then I guess maybe the Base/Limit of Aperture is not set properly so that below if is hit? > https://github.com/tianocore/edk2/blob/64706ef761273ba403f9cb3b7a986bfb804c0a87/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c#L249 > I did a quick test with both ArmVirtQemu and microvm (using this series but omitting the MdeModulePkg), and I can confirm that not having a I/O resource window at all seems to work fine if none of the PCI devices have I/O BARs. Gerd, do you remember why exactly this patch is needed? Is it related to devices that have I/O BARs but don't actually require them to function correctly?