From: Sean Christopherson <sean.j.christopherson@intel.com>
To: Jim Mattson <jmattson@google.com>
Cc: kvm list <kvm@vger.kernel.org>,
Paolo Bonzini <pbonzini@redhat.com>,
Liran Alon <liran.alon@oracle.com>,
Oliver Upton <oupton@google.com>, Peter Shier <pshier@google.com>
Subject: Re: [PATCH v3 3/4] kvm: vmx: Add last_cpu to struct vcpu_vmx
Date: Thu, 4 Jun 2020 12:26:22 -0700 [thread overview]
Message-ID: <20200604192622.GE30456@linux.intel.com> (raw)
In-Reply-To: <CALMp9eR3c3wQ4YrP7O0UwP=B95XR_-rEpbjet1AgKVMYNEWskA@mail.gmail.com>
On Thu, Jun 04, 2020 at 12:00:33PM -0700, Jim Mattson wrote:
> On Thu, Jun 4, 2020 at 11:47 AM Sean Christopherson
> <sean.j.christopherson@intel.com> wrote:
> >
> > On Wed, Jun 03, 2020 at 01:18:31PM -0700, Jim Mattson wrote:
> > > On Tue, Jun 2, 2020 at 7:24 PM Sean Christopherson
> > > <sean.j.christopherson@intel.com> wrote:
> > > > As an alternative to storing the last run/attempted CPU, what about moving
> > > > the "bad VM-Exit" detection into handle_exit_irqoff, or maybe a new hook
> > > > that is called after IRQs are enabled but before preemption is enabled, e.g.
> > > > detect_bad_exit or something? All of the paths in patch 4/4 can easily be
> > > > moved out of handle_exit. VMX would require a little bit of refacotring for
> > > > it's "no handler" check, but that should be minor.
> > >
> > > Given the alternatives, I'm willing to compromise my principles wrt
> > > emulation_required. :-) I'll send out v4 soon.
> >
> > What do you dislike about the alternative approach?
>
> Mainly, I wanted to stash this in a common location so that I could
> print it out in our local version of dump_vmcs(). Ideally, we'd like
> to be able to identify the bad part(s) just from the kernel logs.
But this would also move dump_vmcs() to before preemption is enabled, i.e.
your version could read the CPU directly.
And actually, if we're talking about ferreting out hardware issues, you
really do want this happening before preemption is enabled so that the VMCS
dump comes from the failing CPU. If the vCPU is migrated, the VMCS will be
dumped after a VMCLEAR->VMPTRLD, i.e. will be written to memory and pulled
back into the VMCS cache on a different CPU, and will also have been written
to by the new CPU to update host state. Odds are that wouldn't affect the
dump in a meaningful way, but never say never.
Tangentially related, what about adding an option to do VMCLEAR at the end
of dump_vmcs(), followed by a dump of raw memory? It'd be useless for
debugging software issues, but might be potentially useful/interesting for
triaging hardware problems.
> That, and I wouldn't have been as comfortable with the refactoring
> without a lot more testing.
next prev parent reply other threads:[~2020-06-04 19:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-01 22:24 [PATCH v3 0/4] Add logical CPU to KVM_EXIT_FAIL_ENTRY info Jim Mattson
2020-06-01 22:24 ` [PATCH v3 1/4] kvm: svm: Prefer vcpu->cpu to raw_smp_processor_id() Jim Mattson
2020-06-01 22:24 ` [PATCH v3 2/4] kvm: svm: Always set svm->last_cpu on VMRUN Jim Mattson
2020-06-01 22:24 ` [PATCH v3 3/4] kvm: vmx: Add last_cpu to struct vcpu_vmx Jim Mattson
2020-06-02 1:21 ` Sean Christopherson
2020-06-02 17:33 ` Jim Mattson
2020-06-03 2:24 ` Sean Christopherson
2020-06-03 20:18 ` Jim Mattson
2020-06-04 18:46 ` Sean Christopherson
2020-06-04 19:00 ` Jim Mattson
2020-06-04 19:26 ` Sean Christopherson [this message]
2020-06-04 20:54 ` Jim Mattson
2020-06-01 22:24 ` [PATCH v3 4/4] kvm: x86: Add "last CPU" to some KVM_EXIT information Jim Mattson
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=20200604192622.GE30456@linux.intel.com \
--to=sean.j.christopherson@intel.com \
--cc=jmattson@google.com \
--cc=kvm@vger.kernel.org \
--cc=liran.alon@oracle.com \
--cc=oupton@google.com \
--cc=pbonzini@redhat.com \
--cc=pshier@google.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).