From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web11.82904.1673605147181043310 for ; Fri, 13 Jan 2023 02:19:07 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=Htwf8c/j; spf=pass (domain: intel.com, ip: 192.55.52.115, 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=1673605147; x=1705141147; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=9OKnp6Bwbby3AzZ7EaHOOKiIyDyd8YaB6M7L9XNQnPg=; b=Htwf8c/jDFx1qAddcSMvdiTdf3n1C/WWUQ5pRvYAF6y5NNdMOEp/+UVq 1LWyN/nhj1lkr2dr4MSoMmPUlBgv4lqSRaAsKbE+RsR966cYsxLuCZoJC GltqlWJdTOiBrPrmZYQN7FHt6rtRvS1tY2i9vLWLDcV+uqnmzNjTZCVwZ 3jkWx4FF8JhoKbJCQeLN7yGd/P863cJOrL2zBtfSlQ3ppBbIqxr2szL+P cadEhbRPDh28JBDwFHagPclY20WbUxQDVXVuxwm8O+6m/MbqcLVQ8s4ax UHYJgAgOaVMA2yUlxmHLtBAbUU7CCWluV47bbSNeksBbuWlO45UEPCXle g==; X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="324023741" X-IronPort-AV: E=Sophos;i="5.97,213,1669104000"; d="scan'208";a="324023741" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2023 02:19:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="903536141" X-IronPort-AV: E=Sophos;i="5.97,213,1669104000"; d="scan'208";a="903536141" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga006.fm.intel.com with ESMTP; 13 Jan 2023 02:19:02 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) 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; Fri, 13 Jan 2023 02:19:01 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) 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; Fri, 13 Jan 2023 02:19:01 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.168) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Fri, 13 Jan 2023 02:19:01 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MbaLk/iKqAJwnwEZKBXS36O2+OID9xK7WZP7MmRMRK31JPf3fpj9D0t0TLY/OxOKzrMV5rVrslM/tgkhY0R5+QGuXSo/GI8JIG9kMobpyT96vW3KFDoc9NZ9xYE14GoJ2ILrpx+JDNecI+b1T8GdUl0m6t1oj8FB4bsSAwsD+hE46i7LBuWrULumJoRp0F5WDddZlEv3OU3v9hoZixvBxlVrQo60OSz3rh/x0kU/CWwTYhM6Qm0wIotPanXDFmnERRBGOs9jfOXTRAIwvMqnd9xS3ykXPOKygk3Zp03KEad1aU4c5QEzhzAj9vbOuZEVKoULS9fhgW4Aw2+6Pu04LQ== 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=Nf4ZRzCKCDU22TeOSXJzcbqG1kcnUnXG+YaJy0we7DA=; b=Dh5+7CEk6yEHNDkMsceOwTpfk08Fli63kA0lHsZHIKN51IjyN398STFuB6/JuuhfmEMk8qAQOTbuvhZTqsJz5CiGVyFg+5snmKxEk5LUnzM6GmpF6f22qzOG7vFRdkm7hC3T6kXgfHQrQ03ru30W2ROp2gWvwMRgr9+UfxyJMrrLeoaYPmx5S92LM6/0iP2akpjkvlWQIGvgNqtY6/98hJUvBO2ireGmnNSPvjbzS3pjLnjJ0g4VUM1DHSejFkEOzGQA469Ybf+O2tRfmInXmEigDFFf00e8lC3sRQKV6J7w9YGLIB6CaeBkKCueVj7gvRTiyN5cCcD/zDPIP3Y1eQ== 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 BN9PR11MB5548.namprd11.prod.outlook.com (2603:10b6:408:105::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13; Fri, 13 Jan 2023 10:18:59 +0000 Received: from MN0PR11MB6158.namprd11.prod.outlook.com ([fe80::e5d9:d16e:172b:aa01]) by MN0PR11MB6158.namprd11.prod.outlook.com ([fe80::e5d9:d16e:172b:aa01%4]) with mapi id 15.20.5986.018; Fri, 13 Jan 2023 10:18:59 +0000 From: "Wu, Jiaxin" To: Gerd Hoffmann , "devel@edk2.groups.io" Subject: Re: [edk2-devel] [PATCH v1 0/4] Support SMM Relocated SmBase handling Thread-Topic: [edk2-devel] [PATCH v1 0/4] Support SMM Relocated SmBase handling Thread-Index: AQHZJzRrBxJHUzinVEWXc1C9ELU+8q6cIEKw Date: Fri, 13 Jan 2023 10:18:59 +0000 Message-ID: References: <20230113071738.15868-1-jiaxin.wu@intel.com> <20230113094954.lc73fbwz67mrfbve@sirius.home.kraxel.org> In-Reply-To: <20230113094954.lc73fbwz67mrfbve@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_|BN9PR11MB5548:EE_ x-ms-office365-filtering-correlation-id: 1997b3df-5ee2-4602-0aff-08daf54f95fc x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: URTFEovaWyC+WYzNAKqF/nPaT+tYGI7H+xk09qJglzFaizxWhtWtoUWNDp7CioM7fXlfpV9WHjNVcf4w2dT7SjHf0Xe/Wc48xSU3hcJyJekQNHRRjExFCdyL2qMvnvHQIAA4ek01+kd89xMJB2LhSzKfgumSb53VmD1opxfbM8ZyJlHXeZQ9qzYlHtMXVwRXof2j7KyoF8rDESNeoxvzWnQlnSbUSd3dExy4352DTFgWjd8SjLl7CyjvTxEWOITck/5+lAGaor2KVgTIyEawQXKR7IyT0j/02ciqo03eO0CxyVoNgzk72fCsoShW5SgWQ+AkHjkTt4kF83VnHAYBqsjqI81JNdIN1c0h6iPfUajjDsWUK9Qi9ba2eQRFhtlZsZJCiLzh57FHrCvm+GvJmvwe8iipjsCQHY59m1ykj+i8aNO8NnhAwzJORU/H8mIGJJD5dHV2uUXb4pdBh9g6JPyrSWdZe2BwrOEerCPnAi21OpUgJI2WrTyz4uUVc1GAiBmO6FJ0x9juawhgSiT136fOa96IDFBzOXGCavI3/LlMKMAn8U7uZnfE3Tdn86ORDExAWWFSyYbJLUkIeehNHVeEpASYXFpdeyQ+/opYd9xDwruspYjRRPWcSm4XZN6mJPzjSW4tVIcx+f2L1WgMG+Re0RgIKEr8km7uHr+haiALu12RzVFPJoEJE9qQ19TCVvnGi038culC6X741diCSv0k7T8LlH5sQX5FjiOBkrw= 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:(13230022)(6029001)(376002)(366004)(396003)(39860400002)(346002)(136003)(451199015)(9686003)(478600001)(82960400001)(966005)(41300700001)(38070700005)(33656002)(38100700002)(316002)(110136005)(86362001)(66556008)(71200400001)(26005)(66946007)(55016003)(66476007)(186003)(7696005)(76116006)(5660300002)(53546011)(6506007)(2906002)(83380400001)(8676002)(66446008)(64756008)(8936002)(52536014)(122000001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?OHag3VnNF6rZPyJOlrSabKFuAU4Ck3AYl6yZqPpAMqqxTASRDQANPPZ2YYTE?= =?us-ascii?Q?fZRBq2bcwCCnLzyAG7CluwaH7nah70UE/a+o8Ai5Mhp2ct09FrnvFOLK0jxD?= =?us-ascii?Q?iMrX1gYvMUpiuQtPFE0GMCDHupdDzfpE2JqOJ+LKYZdtyM1SuYRuav6UPsdF?= =?us-ascii?Q?dQNrZ1w4mgXBpMZ7d1c5XH/PSOrXaPVOThwA90wybIlZpQckRHEnYh6XsKVP?= =?us-ascii?Q?JlmNv1Jb6xOFxaif1koiS5A2oILWwTTberz/nIA9eLbO5XlKkzqhDAB4N7vD?= =?us-ascii?Q?cLqEHoWWKlJ7BPGsQU9ZZxDVq7VYiLIwVSYz+3gIJVFY896e3Vg94PNOno+u?= =?us-ascii?Q?xFX9LAZMAE9KGj9PQfIr02A0Tj1j8iWwTQkddTO+IIM49A82tNg+TlFzdwun?= =?us-ascii?Q?0kniZHFGikA5HNublLFxzmKV42dftT0y0USQCNpNBIfCEPRxvx0L4UAu68Ru?= =?us-ascii?Q?9/FmgiZncK1HiKjxJ7YWLP3azQ8GgNxK+13GJP7iTxWAbbMf3qS7H1AoxGFU?= =?us-ascii?Q?T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qdcgJvtqnWgOsUW?= =?us-ascii?Q?BSCx+f2GzT3tQlvtZKKNRvuZSRyYpUk7qMRF829cJIENkNnQt9gPgymcCAzU?= =?us-ascii?Q?lgrVhNvyLogUwOuEnCdPjrnyaZ50LM7kK0JT/BREW2UxymbjWRCZn7iNhFYT?= =?us-ascii?Q?XeXENAEBHFtV8LcSKQolS3ya+W3F+33PFlEUHi5n?= 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: 1997b3df-5ee2-4602-0aff-08daf54f95fc X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jan 2023 10:18:59.3578 (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: gk9hUYXQSjboxQgujL9HEUCW1d0ndkzvvXe+7MQ70z2E1/ufZUoTw6In2127QKFz1LV78IOZfyTFULRrKknYAw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR11MB5548 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 Thanks Comments Gerd, I will resolve the CI check issue (I have noticed tha= t in https://github.com/tianocore/edk2/pull/3884) & refine the usage descri= ption in next version. Anyway, Ray also helped explain the usage as below, I will integrate it in = the hob definition .h file, help below can help understand the design.: The default SMBASE for the x86 processor is 0x30000. When SMI happens, CPU = runs the SMI handler at SMBASE+0x8000. Also, the SMM save state area is within SMBAS= E+0x10000. One of the SMM initialization from CPU perspective is to program the new SM= BASE (in TSEG range) for each CPU thread. When the SMBASE update happens in a PEI module, the PE= I module shall produce the SMM_BASE_HOB in HOB database which tells the PiSmmCpuDxeSmm dri= ver which runs at a later phase about the new SMBASE for each CPU thread. PiSmmCpuDxeSmm d= river installs the SMI handler at the SMM_BASE_HOB.SmBase[Index]+0x8000 for CPU thread Ind= ex. When the HOB doesn't exist, PiSmmCpuDxeSmm driver shall program the new SMB= ASE itself. I also explain the in the patch 2 for PiSmmCpuDxeSmm changes: SMM CPU driver will retrieve the SMBASE addresses from SMM Base Hob and installs the SMI handler at [SMBASE+8000h] for each processor instead of relocating SMM Base addresses from SMRAM again. With SMM Base Hob, SMM CPU driver does not need the RSM instruction to reload the SMBASE register with the new allocated value in SMBASE field each time it exits SMM. SMBASE Register for each processors have already been programmed in parallel since the same default SMBASE Address(0x30000) is not used, thus the CPUs over-writing each other's SMM Save State Area will not happen. This way will save boot time on multi-core system =20 thanks, Jiaxin=20 > -----Original Message----- > From: Gerd Hoffmann > Sent: Friday, January 13, 2023 5:50 PM > To: devel@edk2.groups.io; Wu, Jiaxin > Subject: Re: [edk2-devel] [PATCH v1 0/4] Support SMM Relocated SmBase > handling >=20 > On Fri, Jan 13, 2023 at 03:17:34PM +0800, Wu, Jiaxin wrote: > > Below serial patches are to support the SMM Relocated SmBase handling. > > To achieve, new hob interface is procuded, and will be consumed by SMM > > CPU driver & SmmCpuFeaturesLib to do SmBase initialization: >=20 > Who produces that HOB? I see only consumers in this patch series. >=20 > The patch series doesn't even pass BaseTools/Scripts/PatchCheck.py, > it will surely not pass CI. >=20 > > With SMM Base Hob, SMM CPU driver does not need the RSM instruction > > to reload the SMBASE register with the new allocated value in SMBASE > > field each time it exits SMM. SMBASE Register for each processors > > have already been programmed in parallel since the same default > > SMBASE Address(0x30000) is not used, thus the CPUs over-writing > > each other's SMM Save State Area will not happen. >=20 > Care to explain how this works? SMBASE setup has to happen somewhere > (probably in the HOB producer), how does that work without using the > default smbase address? >=20 > take care, > Gerd