From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web10.11505.1674971230179366175 for ; Sat, 28 Jan 2023 21:47:10 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=CNVDY9Xx; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: jiaxin.wu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674971230; x=1706507230; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=ynRYBMjrg1bL2HG7vWjOHQjASHsU9d9CMoO8ZNNNecA=; b=CNVDY9XxqNEre0nRrxQu34eZr1ldlIIrNcQ3L7Lci8OwUwYcHIfTl0YH YklAQyPB3qMcZztvMvGH5f7Rqi/HHONzfWy8FBTg9FTmH1CX8HG/iPxmX LMe6RUIQx7tCvuegtJPS5dVu5GplQXAioOLMv9H7OVAWwHodGe2RuXiBn JFaFqtBloXBNDmUwGrOdl3cLsUKHwkEaHKiATof1z1Ikt0CcBKpEnxf8G 2fObzLGQLN2qKPolLVcO0cMwpQwgxCwf0/642QmTmzGsw90eORU1JPjGq hVBVMsX6jCd8dKf3zBh3/RHcScAEMwPzVyWRZEJ7fBi2ne8mpakDM0CAd Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10604"; a="354678314" X-IronPort-AV: E=Sophos;i="5.97,254,1669104000"; d="scan'208";a="354678314" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jan 2023 21:47:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10604"; a="641174424" X-IronPort-AV: E=Sophos;i="5.97,254,1669104000"; d="scan'208";a="641174424" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga006.jf.intel.com with ESMTP; 28 Jan 2023 21:47:09 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Sat, 28 Jan 2023 21:47:09 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Sat, 28 Jan 2023 21:47:08 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Sat, 28 Jan 2023 21:47:08 -0800 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.40) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Sat, 28 Jan 2023 21:47:08 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SSK872K1s+SvymLQecLpKbd4TW5qANVwrYNmyMuvG09nC7/ESSaj8di48wC6zfSD/Jk3oQkdo0/Bdf3BtdMACStXhodl5GdHlvP5S9bz0fDHqOGHkrlTzyY2AyEiyUVfNNj6egCS0CcSlVr4+6jgrvcwhcP879u9BhtFNQj1PWiFGVhhozTt05688Ta0QdNPLw9nReBP4KvgFclLOury/uQhAGcHsyPd4x2J0Y+2kqxwiaGdHhfSQkdegW9p6AsnUKP09FgirrhgUryhyFjstt84Orf8w16u/ghLXvFF73zOdguqt+v5LkkLgF0u5uzfPZNqpJ1hmCmOMaj3ylhluw== 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=+LceJ+V1QhVZPFycWGzzD9miI6kWTTsBqhAAi6Imadc=; b=m1rOMyq5kVyqeMyk2NxKbYZGrcHePa+C+uOVDSLp07fRiFaM2dKh0ut9yYfpZfZi+UsRU8MH5OPiKym7pDm9lZIfQfAqab3XB+Rknyy2UKuamCY9wugumWh6LWnq3tPBpA6N/eQZYbZqgT2dJUKuicqL5pIWvY3GK+PZWcuoqDnKwpiRs3vMjRyX3y2U4WdrTb0P1fD2okJ/59QhtXV8yx8rqFHt5Xzeb0K6hIHNl+t1MvZbAWF+VGP9SNo8MnNYo73u98fYgu3+ei9bEucTCnPMMyU05VuBy2xcnD0nrE7IyNgD7zX+SHznkslyA+I36YFwkdXCW5iIXHGHJ4OdJA== 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 MN0PR11MB6158.namprd11.prod.outlook.com (2603:10b6:208:3ca::18) by DS0PR11MB7630.namprd11.prod.outlook.com (2603:10b6:8:149::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.30; Sun, 29 Jan 2023 05:47:01 +0000 Received: from MN0PR11MB6158.namprd11.prod.outlook.com ([fe80::e5d9:d16e:172b:aa01]) by MN0PR11MB6158.namprd11.prod.outlook.com ([fe80::e5d9:d16e:172b:aa01%3]) with mapi id 15.20.6043.030; Sun, 29 Jan 2023 05:47:01 +0000 From: "Wu, Jiaxin" To: Gerd Hoffmann , "Ni, Ray" CC: "devel@edk2.groups.io" , "Dong, Eric" , "Zeng, Star" , Laszlo Ersek , "Kumar, Rahul R" Subject: Re: [PATCH v3 5/5] OvmfPkg/SmmCpuFeaturesLib: Skip SMBASE configuration Thread-Topic: [PATCH v3 5/5] OvmfPkg/SmmCpuFeaturesLib: Skip SMBASE configuration Thread-Index: AQHZKzdA9HccjY1A/kmC90tX3dYbUK6kPkSAgAEha4CAD46lQA== Date: Sun, 29 Jan 2023 05:47:00 +0000 Message-ID: References: <20230118095620.9860-1-jiaxin.wu@intel.com> <20230118095620.9860-6-jiaxin.wu@intel.com> <20230118121958.cxbfh3fljedvebis@sirius.home.kraxel.org> <20230119075303.nkyno36h25xscwkn@sirius.home.kraxel.org> In-Reply-To: <20230119075303.nkyno36h25xscwkn@sirius.home.kraxel.org> Accept-Language: zh-CN, 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: MN0PR11MB6158:EE_|DS0PR11MB7630:EE_ x-ms-office365-filtering-correlation-id: 59774a1a-7cc5-4fea-0f5b-08db01bc3e0d x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: I9Gm8CFKuuXQmT/HHjkvo5gQ7ME1Jv8sqWsqUw/fffx5e12wVL9JRR5eS8GCwptvch01qL6QXW3wHvmUUItDHJVb4dV0JJqMkzF+gVsR4H4BbMcqk/pyQTIueqrHll3tVlE7MCZQufbvc0HWDw2xjSyKWn/3sZLoooYQR2P1jZxNlQFmlodWSgjD3WUSKymsyWu9YRttF/8LCFHaR2kjf76b1xzV4vmPxiYGi6Zh9SjbkQ6e4ri9kGZT7BinoRAv5Ap2glYqQ1wUL6wYEmyOA0J7cTT17vmjnDiATuxVCbkOlRae9dlBDm+71pKb6nesgbfLz9fyIgAJwOBzMeF0DYJkb60rn//Gh0/dD5Hu9THDrw2Erp8TEi4HJG/8JXxyZktqc+UC+GioXcUGgRySxFo+5FfScNYdBbnJbCCl7+DN0Nl1f8dgan8CDKyb3piurf+x9OmijVZf6mg8GuO70auMM5TqhvNIKsVrdpLO1cZhmZz7QG+2+sOvpuOHhhUXHNJ6oOtWBylXD+YdgHET6pHAKyrFqCB2JbXtxtW74dFdKEe45i5clbiow4oZzu6d2n/ISvm1n4aSI5FpMEZrQpjKlxtP8ZGHhsZaom+TiqnB2TnF6XTXUJB6TOPAlKxxBxFjJ2CMP2o3hD8E/2LtnP1TvWv6VKbP3tGuVFd8QkL6y7uDs2QMao6SRc6ZzrvMPsGWNnTR5AoFOO+C12Djsw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN0PR11MB6158.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(39860400002)(376002)(366004)(136003)(396003)(346002)(451199018)(8936002)(41300700001)(86362001)(55016003)(122000001)(38100700002)(38070700005)(82960400001)(316002)(8676002)(110136005)(54906003)(6636002)(4326008)(66556008)(66476007)(66446008)(66946007)(76116006)(6506007)(107886003)(64756008)(186003)(9686003)(26005)(71200400001)(7696005)(33656002)(478600001)(2906002)(52536014)(5660300002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?bSOoFQ3E5u2zEfoPvtT4w4j83AkYSvn8X+UGeDweqj5+muh5Gtpku4WNvDUB?= =?us-ascii?Q?l0IFlo0OSkoVu6TMwei2raDaEbMBTO5OnN1h2+pJTXThzmBN8wVKI6a2L6aT?= =?us-ascii?Q?tRZIcXuEGXSKK4PtKNxZ+5fEg9ts1w4Tj7yOV/H5GzUVfoY02LRMY541zJad?= =?us-ascii?Q?e/RWY5rzdUKmAryTs/ZDm0r1kg+5pEzT4hk7wvOed8gjzBFLVCBlDfLB1xTX?= =?us-ascii?Q?8uXoN0oCujnBNBNsYNPDoSKD3GcA1oIafCXsoTf40m/XSuKGHxryXlzocUBG?= =?us-ascii?Q?iy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YUL9fR?= =?us-ascii?Q?H2e5AJPPzsEEaEvIUMpliO+RfmHb+RrNvaNA2OxkeB2sOGvvnfwrU1urV01P?= =?us-ascii?Q?7KeV6W00aakpd5QrJrY0piezK3UOgbCdblednkNa1b8suN0axOH9rIxuGw/v?= =?us-ascii?Q?hucQUBco7OG7F/GHFieyLteULrQhq5aP/3Q0q1IY7Nz41PJEx9koN0ABTa/j?= =?us-ascii?Q?6dAxoFq48lyqGKdakCDS8gj8nU6OSjEc2uuMlx6dhw1mfZXQZYYL5hP4a41T?= =?us-ascii?Q?WCNnxDARTsENQEUZ3krEuE+MZY06K+pmUBZiokU2YhxyANqHPsIpKKv4zSao?= =?us-ascii?Q?M6hTf/Ozj4Eg0gy9hViO+b59DQzpHNGsgyYYCTTGO1jZdV3SwAtyVWYyFOUd?= =?us-ascii?Q?q7R6e5SNEJrQxDEtruT71K1nxfm9YzzqX/z7pOzo?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN0PR11MB6158.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 59774a1a-7cc5-4fea-0f5b-08db01bc3e0d X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Jan 2023 05:47:00.9422 (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: oM4TsbOBsO5sQjpc9FNHOtwERGPKbfvyny3G40pu6NpIvqSBSisARI4zopz1a8IGchGoa/IBSqY/bq7xlfCy8g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB7630 Return-Path: jiaxin.wu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable >=20 > * Why do you want do it in PEI instead? The cover letter claims this > improves boot performance. I don't buy that. You are not skipping > the relocation process, you are just doing it somewhere else. I clarified why it can improves boot performance, it's not just do somewher= e else, but also each cpus smbase can be programmed in parallel. See [PATCH= v3 3/5] UefiCpuPkg/PiSmmCpuDxeSmm: Consume SMM Base Hob for SmBase info: "> With SMM Base Hob, PiSmmCpuDxeSmm does not need the RSM > instruction to reload the SMBASE register with the new allocated > SMBASE each time when it exits SMM. SMBASE Register for each See existing code smm cpu driver implementation: =20 // // Hook return after RSM to set SMM re-based flag // SemaphoreHook (Index, &mRebased[Index]); With above Semaphore hook, SMM CPU init for each processor must do one by o= ne to avoid the CPUs over-writing each other's SMM Save State Area. As you = mentioned, if system has thousands of cores, early smm init in parallel has= the advantage over existing serial lines. =20 > processors have already been programmed and all SMBASE address > have recorded in SMM Base Hob. So the same default SMBASE Address > (0x30000) will not be used, thus the CPUs over-writing each > other's SMM Save State Area will not happen in PiSmmCpuDxeSmm > driver. This way makes the first SMI init can be executed in > parallel and save boot time on multi-core system." > * Where is the code? See the design of existing function: SemaphoreHook (Index, &mRebased[Index]= );=20 > * It is totally unclear whenever it is possible and/or useful to > initialize SMM that way on OVMF. >=20 Add the same handing logic code in OVMF is necessary to make sure it work. = If someone produced such hob in OVMF platform, and OVMF also use the same P= i smm cpu driver, then it will be a problem. Changes in OVMF is make sure i= t runs into right way. > take care, > Gerd