From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web10.3519.1665046214391040357 for ; Thu, 06 Oct 2022 01:50:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EhXQMpDq; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665046213; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BN1qgcneIZamI498WU8Yowkaq351QVKI+SVc/E0+skU=; b=EhXQMpDqkxPoufXMyOlyD0Im4NZRWb9mu6OHyAQfOV0aqTauiE8hZ67K+TuXwfyEnRSUPG oFdVkAaqw7DYEXPP8R+w+clIgeourMMlICeJyAHuVkMboAyNzjcrQyj4CgJRKIpGCWyLzn f38vcuGPMQdDMe2mlCSFeLuxY0+g62c= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-448-KpcJxLB8NmKsZAlJHB75eA-1; Thu, 06 Oct 2022 04:50:09 -0400 X-MC-Unique: KpcJxLB8NmKsZAlJHB75eA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 85E44296A629; Thu, 6 Oct 2022 08:50:09 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (unknown [10.39.192.206]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B7DD940B40C7; Thu, 6 Oct 2022 08:50:06 +0000 (UTC) Subject: Re: [PATCH v2 4/4] OvmfPkg/PciHotPlugInitDxe: reserve more mmio space To: Gerd Hoffmann Cc: devel@edk2.groups.io, Jordan Justen , Pawel Polawski , Jiewen Yao , Oliver Steffen , Ard Biesheuvel References: <20221004134728.55499-1-kraxel@redhat.com> <20221004134728.55499-5-kraxel@redhat.com> <6e33ffa4-4f06-c993-6ceb-474805e28cac@redhat.com> <20221005050156.y5vcmelhtnbwgcbt@sirius.home.kraxel.org> From: "Laszlo Ersek" Message-ID: <2af33afb-89b9-38e6-8343-7b0981729058@redhat.com> Date: Thu, 6 Oct 2022 10:50:03 +0200 MIME-Version: 1.0 In-Reply-To: <20221005050156.y5vcmelhtnbwgcbt@sirius.home.kraxel.org> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 10/05/22 07:01, Gerd Hoffmann wrote: > On Tue, Oct 04, 2022 at 05:57:46PM +0200, Laszlo Ersek wrote: >> On 10/04/22 15:47, Gerd Hoffmann wrote: >>> In case the 64-bit pci mmio window is larger than the default size >>> of 32G be generous and hand out larger chunks of address space for >>> prefetchable mmio bridge windows. > >>> + SetMmioPadding ( >>> + --FirstResource, >>> + TRUE, >>> + FALSE, >>> + (UINTN)HighBitSetRoundUp64 (RShiftU64 (Pci64Size, 8)) >>> + ); > >> Looks good to me, thanks; I'm just missing the rationale on the >> RShiftU64() call. Please elaborate. > > Cover letter explains this a bit. The idea is to scale things up with > the available address space. Patch #3 does that for the 64-bit pci mmio > window. This patch does the same for the bridge windows, leveraging the > patch #3 calculations by looking at PcdPciMmio64Size. The shift by 8 > assigns 1/256 of the total mmio window size to each bridge. > > The '8' is just pulled out of thin air. Looks reasonable to me, in case > it turns out it is not we can adjust that in the future. OK, starting with a 64GB aperture size, 256MB will be reserved per port / bridge. For this patch: Reviewed-by: Laszlo Ersek Laszlo