From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from MRWPR03CU001.outbound.protection.outlook.com (mail-francesouthazon11021119.outbound.protection.outlook.com [40.107.130.119]) by lore.virtuozzo.com (Postfix) with ESMTPS id 96F588015B for ; Wed, 23 Sep 2026 13:30:31 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HzOnmjrMpPRX5VcnLVD7eo607nkJ3CbsdpnOPTewEr2CD3bmexmxL7Abikn8qLps2c5wEzs1CJwg6qt6m+mJ2cHBTLY6R3Plz4X8jUqJA+qCm5WTur9imcBil3qFz13itkDIb3DYhHcihLDjJhzAFSdj4DmeeCErwsQQNFPoV3ZgX037I4Z2xMKF4Dmq5XCB+qt10GujpfSQdU3VhJinLdbtvERUlqZfgUTukJh9BlbEcMUHu1DABFjOs1Mrq6Upwm++DblPjOM/dcl6rZi4R/eNJRr9oIJ2a7fTiqRhCz281YuPFEOHh6/53gA8MqilNiG4eaDQcggg/nQBPPs1GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=ni/QvF/Y1YgBw+axkJakP9Gz9+xCKUQqFxHSed10TGU=; b=Cdd+ZkoHZS0RRPbROtVWpFvcw91/25MU/crdwtVzyVeFtdvz6Eb2PYmKeHUkAFtwfreHC9yCjBAnzAbhkVysSAC3CpFazTzdn7jDcGS2cidurDYsRp4u8QpvKHsR1I3/iOllYFGoqU6RUJ13hq4qqeP3/tCzPaqHJ/FBesEohahG4RqkfCAMdUM06UnWaucBeVS010azsNFgUTOg8NY3XBeHti7Iy8jG47STHnVyFV7Y4pqqbU5k14IGHmiauJuGM1P9xBf1xIUS9vYTQasXAG4hvV3wyXXr05dh7mBaMCFaoCMcrCJBxIrzBue5Zpb9VAxJK5/1qKEvP6yuHlwryg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ni/QvF/Y1YgBw+axkJakP9Gz9+xCKUQqFxHSed10TGU=; b=FPRP7dLrV3WcBbOImOeg5WInPEzlIOhOC6/WX4BMZhCy0f/ImOVuY8adW0dqFRv3Hokg+o9cGxdRde1Ug91SRrk6R5jXj4XIrCOx3DDsVSGmffEf4A9ioKN/iZ6PB4togBsAH4nJD2R50NTRnbMg40ZR8qi1S91DuhUQSbI/+KOnkYl3ywGRoQcDqqKP9d1soKpXPAsNVz3kYSHDilu2FkesH9t1ygYYPWVuiCnMLIdYOYF68rsa2s3Af72bD4GAxDPNLBPBSPoCuKKId5eQWFak+xwGDC9miV7grllXpw1Q4RtPWWPOsJL8rqBcjAb00GFW1WvWKmdltvy0hpAITw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=virtuozzo.com; Received: from VI0PR08MB10656.eurprd08.prod.outlook.com (2603:10a6:800:20a::12) by AMBPR08MB686074.eurprd08.prod.outlook.com (2603:10a6:20b:798::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.451.14; Wed, 23 Sep 2026 13:30:29 +0000 Received: from VI0PR08MB10656.eurprd08.prod.outlook.com ([fe80::4e37:b189:ddcd:3dd8]) by VI0PR08MB10656.eurprd08.prod.outlook.com ([fe80::4e37:b189:ddcd:3dd8%7]) with mapi id 15.21.0451.014; Wed, 23 Sep 2026 13:30:29 +0000 Message-ID: Date: Wed, 23 Sep 2026 16:30:28 +0300 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] UefiCpuPkg: add SendStartupIpi to LocalApicLib #VSTOR-146639 To: "Denis V. Lunev" , svt-core@virtuozzo.com References: <20260921154406.1628753-1-den@openvz.org> <20260921154406.1628753-2-den@openvz.org> Content-Language: en-US From: Andrey Drobyshev In-Reply-To: <20260921154406.1628753-2-den@openvz.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR4P281CA0201.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:e5::17) To VI0PR08MB10656.eurprd08.prod.outlook.com (2603:10a6:800:20a::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI0PR08MB10656:EE_|AMBPR08MB686074:EE_ X-MS-Office365-Filtering-Correlation-Id: 3720e377-f516-4fab-9ed3-08df1976d58c X-LD-Processed: 0bc7f26d-0264-416e-a6fc-8352af79c58f,ExtAddr List-Id: svt-core@virtuozzo.com X-MS-Exchange-Transport-Rules-Loop: 1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|23010399003|1800799024|366016|376014|18002099003|22082099003|4143699003|10067099003|56012099006|5113699003; X-Microsoft-Antispam-Message-Info: MsTueO3W6NT80pcellFIDSYjvVXpfMTgMMx95Zby+qx+My1umWOMZQi0YwZSJ1yZlvEMwqsI+3ZHpnS9YcpH+SL8jJjCqEwCr4bOMMvOLdH+zLfaEcWBy+1xgASnJVjYymEaJDHpDysNPMcEZFJInBO8T5qMk19UobgsyNHJRVzp1PJApFct6jiF3Ido87/hSxhn7XuYtP5apjabWAZs5AoJx+ea/j4BHyZd9D7iI9Jbh+kbQongqfIvNiXxidn35D9U1JpV+Zp36CXjV0A1P6YjlLxOjorpaRPygQGJTChGbCDuG+e+7g51MtAjx3QJQwPJaO0u+btJXwrOuMxRI/qAtCGr+mCMGJeu2u97VYiRKAC8p5JT72VDyuiESCIfFWkYFM/h7972+ce/Gx/7NWJ0uxuLt9Er4IUDAlqkrAZztmyqo1XChsLKjBPyUf0jKUc0VpH611GDQZAzT2NWUoOLvyjZivipsb82I7tMBFuWqWIwn0Bu459FXWUUHUVA70s7HAOotwO2tAuyvwVweQ2j//LljvJH9d9CZDVmzPAqY7aXCYpJ3tgsXp+W9Hd0avB2eJB/sft/Nr38EDMC25EHX9MKlOF6gub2Be1jqCVTwntDdHclSY3LL/9DjVGI+FFQbfHoaOb7KK+IO8/QQDWnJLK73V4r90b7hrGCXbw= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI0PR08MB10656.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(1800799024)(366016)(376014)(18002099003)(22082099003)(4143699003)(10067099003)(56012099006)(5113699003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?VDNreEVMRDhrOUtSQzdrQkdpSjExRFk0RlNlS2w0NWpKUGIzUDNtZEgyVkNH?= =?utf-8?B?aGVUcUFGbWdKMnpjTi8xUHpSaHRZaVQ4akNNVnhlZE8rWGF0bU5naGpLM01u?= =?utf-8?B?Q0cwM0pQUlRQZWViWFJQNGxVK3VKL0tQQzhnQ1N1UEgzcUttbm9DLzJCeXlh?= =?utf-8?B?QWx5OC9LcmdIcWhPYW1RbUdSOFhScXo1LzBVMXlKU3cvLzRMS3FZWHBhZEpQ?= =?utf-8?B?eEZ0R0prcXJpN0xnY3dFV1pzVEZJWXpISGNpdFpmVGJLeCs5dnhwazBkNDR3?= =?utf-8?B?bnNnemJOK1NiekEwdDM4bmpENVNmU0YrY2VDRzJ3OVFkckxwdGhNd2JyNng5?= =?utf-8?B?YStCWHBWNWg1NlVvVXhrNnJYeFpRd3F0bXZ0anhoSmhwSEVZV2V2L2VIMDZq?= =?utf-8?B?OC9KMGZRNDRYR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hdlBBVnNqbmZBR3krRlBWQ1Ju?= =?utf-8?B?YjFOakE1S1orQW96SEYzNlNJM2VXWTNaaitDdHljNVphMXV2QTc0dllRdmpM?= =?utf-8?B?WXpnVWhGVWZGVFB3cGxZSlR2LzY5Nk55TWdMeHFZWWJqVktlYis1UnBQWGg2?= =?utf-8?Q?1W6JyUtrQc6wfZAY=3D?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3720e377-f516-4fab-9ed3-08df1976d58c X-MS-Exchange-CrossTenant-AuthSource: VI0PR08MB10656.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2026 13:30:29.1772 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qo88aFO+lEOgXRiuaz+asOa5Oh/AfIklYTMuILKxmbaBdrb7Jvp3DJSutana59jtscDebaIZTRfvY1x73YL87jGUk3Q3WY18kJSm1jbEtKw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AMBPR08MB686074 Ack On 9/21/26 6:44 PM, Denis V. Lunev wrote: > From: Denis V. Lunev > > The library can send a Start-up IPI to all processors excluding self, > or an INIT-SIPI-SIPI sequence to one processor, but it cannot send a > bare Start-up IPI to one processor. SendInitSipiSipi builds that ICR > inline instead. > > Export it, and build SendInitSipiSipi on top of it. A caller that has > to poke a single AP now has a way to do so without an INIT, which > would reset an AP that had already started. > > No functional change. > > Signed-off-by: Denis V. Lunev > Cc: Andrey Drobyshev > --- > UefiCpuPkg/Include/Library/LocalApicLib.h | 19 +++++++++++ > .../Library/BaseXApicLib/BaseXApicLib.c | 32 ++++++++++++++++--- > .../BaseXApicX2ApicLib/BaseXApicX2ApicLib.c | 32 ++++++++++++++++--- > 3 files changed, 73 insertions(+), 10 deletions(-) > > diff --git a/UefiCpuPkg/Include/Library/LocalApicLib.h b/UefiCpuPkg/Include/Library/LocalApicLib.h > index d7c2ad3f70..6c55ed75cc 100644 > --- a/UefiCpuPkg/Include/Library/LocalApicLib.h > +++ b/UefiCpuPkg/Include/Library/LocalApicLib.h > @@ -200,6 +200,25 @@ SendStartupIpiAllExcludingSelf ( > IN UINT32 StartupRoutine > ); > > +/** > + Send a Start-up IPI to a specified target processor. > + > + This function returns after the IPI has been accepted by the target processor. > + > + if StartupRoutine >= 1M, then ASSERT. > + if StartupRoutine is not multiple of 4K, then ASSERT. > + > + @param ApicId Specify the local APIC ID of the target processor. > + @param StartupRoutine Points to a start-up routine which is below 1M physical > + address and 4K aligned. > +**/ > +VOID > +EFIAPI > +SendStartupIpi ( > + IN UINT32 ApicId, > + IN UINT32 StartupRoutine > + ); > + > /** > Send an INIT-Start-up-Start-up IPI sequence to a specified target processor. > > diff --git a/UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.c b/UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.c > index 9767e3b48e..2f2d31333a 100644 > --- a/UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.c > +++ b/UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.c > @@ -525,7 +525,7 @@ SendStartupIpiAllExcludingSelf ( > } > > /** > - Send an INIT-Start-up-Start-up IPI sequence to a specified target processor. > + Send a Start-up IPI to a specified target processor. > > This function returns after the IPI has been accepted by the target processor. > > @@ -538,7 +538,7 @@ SendStartupIpiAllExcludingSelf ( > **/ > VOID > EFIAPI > -SendInitSipiSipi ( > +SendStartupIpi ( > IN UINT32 ApicId, > IN UINT32 StartupRoutine > ) > @@ -548,16 +548,38 @@ SendInitSipiSipi ( > ASSERT (StartupRoutine < 0x100000); > ASSERT ((StartupRoutine & 0xfff) == 0); > > - SendInitIpi (ApicId); > - MicroSecondDelay (PcdGet32 (PcdCpuInitIpiDelayInMicroSeconds)); > IcrLow.Uint32 = 0; > IcrLow.Bits.Vector = (StartupRoutine >> 12); > IcrLow.Bits.DeliveryMode = LOCAL_APIC_DELIVERY_MODE_STARTUP; > IcrLow.Bits.Level = 1; > SendIpi (IcrLow.Uint32, ApicId); > +} > + > +/** > + Send an INIT-Start-up-Start-up IPI sequence to a specified target processor. > + > + This function returns after the IPI has been accepted by the target processor. > + > + if StartupRoutine >= 1M, then ASSERT. > + if StartupRoutine is not multiple of 4K, then ASSERT. > + > + @param ApicId Specify the local APIC ID of the target processor. > + @param StartupRoutine Points to a start-up routine which is below 1M physical > + address and 4K aligned. > +**/ > +VOID > +EFIAPI > +SendInitSipiSipi ( > + IN UINT32 ApicId, > + IN UINT32 StartupRoutine > + ) > +{ > + SendInitIpi (ApicId); > + MicroSecondDelay (PcdGet32 (PcdCpuInitIpiDelayInMicroSeconds)); > + SendStartupIpi (ApicId, StartupRoutine); > if (!StandardSignatureIsAuthenticAMD ()) { > MicroSecondDelay (200); > - SendIpi (IcrLow.Uint32, ApicId); > + SendStartupIpi (ApicId, StartupRoutine); > } > } > > diff --git a/UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.c b/UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.c > index 7fa997c882..d4db452a80 100644 > --- a/UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.c > +++ b/UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.c > @@ -764,7 +764,7 @@ SendStartupIpiAllExcludingSelf ( > } > > /** > - Send an INIT-Start-up-Start-up IPI sequence to a specified target processor. > + Send a Start-up IPI to a specified target processor. > > This function returns after the IPI has been accepted by the target processor. > > @@ -777,7 +777,7 @@ SendStartupIpiAllExcludingSelf ( > **/ > VOID > EFIAPI > -SendInitSipiSipi ( > +SendStartupIpi ( > IN UINT32 ApicId, > IN UINT32 StartupRoutine > ) > @@ -787,16 +787,38 @@ SendInitSipiSipi ( > ASSERT (StartupRoutine < 0x100000); > ASSERT ((StartupRoutine & 0xfff) == 0); > > - SendInitIpi (ApicId); > - MicroSecondDelay (PcdGet32 (PcdCpuInitIpiDelayInMicroSeconds)); > IcrLow.Uint32 = 0; > IcrLow.Bits.Vector = (StartupRoutine >> 12); > IcrLow.Bits.DeliveryMode = LOCAL_APIC_DELIVERY_MODE_STARTUP; > IcrLow.Bits.Level = 1; > SendIpi (IcrLow.Uint32, ApicId); > +} > + > +/** > + Send an INIT-Start-up-Start-up IPI sequence to a specified target processor. > + > + This function returns after the IPI has been accepted by the target processor. > + > + if StartupRoutine >= 1M, then ASSERT. > + if StartupRoutine is not multiple of 4K, then ASSERT. > + > + @param ApicId Specify the local APIC ID of the target processor. > + @param StartupRoutine Points to a start-up routine which is below 1M physical > + address and 4K aligned. > +**/ > +VOID > +EFIAPI > +SendInitSipiSipi ( > + IN UINT32 ApicId, > + IN UINT32 StartupRoutine > + ) > +{ > + SendInitIpi (ApicId); > + MicroSecondDelay (PcdGet32 (PcdCpuInitIpiDelayInMicroSeconds)); > + SendStartupIpi (ApicId, StartupRoutine); > if (!StandardSignatureIsAuthenticAMD ()) { > MicroSecondDelay (200); > - SendIpi (IcrLow.Uint32, ApicId); > + SendStartupIpi (ApicId, StartupRoutine); > } > } >