linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qian Cai <cai@lca.pw>
To: Marco Elver <elver@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	"paul E. McKenney" <paulmck@kernel.org>,
	kasan-dev <kasan-dev@googlegroups.com>,
	LKML <linux-kernel@vger.kernel.org>,
	kvm@vger.kernel.org
Subject: Re: KCSAN + KVM = host reset
Date: Thu, 9 Apr 2020 19:00:31 -0400	[thread overview]
Message-ID: <DF45D739-59F3-407C-BE8C-2B1E164B493B@lca.pw> (raw)
In-Reply-To: <B5F0F530-911E-4B75-886A-9D8C54FF49C8@lca.pw>



> On Apr 9, 2020, at 5:28 PM, Qian Cai <cai@lca.pw> wrote:
> 
> 
> 
>> On Apr 9, 2020, at 12:03 PM, Marco Elver <elver@google.com> wrote:
>> 
>> On Thu, 9 Apr 2020 at 17:30, Qian Cai <cai@lca.pw> wrote:
>>> 
>>> 
>>> 
>>>> On Apr 9, 2020, at 11:22 AM, Marco Elver <elver@google.com> wrote:
>>>> 
>>>> On Thu, 9 Apr 2020 at 17:10, Qian Cai <cai@lca.pw> wrote:
>>>>> 
>>>>> 
>>>>> 
>>>>>> On Apr 9, 2020, at 3:03 AM, Marco Elver <elver@google.com> wrote:
>>>>>> 
>>>>>> On Wed, 8 Apr 2020 at 23:29, Qian Cai <cai@lca.pw> wrote:
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>>> On Apr 8, 2020, at 5:25 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>>>>>>> 
>>>>>>>> On 08/04/20 22:59, Qian Cai wrote:
>>>>>>>>> Running a simple thing on this AMD host would trigger a reset right away.
>>>>>>>>> Unselect KCSAN kconfig makes everything work fine (the host would also
>>>>>>>>> reset If only "echo off > /sys/kernel/debug/kcsan” before running qemu-kvm).
>>>>>>>> 
>>>>>>>> Is this a regression or something you've just started to play with?  (If
>>>>>>>> anything, the assembly language conversion of the AMD world switch that
>>>>>>>> is in linux-next could have reduced the likelihood of such a failure,
>>>>>>>> not increased it).
>>>>>>> 
>>>>>>> I don’t remember I had tried this combination before, so don’t know if it is a
>>>>>>> regression or not.
>>>>>> 
>>>>>> What happens with KASAN? My guess is that, since it also happens with
>>>>>> "off", something that should not be instrumented is being
>>>>>> instrumented.
>>>>> 
>>>>> No, KASAN + KVM works fine.
>>>>> 
>>>>>> 
>>>>>> What happens if you put a 'KCSAN_SANITIZE := n' into
>>>>>> arch/x86/kvm/Makefile? Since it's hard for me to reproduce on this
>>>>> 
>>>>> Yes, that works, but this below alone does not work,
>>>>> 
>>>>> KCSAN_SANITIZE_kvm-amd.o := n
>>>> 
>>>> There are some other files as well, that you could try until you hit
>>>> the right one.
>>>> 
>>>> But since this is in arch, 'KCSAN_SANITIZE := n' wouldn't be too bad
>>>> for now. If you can't narrow it down further, do you want to send a
>>>> patch?
>>> 
>>> No, that would be pretty bad because it will disable KCSAN for Intel
>>> KVM as well which is working perfectly fine right now. It is only AMD
>>> is broken.
>> 
>> Interesting. Unfortunately I don't have access to an AMD machine right now.
>> 
>> Actually I think it should be:
>> 
>> KCSAN_SANITIZE_svm.o := n
>> KCSAN_SANITIZE_pmu_amd.o := n
>> 
>> If you want to disable KCSAN for kvm-amd.
> 
> KCSAN_SANITIZE_svm.o := n
> 
> That alone works fine. I am wondering which functions there could trigger
> perhaps some kind of recursing with KCSAN?

Another data point is set CONFIG_KCSAN_INTERRUPT_WATCHER=n alone
also fixed the issue. I saw quite a few interrupt related function in svm.c, so
some interrupt-related recursion going on?

  reply	other threads:[~2020-04-09 23:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-08 20:59 KCSAN + KVM = host reset Qian Cai
2020-04-08 21:25 ` Paolo Bonzini
2020-04-08 21:29   ` Qian Cai
2020-04-09  7:03     ` Marco Elver
2020-04-09 15:10       ` Qian Cai
2020-04-09 15:22         ` Marco Elver
2020-04-09 15:30           ` Qian Cai
2020-04-09 16:03             ` Marco Elver
2020-04-09 21:28               ` Qian Cai
2020-04-09 23:00                 ` Qian Cai [this message]
2020-04-10  9:47                   ` Marco Elver
2020-04-10 11:25                     ` Qian Cai
2020-04-10 11:35                       ` Marco Elver
2020-04-10 15:50                         ` Qian Cai
2020-04-10 16:04                           ` Paolo Bonzini
2020-04-10 16:06                           ` Sean Christopherson
2020-04-10 19:57                         ` Qian Cai
2020-04-13  8:35                           ` Marco Elver

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DF45D739-59F3-407C-BE8C-2B1E164B493B@lca.pw \
    --to=cai@lca.pw \
    --cc=elver@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).