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.web08.10194.1631100844076634068 for ; Wed, 08 Sep 2021 04:34:04 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TY90R1Jc; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631100843; 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=/bk5OZG4OVjytoXt/T31BDQw/RqbRYr08Tmun038ssE=; b=TY90R1Jc55YhDbG8jTjbsqdsyaf+Us6mluBF8iDVxf6/V+ImWg//xmXAwMbodhX/YX7w37 JiwlU541zSJGj9yVDdG+L9BoZzzDMpE3qCZ24sw+iPE2RAK/c6X66Fp+iXsWJn/OBOSEOu NoROkiOKryR3A5Bt81WAIlE08Rxnnuw= 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-358-i50qBOXSMWOCl_piCd4xHA-1; Wed, 08 Sep 2021 07:33:58 -0400 X-MC-Unique: i50qBOXSMWOCl_piCd4xHA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1519E80196C; Wed, 8 Sep 2021 11:33:57 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8D23F5C1BB; Wed, 8 Sep 2021 11:33:53 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 442A018003AA; Wed, 8 Sep 2021 13:33:51 +0200 (CEST) Date: Wed, 8 Sep 2021 13:33:51 +0200 From: "Gerd Hoffmann" To: Leif Lindholm Cc: devel@edk2.groups.io, Jiewen Yao , =?utf-8?Q?Marc-Andr=C3=A9?= Lureau , Michael D Kinney , Andrew Fish , Jordan Justen , Julien Grall , Anthony Perard , Ard Biesheuvel , Stefan Berger Subject: Re: [PATCH v3 11/19] OvmfPkg/Microvm: PlatformPei/MemDetect tweaks Message-ID: <20210908113351.ken5secnrkot4dde@sirius.home.kraxel.org> References: <20210908090119.2378189-1-kraxel@redhat.com> <20210908090119.2378189-12-kraxel@redhat.com> <20210908110646.zuvhetarmi2bvszb@leviathan> MIME-Version: 1.0 In-Reply-To: <20210908110646.zuvhetarmi2bvszb@leviathan> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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 On Wed, Sep 08, 2021 at 12:06:46PM +0100, Leif Lindholm wrote: > On Wed, Sep 08, 2021 at 11:01:11 +0200, Gerd Hoffmann wrote: > > Skip host bridge setup on microvm. > > > > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3599 > > Signed-off-by: Gerd Hoffmann > > Acked-by: Jiewen Yao > > --- > > OvmfPkg/PlatformPei/MemDetect.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/OvmfPkg/PlatformPei/MemDetect.c b/OvmfPkg/PlatformPei/MemDetect.c > > index 2c2c4641ec8a..d736b85e0d90 100644 > > --- a/OvmfPkg/PlatformPei/MemDetect.c > > +++ b/OvmfPkg/PlatformPei/MemDetect.c > > @@ -135,6 +135,10 @@ QemuUc32BaseInitialization ( > > UINT32 LowerMemorySize; > > UINT32 Uc32Size; > > > > + if (mHostBridgeDevId == 0xffff /* microvm */) { > > + return; > > + } > > + > > This, and the same conditional in the subsequent patch, weirds me out > a bit. This doesn't tell us we're on microvm, it tells us the device > ID is invalid. Well, sort of, yes. microvm doesn't support pci config space access via 0xcf8, so any attempt to read something there returns 0xff > Since we know at compile-time that we want to skip this function, > could we achieve that some other way? Sure. Suggestions? Add a Pcd and set it in Microvm.dsc? Or is there some better way? thanks, Gerd