From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web10.159855.1673846472192204871 for ; Sun, 15 Jan 2023 21:21:12 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=Hse9GhFq; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: ray.ni@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673846472; x=1705382472; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=5Yu+lw2F2rnVWD1GKCidseSZtwKXyXNzwWop6KPG1lk=; b=Hse9GhFqKGJFt6dAj23cOTo7ksTpTABJpD8CBtjUd4XuhPyz+fo+aN/Y BpItrW6fVQ7RLZ0+FYjP039gJywGFrNVUOHn3yZcUcLcSZ5R/LgROADo6 Uvex9DQJVXtJfI5mASaACozxzvbo2h6ky71Rl0Z/kRiBlB4o8/KffR2LL Q3AbCe7aGtf0LvSOYENOGFOzDaa8MG8cJJreTcx5hHsD6E1CvshWWZht5 gkFmJW5m2fmpRfIp3mMsa/WDpLziCIdh42sq95pB5seCqdjxono6KbrRm vgU43IuAq5IC8XYNS417xV7rLkD/kNPj63JSAP1yYEsQ8lD6KDfWydrjI g==; X-IronPort-AV: E=McAfee;i="6500,9779,10591"; a="323089908" X-IronPort-AV: E=Sophos;i="5.97,220,1669104000"; d="scan'208";a="323089908" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jan 2023 21:21:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10591"; a="636429088" X-IronPort-AV: E=Sophos;i="5.97,220,1669104000"; d="scan'208";a="636429088" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga006.jf.intel.com with ESMTP; 15 Jan 2023 21:21:11 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Sun, 15 Jan 2023 21:21:10 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Sun, 15 Jan 2023 21:21:10 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Sun, 15 Jan 2023 21:21:10 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.174) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Sun, 15 Jan 2023 21:21:10 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kxCre7FWMDfaKXT3fvWrYEZu70Siyk9CIxSUmZ80wuCCnz3plDIWLLPglNOBmd/W0QtiKqTDau3LuJqY7uH7Kd7/nAqv6Zmc2wkH9894/wOv4dAxlHZd0GrmK0Qzp9An03yCv78fctVU5/uxCRjsflsZthvUrBlPK1oUwTUitzGrTemAX45d0KBpWpuWr5wDJVzsvlgG4OXrk7w0jAX4Tzr108m4AatkK+DVKAVKjEEtu0hkrSkP4fAkawbioNRNlhRIYCazCYL/8avVod5SxYAYjS51e4O5Ehf8YA2FPMvfSZi5Mwxpsn4+Z8WDHjTqVWybq5un95JDMgdLOiqoDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ceRav/ZTlohQSKrOzEQChY+BiVhJ7RpiIORdyt6GME4=; b=Vz1XCgRdbG2V2uHg5nsFX9/XnQ+3yEMoMguLiXttYk1mbi/zqRY111Q/hbL+vNRr0da044cGlhVUtoZ6s/67IIHEK+50Ek19ZD+Q//jXxsWVv3wAQ6eHulUA0NfPsitfoKAcyBWdk20ux9VYATxaRLwqsP1nIyrPvL5wocSbtANP0WCaXbig5obyviqSpBucwVRqnbQdsXQ43MD6gAfk6ay/ogzHPnb7UCoTXTWr9LiVBKNLnnwVHcDp/Qw+nqpFp876zMozeBDR9w9FIeUqEtVhLXpKrySyIJvUVTzqu814buWouV5RS1d/Oc6a6twr4B8XPh/beS1ZMMDFRbZuLA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from MN6PR11MB8244.namprd11.prod.outlook.com (2603:10b6:208:470::14) by CO6PR11MB5569.namprd11.prod.outlook.com (2603:10b6:303:139::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.22; Mon, 16 Jan 2023 05:21:08 +0000 Received: from MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::f890:e4ec:e2d8:5831]) by MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::f890:e4ec:e2d8:5831%3]) with mapi id 15.20.5986.023; Mon, 16 Jan 2023 05:21:08 +0000 From: "Ni, Ray" To: "Wu, Jiaxin" , "devel@edk2.groups.io" CC: "Dong, Eric" , "Zeng, Star" , Laszlo Ersek , Gerd Hoffmann , "Kumar, Rahul R" Subject: Re: [PATCH v2 2/4] UefiCpuPkg/PiSmmCpuDxeSmm: Consume SMM Base Hob for SmBase info Thread-Topic: [PATCH v2 2/4] UefiCpuPkg/PiSmmCpuDxeSmm: Consume SMM Base Hob for SmBase info Thread-Index: AQHZJ2QKHZr+rPC89ECnYhSOxrubNK6gSDZg Date: Mon, 16 Jan 2023 05:21:07 +0000 Message-ID: References: <20230113153045.13060-1-jiaxin.wu@intel.com> <20230113153045.13060-3-jiaxin.wu@intel.com> In-Reply-To: <20230113153045.13060-3-jiaxin.wu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN6PR11MB8244:EE_|CO6PR11MB5569:EE_ x-ms-office365-filtering-correlation-id: 2e4a887e-65bf-4e89-bdbc-08daf78178d9 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: qIJ9Rw95sER8aXVvZMC9URjlAKOrwt7zVc+wHeZgHHkeeF80RtEoyR6gZI9ncC6fGgHBNB+AkGchQ0LHl+gfw7EIFg7F+zj5WuCOT3jD+VqFF9tZqGgLMKCFUBLAF3YflmLexqbb9wxlrl+TqgtFROJeS31AAPiJq98/jMADQUs34jP0useL3wDeU56R3H33vi8I+u/U52QBIEyyEAhBK9l9ieu94ucccvpDy2YapZ9llz7yO5R2zx3v47VsLhSaGRbbLIAJW8BNmm/w4Kg1Po2ERRAN1cMIreZYoaRV3dg0Jqh2Jf/SsDvGK90kyoTLshdJR85IDysrgiUCm+9FDvg7KOHdlMYS44YrK5KtWHvkrL9WsS3WIdqWYrgY5bJ6EEvhgYqqmc8+iizlORWMewUvF8O1UQPD4T188YHh1Zyd/W1TaJi+vpIvhKrkptF6d8gJwX87W8jN5AaiBiplYScY+pbxV4z91lu1GQLHrJqtSk+zj3vAWJ4JhFgEgziwOHhayyCR/0HpvH39nqZHQAZ61lD8ILufIhbjkr9v8EASTfo/MXu+pGH0Tz2wuAuol4s0l5Ev4hzYADB8J3uAfv7uwfufpJxUFMlbDMN2akIFUXFRYWB8Y98oHnlLWGkyoKUSoNCo5aHiVQuMrLjc7lpgIlXvsx8B3PI5XFwdqCecrPBvtofYkQ30W76F9BN8hW7u9ooT5JaJOYr3gANlyA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN6PR11MB8244.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(6029001)(39860400002)(376002)(136003)(396003)(346002)(366004)(451199015)(33656002)(76116006)(66556008)(41300700001)(66476007)(66446008)(66946007)(186003)(26005)(9686003)(8676002)(64756008)(4326008)(86362001)(83380400001)(5660300002)(82960400001)(52536014)(8936002)(55016003)(107886003)(54906003)(110136005)(478600001)(71200400001)(6506007)(7696005)(316002)(38100700002)(2906002)(38070700005)(122000001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?p9sKNQWu766e6qH3N/FlLO1Y1twz6iqGLQDaNg+h5p/i8XZ0rG0HylKB8SbY?= =?us-ascii?Q?sc96ZAAVToETMcMMNlkA8ne/sssci2QBwElBGXxJUJPIpvNSZ15W81Jrvdt/?= =?us-ascii?Q?WelpTGzPLGZnO5iXTj37Osa3R0TlReohwDUgBoJly/yljTgAagIjFe5lb+6G?= =?us-ascii?Q?IN3iEsKYqvZZRRfSF8xp7HF2G7RDM2ntTuernGA4zjl1Frr6v1oH6XlHCm9n?= =?us-ascii?Q?K9Wk4uOsCssq/t4fgyKtB0XB94+VptJdjXfhQGzIiUn7zxW0DDW8IZPMZjqc?= =?us-ascii?Q?7X48pP/zlM6dkrm/EJPHrPDF5eLcPy6n+0j2xT3LV8WzKu8l0MduN0HXezQg?= =?us-ascii?Q?WM2214mAQS/YDWqYzE04rZbprpm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ascii?Q?J8DJICF4Ge0GHyvtZ7FUzqMqsWjlo66fVPKYtfnrqKtrKxvBO+1Wz9wp8e4o?= =?us-ascii?Q?m8s9g8G6JKkiLmnGwKNWH14JbImaJMPVDoumMmwF5tXtOGZ3Qh+KwYwg0JQS?= =?us-ascii?Q?4jhgQH1yPFMk2OMCY61kLR/chzSXaRXmxAqtE8BDjap5XqkdR933+dtNKPJC?= =?us-ascii?Q?luprKJ3UWEToSPTOsmBk2kKbqnnhNWzBLFcumhSilVewaMj5KGLAJbGQuwQf?= =?us-ascii?Q?NDy/zOV27FnJtxfksnntUftERxL8jqF5gGhVVMNC7ikdA7U8hAjlMpGLqC+L?= =?us-ascii?Q?KY8ksRqSE7VAN4ZLF9E=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN6PR11MB8244.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2e4a887e-65bf-4e89-bdbc-08daf78178d9 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Jan 2023 05:21:07.6099 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 6WBoJbRtY8gDXDJRxjWpby9PX8/F1fJ1MDc1EZiEzzyjc67QEek4aKaf4WhgDMJnKj7nZPoK+cAMkRBxUG2R0Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR11MB5569 Return-Path: ray.ni@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > // > - SmmRelocateBases (); > + mSmmRelocated =3D (BOOLEAN)(GetFirstGuidHob (&gSmmBaseHobGuid) !=3D NU= LL); Do we support the case when the HOB is produced in normal boot but is not i= n S3 boot? To keep code flow simple and not to support unnecessary configuration combi= nations, I prefer no. Then, since mSmmRelocated is initialized in normal boot already. How about = only adding check here to make sure the HOB existence status is the same between normal= and s3 boot. This also helps to catch platform bugs that the HOB is only produced in nor= mal boot. ASSERT (mSmmRelocated =3D=3D (BOOLEAN)(GetFirstGuidHob (&gSmmBaseHobGuid) != =3D NULL)); If (mSmmRelocated !=3D (BOOLEAN)(GetFirstGuidHob (&gSmmBaseHobGuid) !=3D NU= LL)) { DEBUG (( DEBUG_ERROR, "SmmBase HOB %a produced in normal boot but %a in S3 boot", mSmmRelocated ? "is" : "is not", mSmmRelocated ? "is not" : "is" )); CpuDeadLoop (); } >=20 > /** > - Initialize PackageBsp Info. Processor specified by mPackageFirstThread= Index[PackageIndex] > - will do the package-scope register programming. Set default CpuIndex t= o (UINT32)-1, which > - means not specified yet. > + Initialize mPackageFirstThreadIndex Info. Processor specified by mPack= ageFirstThreadIndex[PackageIndex] > + will do the package-scope register programming. Set default CpuIndex t= o (UINT32)-1, which means not > + specified yet. The comments update is good. Can you separate in another patch? > - if (mIsBsp) { > + } else if (IsBsp) { I agree with this change. But it changes the old logic. Old logic calls below function even in non-S3 path. If we want to change the behavior, can we separate in a new patch? > +VOID > +EFIAPI > +ExecuteFirstSmiInit ( Can you remove the EFIAPI?