[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCH 02/30] ARM: kexec: Disable IRQs/FIQs also on crash CPUs shutdown path
 
- To: "Guilherme G. Piccoli" <gpiccoli@xxxxxxxxxx>, "akpm@xxxxxxxxxxxxxxxxxxxx"	<akpm@xxxxxxxxxxxxxxxxxxxx>, "bhe@xxxxxxxxxx" <bhe@xxxxxxxxxx>,	"pmladek@xxxxxxxx" <pmladek@xxxxxxxx>, "kexec@xxxxxxxxxxxxxxxxxxx"	<kexec@xxxxxxxxxxxxxxxxxxx>
 
- From: "Michael Kelley (LINUX)" <mikelley@xxxxxxxxxxxxx>
 
- Date: Fri, 29 Apr 2022 16:26:02 +0000
 
- Accept-language: en-US
 
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none
 
- 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=zTfneMsIYF8YteyonKPHoonZYmHV8hcH1Ru2q+6fv+0=; b=a8eu4ttDG+sEYNKvY+Uwg1P3RBiTiU+aBz6zRlC/6rvyoDzx60kk6vFEe/s42qfutMsEoCQXf26saUU5449UKwK24BAbhL91IpoY51JezhYp+GEiVnxQbqE/iZ+SOACRPpdsYFcOSEYUXdTrLeAFwJtGMnzA7bO3UfPp3ObxWmkMQaJkQa4bt+JR5CbdrtRreISsi/oI8XylYkH3pby6kSXQe+vmLXgJq9WyZhPChMkc4r6YxiCxevLqMJpaBn5Kytf9c8vT5PNtVTGx+ODEAb1aYyH/lQREUWAzeu7eEEE5pR4fiwrhZcFwzS5Xz3T5pA8yf4n50TM4AZeFGPKBZA==
 
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TnYPKv6cHHooKkxX4CyAInmQOVJL+OziIpN/GllKamJdLXKN9pgc0JLdxdyG5o4Udhig25LbpjMkGVtiJr3BpTywkbrXXha1jvswAm+XYWeYOXi2gjn2dH2uAgTMtLT2jbOTqtuSqOTs6HSmhzLD+7iFYQFUMSmQ2HhcdRz0tckq7wSnmWoEnae03PlAp81C/6Y7A5elDA7JXOm/ubJjoq+tF7vHcRy9sLmepWaqrALujROI2plEhRBl02SgmI6ETipuH8J6Xub66Nv/IDNQ0T1gxK8T1a1OaaPRk9S8MH5BuCJwTRspF9IdY2rGjJfLqh3Y9lm3CV0zLYpvT+I6Ig==
 
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com;
 
- Cc: "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>,	"bcm-kernel-feedback-list@xxxxxxxxxxxx"	<bcm-kernel-feedback-list@xxxxxxxxxxxx>, "coresight@xxxxxxxxxxxxxxxx"	<coresight@xxxxxxxxxxxxxxxx>, "linuxppc-dev@xxxxxxxxxxxxxxxx"	<linuxppc-dev@xxxxxxxxxxxxxxxx>, "linux-alpha@xxxxxxxxxxxxxxx"	<linux-alpha@xxxxxxxxxxxxxxx>, "linux-arm-kernel@xxxxxxxxxxxxxxxxxxx"	<linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, "linux-edac@xxxxxxxxxxxxxxx"	<linux-edac@xxxxxxxxxxxxxxx>, "linux-hyperv@xxxxxxxxxxxxxxx"	<linux-hyperv@xxxxxxxxxxxxxxx>, "linux-leds@xxxxxxxxxxxxxxx"	<linux-leds@xxxxxxxxxxxxxxx>, "linux-mips@xxxxxxxxxxxxxxx"	<linux-mips@xxxxxxxxxxxxxxx>, "linux-parisc@xxxxxxxxxxxxxxx"	<linux-parisc@xxxxxxxxxxxxxxx>, "linux-pm@xxxxxxxxxxxxxxx"	<linux-pm@xxxxxxxxxxxxxxx>, "linux-remoteproc@xxxxxxxxxxxxxxx"	<linux-remoteproc@xxxxxxxxxxxxxxx>, "linux-s390@xxxxxxxxxxxxxxx"	<linux-s390@xxxxxxxxxxxxxxx>, "linux-tegra@xxxxxxxxxxxxxxx"	<linux-tegra@xxxxxxxxxxxxxxx>, "linux-um@xxxxxxxxxxxxxxxxxxx"	<linux-um@xxxxxxxxxxxxxxxxxxx>, "linux-xtensa@xxxxxxxxxxxxxxxx"	<linux-xtensa@xxxxxxxxxxxxxxxx>, "netdev@xxxxxxxxxxxxxxx"	<netdev@xxxxxxxxxxxxxxx>, "openipmi-developer@xxxxxxxxxxxxxxxxxxxxx"	<openipmi-developer@xxxxxxxxxxxxxxxxxxxxx>, "rcu@xxxxxxxxxxxxxxx"	<rcu@xxxxxxxxxxxxxxx>, "sparclinux@xxxxxxxxxxxxxxx"	<sparclinux@xxxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx"	<xen-devel@xxxxxxxxxxxxxxxxxxxx>, "x86@xxxxxxxxxx" <x86@xxxxxxxxxx>,	"kernel-dev@xxxxxxxxxx" <kernel-dev@xxxxxxxxxx>, "kernel@xxxxxxxxxxxx"	<kernel@xxxxxxxxxxxx>, "halves@xxxxxxxxxxxxx" <halves@xxxxxxxxxxxxx>,	"fabiomirmar@xxxxxxxxx" <fabiomirmar@xxxxxxxxx>,	"alejandro.j.jimenez@xxxxxxxxxx" <alejandro.j.jimenez@xxxxxxxxxx>,	"andriy.shevchenko@xxxxxxxxxxxxxxx" <andriy.shevchenko@xxxxxxxxxxxxxxx>,	"arnd@xxxxxxxx" <arnd@xxxxxxxx>, "bp@xxxxxxxxx" <bp@xxxxxxxxx>,	"corbet@xxxxxxx" <corbet@xxxxxxx>, "d.hatayama@xxxxxxxxxxxxxx"	<d.hatayama@xxxxxxxxxxxxxx>, "dave.hansen@xxxxxxxxxxxxxxx"	<dave.hansen@xxxxxxxxxxxxxxx>, "dyoung@xxxxxxxxxx" <dyoung@xxxxxxxxxx>,	"feng.tang@xxxxxxxxx" <feng.tang@xxxxxxxxx>, "gregkh@xxxxxxxxxxxxxxxxxxx"	<gregkh@xxxxxxxxxxxxxxxxxxx>, "hidehiro.kawai.ez@xxxxxxxxxxx"	<hidehiro.kawai.ez@xxxxxxxxxxx>, "jgross@xxxxxxxx" <jgross@xxxxxxxx>,	"john.ogness@xxxxxxxxxxxxx" <john.ogness@xxxxxxxxxxxxx>,	"keescook@xxxxxxxxxxxx" <keescook@xxxxxxxxxxxx>, "luto@xxxxxxxxxx"	<luto@xxxxxxxxxx>, "mhiramat@xxxxxxxxxx" <mhiramat@xxxxxxxxxx>,	"mingo@xxxxxxxxxx" <mingo@xxxxxxxxxx>, "paulmck@xxxxxxxxxx"	<paulmck@xxxxxxxxxx>, "peterz@xxxxxxxxxxxxx" <peterz@xxxxxxxxxxxxx>,	"rostedt@xxxxxxxxxxx" <rostedt@xxxxxxxxxxx>, "senozhatsky@xxxxxxxxxxxx"	<senozhatsky@xxxxxxxxxxxx>, "stern@xxxxxxxxxxxxxxxxxxx"	<stern@xxxxxxxxxxxxxxxxxxx>, "tglx@xxxxxxxxxxxxx" <tglx@xxxxxxxxxxxxx>,	"vgoyal@xxxxxxxxxx" <vgoyal@xxxxxxxxxx>, vkuznets <vkuznets@xxxxxxxxxx>,	"will@xxxxxxxxxx" <will@xxxxxxxxxx>, Marc Zyngier <maz@xxxxxxxxxx>, Russell King <linux@xxxxxxxxxxxxxxx>
 
- Delivery-date: Fri, 29 Apr 2022 16:26:28 +0000
 
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
 
- Msip_labels:  MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=da7688d4-abf9-471b-8371-b8d1f4f7a276;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2022-04-29T16:24:00Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47;
 
- Thread-index: AQHYWolciKXO2fn1XUueFH8wz+psXK0HFf6Q
 
- Thread-topic: [PATCH 02/30] ARM: kexec: Disable IRQs/FIQs also on crash CPUs shutdown path
 
 
 
From: Guilherme G. Piccoli <gpiccoli@xxxxxxxxxx> Sent: Wednesday, April 27, 
2022 3:49 PM
> 
> Currently the regular CPU shutdown path for ARM disables IRQs/FIQs
> in the secondary CPUs - smp_send_stop() calls ipi_cpu_stop(), which
> is responsible for that. This makes sense, since we're turning off
> such CPUs, putting them in an endless busy-wait loop.
> 
> Problem is that there is an alternative path for disabling CPUs,
> in the form of function crash_smp_send_stop(), used for kexec/panic
> paths. This functions relies in a SMP call that also triggers a
s/functions relies in/function relies on/
> busy-wait loop [at machine_crash_nonpanic_core()], but *without*
> disabling interrupts. This might lead to odd scenarios, like early
> interrupts in the boot of kexec'd kernel or even interrupts in
> other CPUs while the main one still works in the panic path and
> assumes all secondary CPUs are (really!) off.
> 
> This patch mimics the ipi_cpu_stop() interrupt disable mechanism
> in the crash CPU shutdown path, hence disabling IRQs/FIQs in all
> secondary CPUs in the kexec/panic path as well.
> 
> Cc: Marc Zyngier <maz@xxxxxxxxxx>
> Cc: Russell King <linux@xxxxxxxxxxxxxxx>
> Signed-off-by: Guilherme G. Piccoli <gpiccoli@xxxxxxxxxx>
> ---
>  arch/arm/kernel/machine_kexec.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c
> index f567032a09c0..ef788ee00519 100644
> --- a/arch/arm/kernel/machine_kexec.c
> +++ b/arch/arm/kernel/machine_kexec.c
> @@ -86,6 +86,9 @@ void machine_crash_nonpanic_core(void *unused)
>       set_cpu_online(smp_processor_id(), false);
>       atomic_dec(&waiting_for_crash_ipi);
> 
> +     local_fiq_disable();
> +     local_irq_disable();
> +
>       while (1) {
>               cpu_relax();
>               wfe();
> --
> 2.36.0
 
    
     |