From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web10.10717.1646926002023132072 for ; Thu, 10 Mar 2022 07:26:42 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=InZ/Gims; spf=pass (domain: kernel.org, ip: 139.178.84.217, mailfrom: ardb@kernel.org) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0B4B9618C7 for ; Thu, 10 Mar 2022 15:26:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71345C340EB for ; Thu, 10 Mar 2022 15:26:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646926000; bh=RGxLNGwedapv6qwn4fz+bW/OnUYVU4vli1GMLz/U9BI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=InZ/GimsN02qc6w1u2UsZHyYFirE7zJ4k+bHS1/xZ6chnSmPPLTLH6L2wLILhA7gA IfPZQUE90pIV37RGW3YFpk49HTIgenLpIHJjj4V9zH2Updp07yjHP+M2glArcnousz ooHA8i7WOxlS16D/1J1zV0LNKOjwRqutEWygB/aXwDc/hJR8q1gtjRTEJfU9hyYVIV SZ3BFp55iD6sdcqQNbvGstZ5UF/CNpRxdsJQcrZvId5xQQz/PervNBng4KmOUmH/Fs hAWIGhr3Puh2gJTxPpTzKLPV1JjNIRxGKWprafZzqe2vuA2MD7kriqT9gCdpUg2jws voSDGNT8pB6Ug== Received: by mail-yb1-f182.google.com with SMTP id e186so11550263ybc.7 for ; Thu, 10 Mar 2022 07:26:40 -0800 (PST) X-Gm-Message-State: AOAM5324jfDqdL56vs7paQZypjG/Y1Gi0GreRRZIGrvf5Jl3KQApmPmI mbg56KcPKIK+ZSHHhsoTt6RoueyJuEkYUkZG7jU= X-Google-Smtp-Source: ABdhPJzEPUjBnVVJQ5kc02qd37KA8bVXDaulq5EOIB1lZruS2ChMt1mB1pt6u3w8QQ2MNiJjt8N2agQxYFRLga/zn80= X-Received: by 2002:a25:585:0:b0:628:9860:39da with SMTP id 127-20020a250585000000b00628986039damr4137812ybf.383.1646925999484; Thu, 10 Mar 2022 07:26:39 -0800 (PST) MIME-Version: 1.0 References: <20220310131037.22334-1-pranav.madhu@arm.com> In-Reply-To: <20220310131037.22334-1-pranav.madhu@arm.com> From: "Ard Biesheuvel" Date: Thu, 10 Mar 2022 16:26:26 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2][PATCH V1 1/1] ArmPkg: Handle warm reboot request correctly To: Pranav Madhu Cc: edk2-devel-groups-io , Ard Biesheuvel , Sami Mujawar Content-Type: text/plain; charset="UTF-8" On Thu, 10 Mar 2022 at 14:10, Pranav Madhu wrote: > > The warm reboot requests are mapped to cold reboot as the power control > module was not capable of handling the warm reboot requests in the > legacy implementation. The support for warm reboot support is added into > the power control module. To support warm reset, update > ArmPsciResetSystemLib, and there by invoke the PSCI call with parameters > for warm reboot. > > Signed-off-by: Pranav Madhu What happens on 32-bit platforms with this change? What happens if the firmware does not implement ARM_SMC_ID_PSCI_SYSTEM_RESET2_AARCH64? > --- > ArmPkg/Include/IndustryStandard/ArmStdSmc.h | 1 + > ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.c | 7 +++++-- > 2 files changed, 6 insertions(+), 2 deletions(-) > > Link to github branch for this patch - > https://github.com/Pranav-Madhu/edk2/tree/topics/warm_reboot > > diff --git a/ArmPkg/Include/IndustryStandard/ArmStdSmc.h b/ArmPkg/Include/IndustryStandard/ArmStdSmc.h > index 655edc21b205..c9059dead6e9 100644 > --- a/ArmPkg/Include/IndustryStandard/ArmStdSmc.h > +++ b/ArmPkg/Include/IndustryStandard/ArmStdSmc.h > @@ -93,6 +93,7 @@ > #define ARM_SMC_ID_PSCI_MIGRATE_AARCH32 0x84000005 > #define ARM_SMC_ID_PSCI_SYSTEM_OFF 0x84000008 > #define ARM_SMC_ID_PSCI_SYSTEM_RESET 0x84000009 > +#define ARM_SMC_ID_PSCI_SYSTEM_RESET2_AARCH64 0xc4000012 > > /* The current PSCI version is: 0.2 */ > #define ARM_SMC_PSCI_VERSION_MAJOR 0 > diff --git a/ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.c b/ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.c > index 7bcd34849507..27e048ba0f7a 100644 > --- a/ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.c > +++ b/ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.c > @@ -45,10 +45,13 @@ LibResetSystem ( > ARM_SMC_ARGS ArmSmcArgs; > > switch (ResetType) { > + case EfiResetWarm: > + ArmSmcArgs.Arg0 = ARM_SMC_ID_PSCI_SYSTEM_RESET2_AARCH64; > + ArmSmcArgs.Arg1 = 0; > + ArmSmcArgs.Arg2 = 0; > + break; > case EfiResetPlatformSpecific: > // Map the platform specific reset as reboot > - case EfiResetWarm: > - // Map a warm reset into a cold reset > case EfiResetCold: > // Send a PSCI 0.2 SYSTEM_RESET command > ArmSmcArgs.Arg0 = ARM_SMC_ID_PSCI_SYSTEM_RESET; > -- > 2.17.1 >