From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by mx.groups.io with SMTP id smtpd.web12.10387.1631102059666963543 for ; Wed, 08 Sep 2021 04:54:20 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=m9qYpgZp; spf=pass (domain: nuviainc.com, ip: 209.85.221.42, mailfrom: leif@nuviainc.com) Received: by mail-wr1-f42.google.com with SMTP id b6so2837943wrh.10 for ; Wed, 08 Sep 2021 04:54:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=qrS4CcZbzqHhCjXV43KRzOtC4dWL5drd1aFZfBp84iI=; b=m9qYpgZpOT5ap3YDI3QOyJEt8lqYyPsiceH2RyWfdZge4adlC6lGsciHqPduZQ6iil BYOQSY0PmaqkBs2BltTFZoh/HlMlRYKW3xyH15J6o0jvxepeRj7NJx+l5JazydSvv52n jCchMvvOCW52TYWTkwFzWEKkKQADHDulbIZ7RI2aKQN/Wq1LRweneq1SAraVkyOc9w4S dpimFb7IBQj0M6X9s4wp3r7qP+giqmcQCepCte/56UCdUZynkMEJTTcMjbyvXxoCZ6ap gdw614Kqbf7tPTWw/WRvTSufnBy9YoMYiJaYw67ghGjFfALqqBZXsqKmsNH1vjufMXis PlXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=qrS4CcZbzqHhCjXV43KRzOtC4dWL5drd1aFZfBp84iI=; b=cVABJ9BRYDc7pNThbPsjiwx38ms3i5w/G59ki98rwO58vgBq3aroVhRqB+g7xht+Fu 1ZDAmr/a87u6pwzKeGh0I77GyQ9moJ5dw1HUQojEplW3jV/Ji6cW8suEzh6VwX+P7D10 3vfyR0ADDUCD13gy50wDqcllnSDeyIRVbLdOiJmVKwq9Bb7tFhSGBGUmbgdf5+S2bb1w GUiw2RLgDyKd3HjSIiAw30YoNi35YgtyjXF2iCHpPf5oYVAucMGWbZ8Outm/Oz3yM039 51gSdXQBpVSWoP/4XZogQAMgaDS6iYLy/WKkcMU1M/DfMwHjraZI9rbKkX/7E7lvLcw8 pBlw== X-Gm-Message-State: AOAM531IRxhNHRNs4L/MwMD0Kn9YShJumq9xhaSYjhsG98UWfTMs7t/P TghbAP0ln9PXDI2k/eXue1G1dw== X-Google-Smtp-Source: ABdhPJzgGyEhGaSsrpkTfyzeqX920MGL7Lx67NHCGPcpEsEWFtm+FdY1lnuXfoSE2TPMUPl7tXJQbw== X-Received: by 2002:a05:6000:128f:: with SMTP id f15mr3592979wrx.262.1631102058155; Wed, 08 Sep 2021 04:54:18 -0700 (PDT) Return-Path: Received: from leviathan (cpc92314-cmbg19-2-0-cust559.5-4.cable.virginm.net. [82.11.186.48]) by smtp.gmail.com with ESMTPSA id b24sm1789273wmj.43.2021.09.08.04.54.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Sep 2021 04:54:17 -0700 (PDT) Date: Wed, 8 Sep 2021 12:54:15 +0100 From: "Leif Lindholm" To: Gerd Hoffmann 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: <20210908115415.457jrctnokke3n6u@leviathan> References: <20210908090119.2378189-1-kraxel@redhat.com> <20210908090119.2378189-12-kraxel@redhat.com> <20210908110646.zuvhetarmi2bvszb@leviathan> <20210908113351.ken5secnrkot4dde@sirius.home.kraxel.org> MIME-Version: 1.0 In-Reply-To: <20210908113351.ken5secnrkot4dde@sirius.home.kraxel.org> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Sep 08, 2021 at 13:33:51 +0200, Gerd Hoffmann wrote: > 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? It's all a question of how much we want to overengineer things :) I'm tempted to suggest a balanced version would be adding GCC: *_*_*_CC_FLAGS = -D PLATFORM_IS_MICROVM to [BuildOptions] in the .dsc, and test for that. FixedPcds might be architecturally nicer, but should then probably be a different one for each use-case. / Leif