Re: KCSAN + KVM = host reset

Marco Elver
2020-04-10T11:35:48Z

On Fri, 10 Apr 2020 at 13:25, Qian Cai <cai@lca.pw> wrote:
>
>
>
> > On Apr 10, 2020, at 5:47 AM, Marco Elver <elver@google.com> wrote:
> >
> > That would contradict what you said about it working if KCSAN is
> > "off". What kernel are you attempting to use in the VM?

Ah, sorry this was a typo,
s/working if KCSAN/not working if KCSAN/

> Well, I said set KCSAN debugfs to “off” did not help, i.e., it will reset the host running kvm.sh. It is the vanilla ubuntu 18.04 kernel in VM.
>
> github.com/cailca/linux-mm/blob/master/kvm.sh

So, if you say that CONFIG_KCSAN_INTERRUPT_WATCHER=n works, that
contradicts it not working when KCSAN is "off". Because if KCSAN is
off, it never sets up any watchpoints, and whether or not
KCSAN_INTERRUPT_WATCHER is selected or not shouldn't matter. Does that
make more sense?

But from what you say, it's not the type of kernel run in VM. I just
thought there may be some strange interaction if you also run a KCSAN
kernel inside the VM.

Since I have no way to help debug right now, if you say that
"KCSAN_SANITIZE_svm.o := n" works, I'd suggest that you just send a
patch for that. If you think that's not adequate, it may be possible
to try and find the offending function(s) in that file and add
__no_kcsan to the function(s) that cause problems.

Thanks,
-- Marco