x86: call smp vmxoff in smp stop
RFC PATCH 1/1 x86: call smp vmxoff in smp stop
From: f00186668 <[email protected]>
We need to disable VMX on all CPUs before stop cpu when OS panic, otherwisewe risk hanging up the machine, because the CPU ignore INIT signals when VMX is enabled. In kernel mainline this issue existence.
--- arch/x86/kernel/smp.c | 2 ++ 1 file changed, 2 insertions(+)
arch/x86/kernel/smp.c +2 -0
@@ -162,6 +162,7 @@ static int smp_stop_nmi_callback(unsigned int val, struct pt_regs *regs)if (raw_smp_processor_id () ==atomic_read (&stopping_cpu))return NMI_HANDLED ; +cpu_emergency_vmxoff ();stop_this_cpu (NULL );return NMI_HANDLED ;
@@ -174,6 +175,7 @@ static int smp_stop_nmi_callback(unsigned int val, struct pt_regs *regs) asmlinkage __visible void smp_reboot_interrupt(void) {ipi_entering_ack_irq (); +cpu_emergency_vmxoff ();stop_this_cpu (NULL );irq_exit (); }
Signature · 1 line
1.8.3.1
RFC PATCH v2 1/1 x86: call smp vmxoff in smp stop
From: f00186668 <[email protected]>
We need to disable VMX on all CPUs before stop cpu when OS panic, otherwisewe risk hanging up the machine, because the CPU ignore INIT signals when VMX is enabled. In kernel mainline this issue existence.
--- arch/x86/kernel/smp.c | 3 +++ 1 file changed, 3 insertions(+)
arch/x86/kernel/smp.c +3 -0
@@ -33,6 +33,7 @@#include <asm/mce.h> #include <asm/trace/irq_vectors.h> #include <asm/kexec.h> +#include <asm/virtext.h> /* * Some notes on x86 processor bugs affecting SMP operation:
@@ -162,6 +163,7 @@ static int smp_stop_nmi_callback(unsigned int val, struct pt_regs *regs)if (raw_smp_processor_id () ==atomic_read (&stopping_cpu))return NMI_HANDLED ; +cpu_emergency_vmxoff ();stop_this_cpu (NULL );return NMI_HANDLED ;
@@ -174,6 +176,7 @@ static int smp_stop_nmi_callback(unsigned int val, struct pt_regs *regs) asmlinkage __visible void smp_reboot_interrupt(void) {ipi_entering_ack_irq (); +cpu_emergency_vmxoff ();stop_this_cpu (NULL );irq_exit (); }
Signature · 1 line
1.8.3.1
Quoted 7 lines · Xishi Qiu
From:
f00186668<[email protected]>We need to disable VMX on all CPUs before stop cpu when OS panic, otherwisewe risk hanging up the machine, because the CPU ignore INIT signals when VMX is enabled. In kernel mainline this issue existence.
Signed-off-by f00186668 <[email protected]>
Looks good, but you need to put your colleague's real name (Tiantian Feng?) in the Signed-off-by line, and you need another Signed-off-by line for yourself.
Thanks,
Paolo
Quoted 33 lines
--- arch/x86/kernel/smp.c | 3 +++ 1 file changed, 3 insertions(+)arch/x86/kernel/smp.c +3
-0@@ -33,6 +33,7 @@#include <asm/mce.h> #include <asm/trace/irq_vectors.h> #include <asm/kexec.h> +#include <asm/virtext.h> /* * Some notes on x86 processor bugs affecting SMP operation: @@ -162,6 +163,7 @@ static int smp_stop_nmi_callback(unsigned int val, struct pt_regs *regs)if (raw_smp_processor_id () ==atomic_read (&stopping_cpu))return NMI_HANDLED ; +cpu_emergency_vmxoff ();stop_this_cpu (NULL );return NMI_HANDLED ;@@ -174,6 +176,7 @@ static int smp_stop_nmi_callback(unsigned int val, struct pt_regs *regs) asmlinkage __visible void smp_reboot_interrupt(void) {ipi_entering_ack_irq (); +cpu_emergency_vmxoff ();stop_this_cpu (NULL );irq_exit (); }
PATCH 1/1 x86: call smp vmxoff in smp stop
In reply to Xishi QiuFrom: Tiantian Feng <[email protected]>
We need to disable VMX on all CPUs before stop cpu when OS panic, otherwisewe risk hanging up the machine, because the CPU ignore INIT signals when VMX is enabled. In kernel mainline this issue existence.
--- arch/x86/kernel/smp.c | 2 ++ 1 file changed, 2 insertions(+)
arch/x86/kernel/smp.c +2 -0
@@ -162,6 +162,7 @@ static int smp_stop_nmi_callback(unsigned int val, struct pt_regs *regs)if (raw_smp_processor_id () ==atomic_read (&stopping_cpu))return NMI_HANDLED ; +cpu_emergency_vmxoff ();stop_this_cpu (NULL );return NMI_HANDLED ;
@@ -174,6 +175,7 @@ static int smp_stop_nmi_callback(unsigned int val, struct pt_regs *regs) asmlinkage __visible void smp_reboot_interrupt(void) {ipi_entering_ack_irq (); +cpu_emergency_vmxoff ();stop_this_cpu (NULL );irq_exit (); }
Signature · 1 line
1.8.3.1 .
Quoted 8 lines · Xishi Qiu
From: Tiantian Feng <[email protected]>
We need to disable VMX on all CPUs before stop cpu when OS panic, otherwisewe risk hanging up the machine, because the CPU ignore INIT signals when VMX is enabled. In kernel mainline this issue existence.
Signed-off-by Tiantian Feng <[email protected]>---
Sorry, I missed something, please ignore this one, thanks.
Quoted 23 lines
arch/x86/kernel/smp.c | 2 ++ 1 file changed, 2 insertions(+)arch/x86/kernel/smp.c +2
-0@@ -162,6 +162,7 @@ static int smp_stop_nmi_callback(unsigned int val, struct pt_regs *regs)if (raw_smp_processor_id () ==atomic_read (&stopping_cpu))return NMI_HANDLED ; +cpu_emergency_vmxoff ();stop_this_cpu (NULL );return NMI_HANDLED ;@@ -174,6 +175,7 @@ static int smp_stop_nmi_callback(unsigned int val, struct pt_regs *regs) asmlinkage __visible void smp_reboot_interrupt(void) {ipi_entering_ack_irq (); +cpu_emergency_vmxoff ();stop_this_cpu (NULL );irq_exit (); }
PATCH v3 1/1 x86: call smp vmxoff in smp stop
In reply to Xishi QiuFrom: Tiantian Feng <[email protected]>
We need to disable VMX on all CPUs before stop cpu when OS panic, otherwisewe risk hanging up the machine, because the CPU ignore INIT signals when VMX is enabled. In kernel mainline this issue existence.
--- arch/x86/kernel/smp.c | 3 +++ 1 file changed, 3 insertions(+)
arch/x86/kernel/smp.c +3 -0
@@ -33,6 +33,7 @@#include <asm/mce.h> #include <asm/trace/irq_vectors.h> #include <asm/kexec.h> +#include <asm/virtext.h> /* * Some notes on x86 processor bugs affecting SMP operation:
@@ -162,6 +163,7 @@ static int smp_stop_nmi_callback(unsigned int val, struct pt_regs *regs)if (raw_smp_processor_id () ==atomic_read (&stopping_cpu))return NMI_HANDLED ; +cpu_emergency_vmxoff ();stop_this_cpu (NULL );return NMI_HANDLED ;
@@ -174,6 +176,7 @@ static int smp_stop_nmi_callback(unsigned int val, struct pt_regs *regs) asmlinkage __visible void smp_reboot_interrupt(void) {ipi_entering_ack_irq (); +cpu_emergency_vmxoff ();stop_this_cpu (NULL );irq_exit (); }
Signature · 1 line
1.8.3.1
kbuild test robot
build boturl: https://github.com/0day-ci/linux/commits/Xishi-Qiu/x86-call-smp-vmxoff-in-smp-stop/20170115-075446 config: x86_64-randconfig-x017-201703 (attached as .config) compiler: gcc-6 (Debian 6.2.0-3)…
Hi Tiantian,
[auto build test ERROR on tip/auto-latest]
[also build test ERROR on v4.10-rc3 next-20170113]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Xishi-Qiu/x86-call-smp-vmxoff-in-smp-stop/20170115-075446
config: x86_64-randconfig-x017-201703 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64 All errors (new ones prefixed by >>):
arch/x86/kernel/smp.c: In function 'smp_stop_nmi_callback':
>> arch/x86/kernel/smp.c:165:2: error: implicit declaration of function 'cpu_emergency_vmxoff' [-Werror=implicit-function-declaration]
cpu_emergency_vmxoff();
^~~~~~~~~~~~~~~~~~~~cc1: some warnings being treated as errors
vim +/cpu_emergency_vmxoff +165 arch/x86/kernel/smp.c
159 static int smp_stop_nmi_callback(unsigned int val, struct pt_regs *regs)
160 {
161 /* We are registered on stopping cpu too, avoid spurious NMI */
162 if (raw_smp_processor_id() == atomic_read(&stopping_cpu))
163 return NMI_HANDLED;
164
> 165 cpu_emergency_vmxoff();
166 stop_this_cpu(NULL);
167
168 return NMI_HANDLED;
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Quoted 7 lines · Xishi Qiu
From: Tiantian Feng <[email protected]>
We need to disable VMX on all CPUs before stop cpu when OS panic, otherwisewe risk hanging up the machine, because the CPU ignore INIT signals when VMX is enabled. In kernel mainline this issue existence.
Signed-off-by Tiantian Feng <[email protected]>
Xishi,
it's still missing your Signed-off-by.
Paolo
Quoted 33 lines
--- arch/x86/kernel/smp.c | 3 +++ 1 file changed, 3 insertions(+)arch/x86/kernel/smp.c +3
-0@@ -33,6 +33,7 @@#include <asm/mce.h> #include <asm/trace/irq_vectors.h> #include <asm/kexec.h> +#include <asm/virtext.h> /* * Some notes on x86 processor bugs affecting SMP operation: @@ -162,6 +163,7 @@ static int smp_stop_nmi_callback(unsigned int val, struct pt_regs *regs)if (raw_smp_processor_id () ==atomic_read (&stopping_cpu))return NMI_HANDLED ; +cpu_emergency_vmxoff ();stop_this_cpu (NULL );return NMI_HANDLED ;@@ -174,6 +176,7 @@ static int smp_stop_nmi_callback(unsigned int val, struct pt_regs *regs) asmlinkage __visible void smp_reboot_interrupt(void) {ipi_entering_ack_irq (); +cpu_emergency_vmxoff ();stop_this_cpu (NULL );irq_exit (); }
Quoted 9 lines · Paolo Bonzini
Quoted 6 lines · Xishi Qiu
From: Tiantian Feng <[email protected]>
We need to disable VMX on all CPUs before stop cpu when OS panic, otherwisewe risk hanging up the machine, because the CPU ignore INIT signals when VMX is enabled. In kernel mainline this issue existence.
Quoted 6 lines
Quoted 1 line
Signed-off-by Tiantian Feng <[email protected]>Xishi,
it's still missing your Signed-off-by.
Hi Paolo,
This patch is from fengtiantian, and I just send it for him, so still should add my SOB?
Thanks,
Xishi Qiu
Quoted 38 lines
Paolo
Quoted 26 lines
--- arch/x86/kernel/smp.c | 3 +++ 1 file changed, 3 insertions(+)arch/x86/kernel/smp.c +2
-0@@ -33,6 +33,7 @@#include <asm/mce.h> #include <asm/trace/irq_vectors.h> #include <asm/kexec.h> +#include <asm/virtext.h> /* * Some notes on x86 processor bugs affecting SMP operation: @@ -162,6 +163,7 @@ static int smp_stop_nmi_callback(unsigned int val, struct pt_regs *regs)if (raw_smp_processor_id () ==atomic_read (&stopping_cpu))return NMI_HANDLED ; +cpu_emergency_vmxoff ();stop_this_cpu (NULL );return NMI_HANDLED ;arch/x86/kernel/smp.c static int smp_stop_nmi_callback(unsigned int val, struct pt_regs *regs) · line 182
Quoted 7 lines
arch/x86/kernel/smp.c +1
-0@@ -174,6 +176,7 @@ static int smp_stop_nmi_callback(unsigned int val, struct pt_regs *regs) asmlinkage __visible void smp_reboot_interrupt(void) {ipi_entering_ack_irq (); +cpu_emergency_vmxoff ();stop_this_cpu (NULL );irq_exit (); }.
Quoted 15 lines · Xishi Qiu
Quoted 13 lines · Paolo Bonzini
Quoted 7 lines · Xishi Qiu
From: Tiantian Feng <[email protected]>
We need to disable VMX on all CPUs before stop cpu when OS panic, otherwisewe risk hanging up the machine, because the CPU ignore INIT signals when VMX is enabled. In kernel mainline this issue existence.
Signed-off-by Tiantian Feng <[email protected]>Xishi,
Quoted 7 lines
Quoted 2 lines
it's still missing your Signed-off-by.
Hi Paolo,
This patch is from fengtiantian, and I just send it for him, so still should add my SOB?
Yes, both of them should be there. The "signed-off-by" is a sequence of all people that managed the patch---so that would be Tiantian first, then you, then an x86 maintainer.
Paolo
Quoted 44 lines
Thanks,
Xishi QiuQuoted 38 lines
Paolo
Quoted 26 lines
--- arch/x86/kernel/smp.c | 3 +++ 1 file changed, 3 insertions(+)arch/x86/kernel/smp.c +2
-0@@ -33,6 +33,7 @@#include <asm/mce.h> #include <asm/trace/irq_vectors.h> #include <asm/kexec.h> +#include <asm/virtext.h> /* * Some notes on x86 processor bugs affecting SMP operation: @@ -162,6 +163,7 @@ static int smp_stop_nmi_callback(unsigned int val, struct pt_regs *regs)if (raw_smp_processor_id () ==atomic_read (&stopping_cpu))return NMI_HANDLED ; +cpu_emergency_vmxoff ();stop_this_cpu (NULL );return NMI_HANDLED ;arch/x86/kernel/smp.c static int smp_stop_nmi_callback(unsigned int val, struct pt_regs *regs) · line 182
Quoted 7 lines
arch/x86/kernel/smp.c +1
-0@@ -174,6 +176,7 @@ static int smp_stop_nmi_callback(unsigned int val, struct pt_regs *regs) asmlinkage __visible void smp_reboot_interrupt(void) {ipi_entering_ack_irq (); +cpu_emergency_vmxoff ();stop_this_cpu (NULL );irq_exit (); }.
PATCH v4 1/1 x86: call smp vmxoff in smp stop
In reply to Xishi QiuFrom: Tiantian Feng <[email protected]>
We need to disable VMX on all CPUs before stop cpu when OS panic, otherwisewe risk hanging up the machine, because the CPU ignore INIT signals when VMX is enabled. In kernel mainline this issue existence.
--- arch/x86/kernel/smp.c | 3 +++ 1 file changed, 3 insertions(+)
arch/x86/kernel/smp.c +3 -0
@@ -33,6 +33,7 @@#include <asm/mce.h> #include <asm/trace/irq_vectors.h> #include <asm/kexec.h> +#include <asm/virtext.h> /* * Some notes on x86 processor bugs affecting SMP operation:
@@ -162,6 +163,7 @@ static int smp_stop_nmi_callback(unsigned int val, struct pt_regs *regs)if (raw_smp_processor_id () ==atomic_read (&stopping_cpu))return NMI_HANDLED ; +cpu_emergency_vmxoff ();stop_this_cpu (NULL );return NMI_HANDLED ;
@@ -174,6 +176,7 @@ static int smp_stop_nmi_callback(unsigned int val, struct pt_regs *regs) asmlinkage __visible void smp_reboot_interrupt(void) {ipi_entering_ack_irq (); +cpu_emergency_vmxoff ();stop_this_cpu (NULL );irq_exit (); }
Signature · 3 lines
1.8.3.1 .
Ingo, can you put this in tip?
Thanks,
Paolo
Quoted 41 lines · Xishi Qiu
From: Tiantian Feng <[email protected]>
We need to disable VMX on all CPUs before stop cpu when OS panic, otherwisewe risk hanging up the machine, because the CPU ignore INIT signals when VMX is enabled. In kernel mainline this issue existence.
Signed-off-by Tiantian Feng <[email protected]>Signed-off-by Xishi Qiu <[email protected]>--- arch/x86/kernel/smp.c | 3 +++ 1 file changed, 3 insertions(+)arch/x86/kernel/smp.c +3
-0@@ -33,6 +33,7 @@#include <asm/mce.h> #include <asm/trace/irq_vectors.h> #include <asm/kexec.h> +#include <asm/virtext.h> /* * Some notes on x86 processor bugs affecting SMP operation: @@ -162,6 +163,7 @@ static int smp_stop_nmi_callback(unsigned int val, struct pt_regs *regs)if (raw_smp_processor_id () ==atomic_read (&stopping_cpu))return NMI_HANDLED ; +cpu_emergency_vmxoff ();stop_this_cpu (NULL );return NMI_HANDLED ;@@ -174,6 +176,7 @@ static int smp_stop_nmi_callback(unsigned int val, struct pt_regs *regs) asmlinkage __visible void smp_reboot_interrupt(void) {ipi_entering_ack_irq (); +cpu_emergency_vmxoff ();stop_this_cpu (NULL );irq_exit (); }
Quoted 12 lines · Paolo Bonzini
Ingo, can you put this in tip?
Thanks,
Paolo
Quoted 5 lines · Xishi Qiu
From: Tiantian Feng <[email protected]>
We need to disable VMX on all CPUs before stop cpu when OS panic, otherwisewe risk hanging up the machine, because the CPU ignore INIT signals when VMX is enabled. In kernel mainline this issue existence.
Yes, but the changelog is atrcious:
- title should describe the purpose, not the implementation
- CPU is spelled 'CPU' once, then 'cpu' _in the same sentence_!
- typos
- spelling
- the last sentence doesn't even parse ...
Still it's already at V4 and comes with two signoffs and what amounts to a maintainer Ack??
Thanks,
Ingo
Quoted 14 lines
Quoted 7 lines · Xishi Qiu
Quoted 5 lines
From: Tiantian Feng <[email protected]>
We need to disable VMX on all CPUs before stop cpu when OS panic, otherwisewe risk hanging up the machine, because the CPU ignore INIT signals when VMX is enabled. In kernel mainline this issue existence.
Yes, but the changelog is atrcious:
- title should describe the purpose, not the implementation
- CPU is spelled 'CPU' once, then 'cpu'
_inthe samesentence_!
Quoted 8 lines
- typos
- spelling
- the last sentence doesn't even parse ...
Still it's already at V4 and comes with two signoffs and what amounts to a maintainer Ack??
Well, the v2-v4 were really just about getting the signoffs right. At some point you just get desensitized about the changelog. :(
I'll post v5 with a rewritten commit message.
Paolo
Quoted 20 lines · Paolo Bonzini
Quoted 20 lines
Quoted 7 lines · Xishi Qiu
Quoted 5 lines
From: Tiantian Feng <[email protected]>
We need to disable VMX on all CPUs before stop cpu when OS panic, otherwisewe risk hanging up the machine, because the CPU ignore INIT signals when VMX is enabled. In kernel mainline this issue existence.
Yes, but the changelog is atrcious:
- title should describe the purpose, not the implementation
- CPU is spelled 'CPU' once, then 'cpu'
_inthe samesentence_!- typos
- spelling
- the last sentence doesn't even parse ...
Quoted 7 lines
Quoted 2 lines
Still it's already at V4 and comes with two signoffs and what amounts to a maintainer Ack??
Well, the v2-v4 were really just about getting the signoffs right. At some point you just get desensitized about the changelog. :(
I'll post v5 with a rewritten commit message.
Thanks!
Ingo