From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id CA09B941430 for ; Thu, 21 Nov 2024 09:54:06 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=HZHQmT2xnFoKjonylR72HsGswjCXU9h/bdDZo+UtnBY=; c=relaxed/simple; d=groups.io; h=From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type; s=20240830; t=1732182846; v=1; x=1732442045; b=lH0yvJB0zJK83bG6Pw1+bfWTAoQcOOxdoeu682zkAxz/nDTY7H7LS6QHhG4yQnSrknnzUVc0 RlQCebgrgJRTMMjvNGHxm7UbkzMLtLuM8GL8rSssx5euFJ5Yv+YouxWG9I/FQ71+Y/bngHn4AQx +oSCb63bflZ+co7CoXOiRadPvQo1c7/0Z4hdZuVkoP3VGi0eYe+A3j8YcdTvQU3dvDD0PhU0FTm VeDX5TtAu8he+Sqg1w4OG7Yq/UjHUJlpQxa7SFaepEQ9a7CYSMdIHZEo0A+vpVJOdWola9oY0iO AwE1Np0VPfs1ERbmQRCPwiboATNvKelPCdP7iX8a0sAtQ== X-Received: by 127.0.0.2 with SMTP id eTbZYY7687511x78kP239ePx; Thu, 21 Nov 2024 01:54:05 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by mx.groups.io with SMTP id smtpd.web11.7285.1732182844241371032 for ; Thu, 21 Nov 2024 01:54:04 -0800 X-CSE-ConnectionGUID: PJ/Whj6pRAiaI2HAHXc+Hw== X-CSE-MsgGUID: 38X/w4okQNWAyqSKwMf4ew== X-IronPort-AV: E=McAfee;i="6700,10204,11262"; a="57686090" X-IronPort-AV: E=Sophos;i="6.12,172,1728975600"; d="scan'208,217";a="57686090" X-Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2024 01:54:04 -0800 X-CSE-ConnectionGUID: cl9xp3kVQGCVi96+WqtRFg== X-CSE-MsgGUID: dWcPBXW8QMWoKfKy73C4kg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,172,1728975600"; d="scan'208,217";a="94657243" X-Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmviesa005.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 21 Nov 2024 01:54:03 -0800 X-Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 21 Nov 2024 01:54:03 -0800 X-Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Thu, 21 Nov 2024 01:54:03 -0800 X-Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.49) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 21 Nov 2024 01:54:03 -0800 X-Received: from MN0PR11MB6158.namprd11.prod.outlook.com (2603:10b6:208:3ca::18) by SN7PR11MB6995.namprd11.prod.outlook.com (2603:10b6:806:2ae::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.23; Thu, 21 Nov 2024 09:54:00 +0000 X-Received: from MN0PR11MB6158.namprd11.prod.outlook.com ([fe80::13cf:47a8:4737:84e9]) by MN0PR11MB6158.namprd11.prod.outlook.com ([fe80::13cf:47a8:4737:84e9%5]) with mapi id 15.20.8158.021; Thu, 21 Nov 2024 09:54:00 +0000 From: "Wu, Jiaxin via groups.io" To: "Liu, Zhiguang" , "devel@edk2.groups.io" , "Ni, Ray" , "Tan, Dun" , "Kumar, Rahul R" , "Gerd Hoffmann" , "Kinney, Michael D" , "Gao, Liming" CC: "Kumar, Chandana C" , "Zhao, Jason" , "Kuo, Donald" Subject: Re: [edk2-devel] UefiCpuPkg: Proposal to enable/disable AP parallel Thread-Topic: UefiCpuPkg: Proposal to enable/disable AP parallel Thread-Index: Ads7ENWFYT6OL6QbQl+cr51i2qWfsQA6MVzQ Date: Thu, 21 Nov 2024 09:54:00 +0000 Message-ID: References: In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN0PR11MB6158:EE_|SN7PR11MB6995:EE_ x-ms-office365-filtering-correlation-id: 57be4a5c-c3b7-4606-0384-08dd0a126ca1 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: =?us-ascii?Q?ASaGgZiwCirb/ftP3YUfccpbSO/L8j8aL9pug8XzGi36WWc5BKpXRxYLjMle?= =?us-ascii?Q?uOtHgRKdSmsagxK//Mbe5XzBMjX2vXUmWcKqYSnp4qKi77LpvfEiX6ZxTRdg?= =?us-ascii?Q?VWbtEb19tT88a6ZNA7UvXeXmsfMp2jef4U363EY42zkwGWQsiOA3yqaGxcfq?= =?us-ascii?Q?LEr8sTb49bW2ivb99l9S0/CYQQpMscuXONglW98uxW695AMZsa4OqpfUDy3y?= =?us-ascii?Q?g2vZqE09MSfUyAvwY467C46hVpfJZ4alivZjpUaWnycrJuUuRWYmMgcfJgt+?= =?us-ascii?Q?MI8x8SP2sgx+LRUNPXLnvlxQY14jkteY4DJIsbCWdS3SHRUmumaFMdvM0Vm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MD6KfbnP2K/bdE18kKmqi7dqWRpWH3?= =?us-ascii?Q?lWFvA1r9ry8tGqooOW1M16BkMgt2Bwy6z/+Oz173ppYkER41YSzgYboiV6jt?= =?us-ascii?Q?yG2jKAhPaIzvg2Haazy/aewwMzFjCLiJVdr/5eCcZPYtalcSeIB78Jah54ZF?= =?us-ascii?Q?PobDsidoqBvdrqkLtqbdbcS+BCf/Tyv8Nb89rGIaGOKTeZcBlDXRFwRntEcF?= =?us-ascii?Q?huFBSw6KrUA=3D?= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?wJvXHyhCJYwzqtGLZKtGSiVy4+Ts7laboG4kcsiujcEuQLhDFC17kvuBikn5?= =?us-ascii?Q?UFMjgsRpO15NgQSuMYDvU+OEB8xmBPsnP434MHrLrhcg+K51Qj9SKwdRAwHo?= =?us-ascii?Q?9cpzu3KNvQH4d50yD2p5QnlyOvvQR/Q87ilgTeK+pdjR8WEsDEcAicQFa34G?= =?us-ascii?Q?XoJteDhIXuyrzrEZbfG+Hz3ZGF3sHBr6/MQTfCcdczRxRTFd7nm65K1JwSJ0?= =?us-ascii?Q?Jy97+ke12QalI0A5DMCo1rjZHotbq37ZTgz8WloZplwNaLlq02FNgWsrxSgU?= =?us-ascii?Q?MSEiTHpuUBOhtdg7EJAi+Nek6UyNGul0Tm1vXNdHhf7X2Nz1GrquumZgn9oh?= =?us-ascii?Q?AbrY2CEKjvLU03SjDKstIw1CGZacB36eVMIQDsQKCBKjGJsBLm0/ssGZwwrs?= =?us-ascii?Q?/hUO4/l7rNQdwcB5RZlx6VjsgJ+MLL0TEFtRVReeD1vTGfbjS1Sa95nmqGtL?= =?us-ascii?Q?7a6anCMmClM5Eo7tv30AIj45pBtTLCMXr4O5xCH6rQ/hYBAdFn7cfDUJ4fG9?= =?us-ascii?Q?XC35u3cTpFNZX9ylyTGMDY29ec/VfI30xftk+3XEM2lrWyUEpHw5/2XC0ILN?= =?us-ascii?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nbVtWpRHsEm7SxNncoNhluy?= =?us-ascii?Q?JtwzfaMfv2EbHTvKhXl9vaJ4dC0rTAgGTUJlWck2OlItgpxPa6RXP3Z0io+H?= =?us-ascii?Q?TXt/xqCzicTrC4yJmcrNcSJPAjcX+tWI8SuVmqWK?= 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: 57be4a5c-c3b7-4606-0384-08dd0a126ca1 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Nov 2024 09:54:00.4109 (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: objcy0GjiEj9vJxhxl1EGRkm1rSz15gzj4vYpDMGT+u78RJfw3HxOHTdwFgne72IzinkoTC0mZ5/xMTqhph2rA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB6995 X-OriginatorOrg: intel.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Thu, 21 Nov 2024 01:54:04 -0800 Resent-From: jiaxin.wu@intel.com Reply-To: devel@edk2.groups.io,jiaxin.wu@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: K5G7DO7tGUIIA6Te2B4RZBpqx7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_MN0PR11MB6158A9E4738F6A6F1A6F562AFE222MN0PR11MB6158namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240830 header.b=lH0yvJB0; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io --_000_MN0PR11MB6158A9E4738F6A6F1A6F562AFE222MN0PR11MB6158namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Solution 1, it's not kind of spec violating. Instead, it's to add a new cap= ability to the existing interface, and it's a compatible change, no impact = to existing interface usage. I recall we have a guideline that prioritizes = code-first approaches if there are no compatibility issues. Mike and Ray ca= n comment on this. If no objection, I also prefer this way. Solution 2 cannot handle the PPI case, leading to inconsistent behavior bet= ween the protocol and PPI for the mpservice2. Solutions 3 and 4 are more like workarounds to address the specific issue. Thanks, Jiaxin From: Liu, Zhiguang Sent: Wednesday, November 20, 2024 3:13 PM To: devel@edk2.groups.io; Ni, Ray ; Wu, Jiaxin ; Liu, Zhiguang ; Tan, Dun ; Kumar, Rahul R ; Gerd Hoffmann ; Kinney, Michael D ; Gao, Liming Cc: Kumar, Chandana C ; Zhao, Jason ; Kuo, Donald Subject: UefiCpuPkg: Proposal to enable/disable AP parallel Hi MdePkg and UefiCpuPkg maintainers and reviewers Recently, we met a performance issue when waking up disabled APs. There is usage where BIOS needs to disable all APs, do something and then e= nable all APs. Now, we are using the MpService PPI/Protocol EnableDisableAP(). This functi= on can only enable/disable one AP each time. To enable one AP, MP service needs to send INIT-SIPI-SIPI, which takes arou= nd 10ms. And now, we will have more than 10 APs in a client platform, and it will ta= ke more than 100ms. The function definition of EnableDisableAP is: typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_ENABLEDISABLEAP)( IN EFI_MP_SERVICES_PROTOCOL *This, IN UINTN ProcessorNumber, IN BOOLEAN EnableAP, IN UINT32 *HealthFlag OPTIONAL ); The input parameter ProcessorNumber accepts a range from 0 to the total num= ber of logical processors minus 1. To support enable/disable AP parallel, I have below solutions: Solution1: Let input parameter ProcessorNumber accept a MAX_UINTN also. MAX_UINTN mean= s to enable/disable all APs. The draft PR is at https://github.com/tianocore/edk2/pull/6453 When the par= ameter is MAX_UINTN, EnableDisableAP() will enable/disable APs in a paralle= l way. However, we need to change below header files MdePkg\Include\Protocol\MpService.h MdePkg\Include\Ppi\MpServices.h UefiCpuPkg\Include\Ppi\MpServices2.h The above two follow PI spec. We need to modify the PI spec= first. Solution2: Similar with solution1, but to avoid violating spec, add a = new Protocol named MpServices2. Only change below header files. UefiCpuPkg\Include\Ppi\MpServices2.h UefiCpuPkg\Include\Protocol\MpServices2.h (new) The MdePkg part remains no change. Solution3: MpService create new PPI/Protocol to only contain one funct= ion EnableDisableAllAps(), which will enable/disable all APs in a parallel = way. Solution4: Add PPI/Protocol notify in MpLib. The notify call back func= tion will set WakeUpByInitSipiSipi to True. Similar code is removed in http= s://github.com/tianocore/edk2/pull/6303/commits/f1f8374381019169d421a65a896= ab42ed5338c1e When users need to disable and then enable cores, the flow = will be: 1. Send Init to all APs. (to disable all APs) 2. Do things that user need to do when all APs are disabled 3. Notify callback function 4. Use StartupAllAPs() from existing PPI/Protocol to wake up all APs. The flow is similar with how S3 SMM code take control APs and then give the= control back in old days. Personally, I prefer solution1. It is simpler, but it does violate spec. Please let me know your comments or any new idea, please share. Thanks Zhiguang -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#120808): https://edk2.groups.io/g/devel/message/120808 Mute This Topic: https://groups.io/mt/109680758/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- --_000_MN0PR11MB6158A9E4738F6A6F1A6F562AFE222MN0PR11MB6158namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Solution 1, it’s not kind of spec violating. I= nstead, it’s to add a new capability to the existing interface, and i= t’s a compatible change, no impact to existing interface usage. I rec= all we have a guideline that prioritizes code-first approaches if there are no compatibility issues. Mike and Ray can comment = on this. If no objection, I also prefer this way.

Solution 2 cannot handle the PPI case, leading to in= consistent behavior between the protocol and PPI for the mpservice2.

 

Solutions 3 and 4 are more like workarounds to addre= ss the specific issue.

 

Thanks,<= /span>

Jiaxin <= /span>

 

From: Liu, Zhiguang <zhiguang.liu@intel.com>
Sent: Wednesday, November 20, 2024 3:13 PM
To: devel@edk2.groups.io; Ni, Ray <ray.ni@intel.com>; Wu, Jiax= in <jiaxin.wu@intel.com>; Liu, Zhiguang <zhiguang.liu@intel.com>= ;; Tan, Dun <dun.tan@intel.com>; Kumar, Rahul R <rahul.r.kumar@int= el.com>; Gerd Hoffmann <kraxel@redhat.com>; Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming <gaoliming@byosoft.co= m.cn>
Cc: Kumar, Chandana C <chandana.c.kumar@intel.com>; Zhao, Jaso= n <jason.zhao@intel.com>; Kuo, Donald <donald.kuo@intel.com> Subject: UefiCpuPkg: Proposal to enable/disable AP parallel

 

Hi MdePkg and UefiCpuPkg maintainers and reviewers

 

Recently, we met a performance issue when waking up = disabled APs.

There is usage where BIOS needs to disable all APs, = do something and then enable all APs.

Now, we are using the MpService PPI/Protocol EnableD= isableAP(). This function can only enable/disable one AP each time.

To enable one AP, MP service needs to send INIT-SIPI= -SIPI, which takes around 10ms.

And now, we will have more than 10 APs in a client p= latform, and it will take more than 100ms.

The function definition of EnableDisableAP is:<= /o:p>

typedef

EFI_STATUS

(EFIAPI *EFI_MP_SERVICES= _ENABLEDISABLEAP)(

  IN  EFI_MP_S= ERVICES_PROTOCOL  *This,

  IN  UINTN &n= bsp;                   Process= orNumber,

  IN  BOOLEAN =                   EnableAP,

  IN  UINT32 &= nbsp;                  *Health= Flag OPTIONAL

  );

The input parameter ProcessorNumber accepts a range = from 0 to the total number of logical processors minus 1.

 

To support enable/disable AP parallel, I have below = solutions:

 

Solution1:

Let input parameter Proce= ssorNumber accept a MAX_UINTN also. MAX_UINTN means to enable/disable all A= Ps.

The draft PR is at https://github.com/tianocore/edk2/pull/6453 When the parameter is MAX_U= INTN, EnableDisableAP() will enable/disable APs in a parallel way.

        &nbs= p;       However, we need to change below hea= der files

        &nbs= p;            &= nbsp;          MdePkg\Include\= Protocol\MpService.h

        &nbs= p;            &= nbsp;          MdePkg\Include\= Ppi\MpServices.h

        &nbs= p;            &= nbsp;          UefiCpuPkg\Incl= ude\Ppi\MpServices2.h

        &nbs= p;       The above two follow PI spec. We nee= d to modify the PI spec first.

 

Solution2:

        &nbs= p;       Similar with solution1, but to avoid= violating spec, add a new Protocol named MpServices2. Only change below he= ader files.

        &nbs= p;            &= nbsp;          UefiCpuPkg\Incl= ude\Ppi\MpServices2.h

UefiCpuP= kg\Include\Protocol\MpServices2.h (new)

        &nbs= p;       The MdePkg part remains no change.

 

Solution3:

        &nbs= p;       MpService create new PPI/Protocol to= only contain one function EnableDisableAllAps(), which will enable/disable= all APs in a parallel way.

 

Solution4:

        &nbs= p;       Add PPI/Protocol notify in MpLib. Th= e notify call back function will set WakeUpByInitSipiSipi to True. Similar = code is removed in https://github.com/tianocore/edk2/pull/6303/commits/f1f8374381019169d421a65= a896ab42ed5338c1e

        &nbs= p;       When users need to disable and then = enable cores, the flow will be:

  1. Send Init to all APs. (to disable all APs)
  2. D= o things that user need to do when all APs are disabled
  3. Notify callback function
  4. Use StartupAllAPs() fro= m existing PPI/Protocol to wake up all APs.

The flow is similar with = how S3 SMM code take control APs and then give the control back in old days= .

 

Personally, I prefer solution1. It is simpler, but i= t does violate spec.

Please let me know your comments or any new idea, pl= ease share.

 

Thanks

Zhiguang       &n= bsp;  

 

_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#120808) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--_000_MN0PR11MB6158A9E4738F6A6F1A6F562AFE222MN0PR11MB6158namp_--