linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] kvm/svm: disable KCSAN for svm_vcpu_run()
@ 2020-04-15 15:37 Qian Cai
  2020-04-15 15:57 ` Paolo Bonzini
  0 siblings, 1 reply; 5+ messages in thread
From: Qian Cai @ 2020-04-15 15:37 UTC (permalink / raw)
  To: paulmck, pbonzini
  Cc: elver, sean.j.christopherson, kasan-dev, kvm, linux-kernel, Qian Cai

For some reasons, running a simple qemu-kvm command with KCSAN will
reset AMD hosts. It turns out svm_vcpu_run() could not be instrumented.
Disable it for now.

 # /usr/libexec/qemu-kvm -name ubuntu-18.04-server-cloudimg -cpu host
	-smp 2 -m 2G -hda ubuntu-18.04-server-cloudimg.qcow2

=== console output ===
Kernel 5.6.0-next-20200408+ on an x86_64

hp-dl385g10-05 login:

<...host reset...>

HPE ProLiant System BIOS A40 v1.20 (03/09/2018)
(C) Copyright 1982-2018 Hewlett Packard Enterprise Development LP
Early system initialization, please wait...

Signed-off-by: Qian Cai <cai@lca.pw>
---
 arch/x86/kvm/svm/svm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index 2be5bbae3a40..1fdb300e9337 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -3278,7 +3278,7 @@ static void svm_cancel_injection(struct kvm_vcpu *vcpu)
 
 bool __svm_vcpu_run(unsigned long vmcb_pa, unsigned long *regs);
 
-static void svm_vcpu_run(struct kvm_vcpu *vcpu)
+static __no_kcsan void svm_vcpu_run(struct kvm_vcpu *vcpu)
 {
 	struct vcpu_svm *svm = to_svm(vcpu);
 
-- 
2.21.0 (Apple Git-122.2)


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] kvm/svm: disable KCSAN for svm_vcpu_run()
  2020-04-15 15:37 [PATCH -next] kvm/svm: disable KCSAN for svm_vcpu_run() Qian Cai
@ 2020-04-15 15:57 ` Paolo Bonzini
  2020-04-15 16:30   ` Qian Cai
  2020-04-17 13:21   ` Qian Cai
  0 siblings, 2 replies; 5+ messages in thread
From: Paolo Bonzini @ 2020-04-15 15:57 UTC (permalink / raw)
  To: Qian Cai, paulmck
  Cc: elver, sean.j.christopherson, kasan-dev, kvm, linux-kernel

On 15/04/20 17:37, Qian Cai wrote:
> For some reasons, running a simple qemu-kvm command with KCSAN will
> reset AMD hosts. It turns out svm_vcpu_run() could not be instrumented.
> Disable it for now.
> 
>  # /usr/libexec/qemu-kvm -name ubuntu-18.04-server-cloudimg -cpu host
> 	-smp 2 -m 2G -hda ubuntu-18.04-server-cloudimg.qcow2
> 
> === console output ===
> Kernel 5.6.0-next-20200408+ on an x86_64
> 
> hp-dl385g10-05 login:
> 
> <...host reset...>
> 
> HPE ProLiant System BIOS A40 v1.20 (03/09/2018)
> (C) Copyright 1982-2018 Hewlett Packard Enterprise Development LP
> Early system initialization, please wait...
> 
> Signed-off-by: Qian Cai <cai@lca.pw>
> ---
>  arch/x86/kvm/svm/svm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
> index 2be5bbae3a40..1fdb300e9337 100644
> --- a/arch/x86/kvm/svm/svm.c
> +++ b/arch/x86/kvm/svm/svm.c
> @@ -3278,7 +3278,7 @@ static void svm_cancel_injection(struct kvm_vcpu *vcpu)
>  
>  bool __svm_vcpu_run(unsigned long vmcb_pa, unsigned long *regs);
>  
> -static void svm_vcpu_run(struct kvm_vcpu *vcpu)
> +static __no_kcsan void svm_vcpu_run(struct kvm_vcpu *vcpu)
>  {
>  	struct vcpu_svm *svm = to_svm(vcpu);
>  
> 

I suppose you tested the patch to move cli/sti into the .S file.  Anyway:

Acked-by: Paolo Bonzini <pbonzini@redhat.com>

Thanks,

Paolo


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] kvm/svm: disable KCSAN for svm_vcpu_run()
  2020-04-15 15:57 ` Paolo Bonzini
@ 2020-04-15 16:30   ` Qian Cai
  2020-04-17 13:21   ` Qian Cai
  1 sibling, 0 replies; 5+ messages in thread
From: Qian Cai @ 2020-04-15 16:30 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: paul E. McKenney, Elver Marco, Sean Christopherson, kasan-dev,
	kvm, linux-kernel



> On Apr 15, 2020, at 11:57 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> 
> On 15/04/20 17:37, Qian Cai wrote:
>> For some reasons, running a simple qemu-kvm command with KCSAN will
>> reset AMD hosts. It turns out svm_vcpu_run() could not be instrumented.
>> Disable it for now.
>> 
>> # /usr/libexec/qemu-kvm -name ubuntu-18.04-server-cloudimg -cpu host
>> 	-smp 2 -m 2G -hda ubuntu-18.04-server-cloudimg.qcow2
>> 
>> === console output ===
>> Kernel 5.6.0-next-20200408+ on an x86_64
>> 
>> hp-dl385g10-05 login:
>> 
>> <...host reset...>
>> 
>> HPE ProLiant System BIOS A40 v1.20 (03/09/2018)
>> (C) Copyright 1982-2018 Hewlett Packard Enterprise Development LP
>> Early system initialization, please wait...
>> 
>> Signed-off-by: Qian Cai <cai@lca.pw>
>> ---
>> arch/x86/kvm/svm/svm.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
>> index 2be5bbae3a40..1fdb300e9337 100644
>> --- a/arch/x86/kvm/svm/svm.c
>> +++ b/arch/x86/kvm/svm/svm.c
>> @@ -3278,7 +3278,7 @@ static void svm_cancel_injection(struct kvm_vcpu *vcpu)
>> 
>> bool __svm_vcpu_run(unsigned long vmcb_pa, unsigned long *regs);
>> 
>> -static void svm_vcpu_run(struct kvm_vcpu *vcpu)
>> +static __no_kcsan void svm_vcpu_run(struct kvm_vcpu *vcpu)
>> {
>> 	struct vcpu_svm *svm = to_svm(vcpu);
>> 
>> 
> 
> I suppose you tested the patch to move cli/sti into the .S file.  Anyway:

Yes, tested that without any luck.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] kvm/svm: disable KCSAN for svm_vcpu_run()
  2020-04-15 15:57 ` Paolo Bonzini
  2020-04-15 16:30   ` Qian Cai
@ 2020-04-17 13:21   ` Qian Cai
  2020-04-17 15:17     ` Paul E. McKenney
  1 sibling, 1 reply; 5+ messages in thread
From: Qian Cai @ 2020-04-17 13:21 UTC (permalink / raw)
  To: paul E. McKenney
  Cc: Elver Marco, Sean Christopherson, kasan-dev, kvm, LKML, Paolo Bonzini



> On Apr 15, 2020, at 11:57 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> 
> On 15/04/20 17:37, Qian Cai wrote:
>> For some reasons, running a simple qemu-kvm command with KCSAN will
>> reset AMD hosts. It turns out svm_vcpu_run() could not be instrumented.
>> Disable it for now.
>> 
>> # /usr/libexec/qemu-kvm -name ubuntu-18.04-server-cloudimg -cpu host
>> 	-smp 2 -m 2G -hda ubuntu-18.04-server-cloudimg.qcow2
>> 
>> === console output ===
>> Kernel 5.6.0-next-20200408+ on an x86_64
>> 
>> hp-dl385g10-05 login:
>> 
>> <...host reset...>
>> 
>> HPE ProLiant System BIOS A40 v1.20 (03/09/2018)
>> (C) Copyright 1982-2018 Hewlett Packard Enterprise Development LP
>> Early system initialization, please wait...
>> 
>> Signed-off-by: Qian Cai <cai@lca.pw>
>> ---
>> arch/x86/kvm/svm/svm.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
>> index 2be5bbae3a40..1fdb300e9337 100644
>> --- a/arch/x86/kvm/svm/svm.c
>> +++ b/arch/x86/kvm/svm/svm.c
>> @@ -3278,7 +3278,7 @@ static void svm_cancel_injection(struct kvm_vcpu *vcpu)
>> 
>> bool __svm_vcpu_run(unsigned long vmcb_pa, unsigned long *regs);
>> 
>> -static void svm_vcpu_run(struct kvm_vcpu *vcpu)
>> +static __no_kcsan void svm_vcpu_run(struct kvm_vcpu *vcpu)
>> {
>> 	struct vcpu_svm *svm = to_svm(vcpu);
>> 
>> 
> 
> I suppose you tested the patch to move cli/sti into the .S file.  Anyway:
> 
> Acked-by: Paolo Bonzini <pbonzini@redhat.com>

Paul, can you pick this up along with other KCSAN fixes?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] kvm/svm: disable KCSAN for svm_vcpu_run()
  2020-04-17 13:21   ` Qian Cai
@ 2020-04-17 15:17     ` Paul E. McKenney
  0 siblings, 0 replies; 5+ messages in thread
From: Paul E. McKenney @ 2020-04-17 15:17 UTC (permalink / raw)
  To: Qian Cai
  Cc: Elver Marco, Sean Christopherson, kasan-dev, kvm, LKML, Paolo Bonzini

On Fri, Apr 17, 2020 at 09:21:59AM -0400, Qian Cai wrote:
> 
> 
> > On Apr 15, 2020, at 11:57 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> > 
> > On 15/04/20 17:37, Qian Cai wrote:
> >> For some reasons, running a simple qemu-kvm command with KCSAN will
> >> reset AMD hosts. It turns out svm_vcpu_run() could not be instrumented.
> >> Disable it for now.
> >> 
> >> # /usr/libexec/qemu-kvm -name ubuntu-18.04-server-cloudimg -cpu host
> >> 	-smp 2 -m 2G -hda ubuntu-18.04-server-cloudimg.qcow2
> >> 
> >> === console output ===
> >> Kernel 5.6.0-next-20200408+ on an x86_64
> >> 
> >> hp-dl385g10-05 login:
> >> 
> >> <...host reset...>
> >> 
> >> HPE ProLiant System BIOS A40 v1.20 (03/09/2018)
> >> (C) Copyright 1982-2018 Hewlett Packard Enterprise Development LP
> >> Early system initialization, please wait...
> >> 
> >> Signed-off-by: Qian Cai <cai@lca.pw>
> >> ---
> >> arch/x86/kvm/svm/svm.c | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >> 
> >> diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
> >> index 2be5bbae3a40..1fdb300e9337 100644
> >> --- a/arch/x86/kvm/svm/svm.c
> >> +++ b/arch/x86/kvm/svm/svm.c
> >> @@ -3278,7 +3278,7 @@ static void svm_cancel_injection(struct kvm_vcpu *vcpu)
> >> 
> >> bool __svm_vcpu_run(unsigned long vmcb_pa, unsigned long *regs);
> >> 
> >> -static void svm_vcpu_run(struct kvm_vcpu *vcpu)
> >> +static __no_kcsan void svm_vcpu_run(struct kvm_vcpu *vcpu)
> >> {
> >> 	struct vcpu_svm *svm = to_svm(vcpu);
> >> 
> >> 
> > 
> > I suppose you tested the patch to move cli/sti into the .S file.  Anyway:
> > 
> > Acked-by: Paolo Bonzini <pbonzini@redhat.com>
> 
> Paul, can you pick this up along with other KCSAN fixes?

Queued and pushed, thank you both!

							Thanx, Paul

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-04-17 15:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-15 15:37 [PATCH -next] kvm/svm: disable KCSAN for svm_vcpu_run() Qian Cai
2020-04-15 15:57 ` Paolo Bonzini
2020-04-15 16:30   ` Qian Cai
2020-04-17 13:21   ` Qian Cai
2020-04-17 15:17     ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).