Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1550608 > unrolled thread

[RFC PATCH] x86: call smp vmxoff in smp stop

Started byXishi Qiu <qiuxishi@huawei.com>
First post2017-01-04 11:20 +0100
Last post2017-01-15 01:50 +0100
Articles 7 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [RFC PATCH] x86: call smp vmxoff in smp stop Xishi Qiu <qiuxishi@huawei.com> - 2017-01-04 11:20 +0100
    [RFC PATCH V2] x86: call smp vmxoff in smp stop Xishi Qiu <qiuxishi@huawei.com> - 2017-01-05 02:50 +0100
      Re: [RFC PATCH V2] x86: call smp vmxoff in smp stop Paolo Bonzini <pbonzini@redhat.com> - 2017-01-12 15:10 +0100
      [PATCH V3] x86: call smp vmxoff in smp stop Xishi Qiu <qiuxishi@huawei.com> - 2017-01-14 02:50 +0100
    Re: [PATCH] x86: call smp vmxoff in smp stop Xishi Qiu <qiuxishi@huawei.com> - 2017-01-14 02:50 +0100
    [PATCH] x86: call smp vmxoff in smp stop Xishi Qiu <qiuxishi@huawei.com> - 2017-01-14 02:50 +0100
      Re: [PATCH] x86: call smp vmxoff in smp stop kbuild test robot <lkp@intel.com> - 2017-01-15 01:50 +0100

#1550608 — [RFC PATCH] x86: call smp vmxoff in smp stop

FromXishi Qiu <qiuxishi@huawei.com>
Date2017-01-04 11:20 +0100
Subject[RFC PATCH] x86: call smp vmxoff in smp stop
Message-ID<sVQPL-3lt-11@gated-at.bofh.it>
From: f00186668 <fengtiantian@huawei.com>

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 <fengtiantian@huawei.com>
---
 arch/x86/kernel/smp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c
index 68f8cc2..6b64c6b 100644
--- a/arch/x86/kernel/smp.c
+++ b/arch/x86/kernel/smp.c
@@ -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();
 }
-- 
1.8.3.1 

[toc] | [next] | [standalone]


#1551550 — [RFC PATCH V2] x86: call smp vmxoff in smp stop

FromXishi Qiu <qiuxishi@huawei.com>
Date2017-01-05 02:50 +0100
Subject[RFC PATCH V2] x86: call smp vmxoff in smp stop
Message-ID<sW5lL-4mv-1@gated-at.bofh.it>
In reply to#1550608
From: f00186668 <fengtiantian@huawei.com>

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 <fengtiantian@huawei.com>
---
 arch/x86/kernel/smp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c
index 68f8cc2..b574d55 100644
--- a/arch/x86/kernel/smp.c
+++ b/arch/x86/kernel/smp.c
@@ -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();
 }
-- 
1.8.3.1

[toc] | [prev] | [next] | [standalone]


#1557470 — Re: [RFC PATCH V2] x86: call smp vmxoff in smp stop

FromPaolo Bonzini <pbonzini@redhat.com>
Date2017-01-12 15:10 +0100
SubjectRe: [RFC PATCH V2] x86: call smp vmxoff in smp stop
Message-ID<sYOeK-4W1-9@gated-at.bofh.it>
In reply to#1551550

On 05/01/2017 02:45, Xishi Qiu wrote:
> From: f00186668 <fengtiantian@huawei.com>
> 
> 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 <fengtiantian@huawei.com>

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

> ---
>  arch/x86/kernel/smp.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c
> index 68f8cc2..b574d55 100644
> --- a/arch/x86/kernel/smp.c
> +++ b/arch/x86/kernel/smp.c
> @@ -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();
>  }
> 

[toc] | [prev] | [next] | [standalone]


#1558817 — [PATCH V3] x86: call smp vmxoff in smp stop

FromXishi Qiu <qiuxishi@huawei.com>
Date2017-01-14 02:50 +0100
Subject[PATCH V3] x86: call smp vmxoff in smp stop
Message-ID<sZlDH-8g9-1@gated-at.bofh.it>
In reply to#1551550
From: Tiantian Feng <fengtiantian@huawei.com>

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 <fengtiantian@huawei.com>
---
 arch/x86/kernel/smp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c
index 68f8cc2..b574d55 100644
--- a/arch/x86/kernel/smp.c
+++ b/arch/x86/kernel/smp.c
@@ -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();
 }
-- 
1.8.3.1 

[toc] | [prev] | [next] | [standalone]


#1558820 — Re: [PATCH] x86: call smp vmxoff in smp stop

FromXishi Qiu <qiuxishi@huawei.com>
Date2017-01-14 02:50 +0100
SubjectRe: [PATCH] x86: call smp vmxoff in smp stop
Message-ID<sZlDH-8g9-7@gated-at.bofh.it>
In reply to#1550608
On 2017/1/14 9:36, Xishi Qiu wrote:

> From: Tiantian Feng <fengtiantian@huawei.com>
> 
> 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 <fengtiantian@huawei.com>
> ---

Sorry, I missed something, please ignore this one, thanks.

>  arch/x86/kernel/smp.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c
> index 68f8cc2..6b64c6b 100644
> --- a/arch/x86/kernel/smp.c
> +++ b/arch/x86/kernel/smp.c
> @@ -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();
>  }

[toc] | [prev] | [next] | [standalone]


#1558821 — [PATCH] x86: call smp vmxoff in smp stop

FromXishi Qiu <qiuxishi@huawei.com>
Date2017-01-14 02:50 +0100
Subject[PATCH] x86: call smp vmxoff in smp stop
Message-ID<sZlDH-8g9-9@gated-at.bofh.it>
In reply to#1550608
From: Tiantian Feng <fengtiantian@huawei.com>

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 <fengtiantian@huawei.com>
---
 arch/x86/kernel/smp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c
index 68f8cc2..6b64c6b 100644
--- a/arch/x86/kernel/smp.c
+++ b/arch/x86/kernel/smp.c
@@ -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();
 }
-- 
1.8.3.1 . 

[toc] | [prev] | [next] | [standalone]


#1559122 — Re: [PATCH] x86: call smp vmxoff in smp stop

Fromkbuild test robot <lkp@intel.com>
Date2017-01-15 01:50 +0100
SubjectRe: [PATCH] x86: call smp vmxoff in smp stop
Message-ID<sZHbc-4i0-7@gated-at.bofh.it>
In reply to#1558821

[Multipart message — attachments visible in raw view] — view raw

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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web