From: Sean Christopherson <sean.j.christopherson@intel.com>
To: Qian Cai <cai@lca.pw>
Cc: Marco Elver <elver@google.com>,
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: Fri, 10 Apr 2020 09:06:04 -0700 [thread overview]
Message-ID: <20200410160603.GA23354@linux.intel.com> (raw)
In-Reply-To: <B798749E-F2F0-4A14-AFE3-F386AB632AEB@lca.pw>
On Fri, Apr 10, 2020 at 11:50:10AM -0400, Qian Cai wrote:
>
> This works,
>
> --- 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);
>
> Does anyone has any idea why svm_vcpu_run() would be a problem for
> KCSAN_INTERRUPT_WATCHER=y?
>
> I can only see there are a bunch of assembly code in __svm_vcpu_run() that
> might be related?
svm_vcpu_run() does all kinds of interrupt toggling, e.g. the sequence is:
1. EFLAGS.IF == 0, from caller
2. clgi()
3. EFLAGS.IF <= 1
4. __svm_vcpu_run(), i.e. enter guest
5. EFLAGS == 0, from VM-Exit
6. EFLAGS.IF <= 1
7. stgi()
next prev parent reply other threads:[~2020-04-10 16:06 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
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 [this message]
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=20200410160603.GA23354@linux.intel.com \
--to=sean.j.christopherson@intel.com \
--cc=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