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.129.124]) by mx.groups.io with SMTP id smtpd.web11.7383.1647938121146378035 for ; Tue, 22 Mar 2022 01:35:21 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SeoA0P6X; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647938120; 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=Dbv+Us68QNEilOwbh5dLCwKZPq2iZcjvxqyqJnRrToY=; b=SeoA0P6XVAKYkJFqR/SxRH015A3U0eBOAsY9WAItuEkzVBbM42btqJue1+gTULd0FCAtys Gid8/5kJm31xzrfC3jz44ArTSr3Le/ChDq43SYsfND66XObbkL2ENOT/KMpWvNRdHZmxav SvzIsQrjHTwO8hkn6qKPlaYZBms5pVY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-149-gu_YKrWQPbydlOe2dkcnUg-1; Tue, 22 Mar 2022 04:35:14 -0400 X-MC-Unique: gu_YKrWQPbydlOe2dkcnUg-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 0DAF7801585; Tue, 22 Mar 2022 08:35:14 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.196.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B62D140D0161; Tue, 22 Mar 2022 08:35:13 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 6292B180062E; Tue, 22 Mar 2022 09:35:12 +0100 (CET) Date: Tue, 22 Mar 2022 09:35:12 +0100 From: "Gerd Hoffmann" To: Min Xu Cc: devel@edk2.groups.io, Ard Biesheuvel , Jordan Justen , Brijesh Singh , Erdem Aktas , James Bottomley , Jiewen Yao , Tom Lendacky , Sebastien Boeuf Subject: Re: [PATCH V9 19/47] OvmfPkg/PlatformPei: Move global variables to PlatformInfoHob Message-ID: <20220322083512.bw6tvxk7ericnqhc@sirius.home.kraxel.org> References: MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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 Fri, Mar 18, 2022 at 08:45:37AM +0800, Min Xu wrote: > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3863 > > The intention of PlatformInitLib is to extract the common function used > in OvmfPkg/PlatformPei. This lib will be used not only in PEI phase but > also in SEC phase. SEC phase cannot use global variables between > different functions. So PlatformInfoHob is created to hold the > informations shared between functions. For example, HostBridgeDevId > corespond to mHostBridgeDevId in PlatformPei. > > In this patch we will first move below global variables to > PlatformInfoHob. > - mBootMode > - mS3Supported > - mPhysMemAddressWidth > - mMaxCpuCount > - mHostBridgeDevId > - mQ35SmramAtDefaultSmbase > - mQemuUc32Base > - mS3AcpiReservedMemorySize > - mS3AcpiReservedMemoryBase > > PlatformInfoHob also holds other information, for example, > PciIoBase / PciIoSize. This is because in SEC phase, PcdSetxxx > doesn't work. So we will restruct the functions which set PCDs > into two, one for PlatformInfoLib, one for PlatformPei. > > So in this patch we first move global variables and PCDs to > PlatformInfoHob. All the changes are in OvmfPkg/PlatformPei. > > Cc: Ard Biesheuvel > Cc: Jordan Justen > Cc: Brijesh Singh > Cc: Erdem Aktas > Cc: James Bottomley > Cc: Jiewen Yao > Cc: Tom Lendacky > Cc: Gerd Hoffmann > Cc: Sebastien Boeuf > Signed-off-by: Min Xu Acked-by: Gerd Hoffmann