From: Paolo Bonzini <pbonzini@redhat.com>
To: Wanpeng Li <kernellwp@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kvm <kvm@vger.kernel.org>,
Sean Christopherson <sean.j.christopherson@intel.com>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Wanpeng Li <wanpengli@tencent.com>,
Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
Haiwei Li <lihaiwei@tencent.com>
Subject: Re: [PATCH 1/2] KVM: X86: TSCDEADLINE MSR emulation fastpath
Date: Wed, 22 Apr 2020 10:38:39 +0200 [thread overview]
Message-ID: <d87e0a4b-608a-451b-e3f0-968d46b6cc26@redhat.com> (raw)
In-Reply-To: <CANRm+CxzROx=eawemmzh==2Mz-DxKSyYFSxHqLxUiGFFnWkAYw@mail.gmail.com>
On 22/04/20 02:48, Wanpeng Li wrote:
> On Tue, 21 Apr 2020 at 19:37, Paolo Bonzini <pbonzini@redhat.com> wrote:
>> On 21/04/20 13:20, Wanpeng Li wrote:
>>> + case MSR_IA32_TSCDEADLINE:
>>> + if (!kvm_x86_ops.event_needs_reinjection(vcpu)) {
>>> + data = kvm_read_edx_eax(vcpu);
>>> + if (!handle_fastpath_set_tscdeadline(vcpu, data))
>>> + ret = EXIT_FASTPATH_CONT_RUN;
>>> + }
>>> break;
>> Can you explain the event_needs_reinjection case? Also, does this break
> This is used to catch the case vmexit occurred while another event was
> being delivered to guest software, I move the
> vmx_exit_handlers_fastpath() call after vmx_complete_interrupts()
> which will decode such event and make kvm_event_needs_reinjection
> return true.
This doesn't need a callback, kvm_event_needs_reinjection should be enough.
You should also check other conditions such as
vcpu->mode == EXITING_GUEST_MODE || kvm_request_pending(vcpu)
|| need_resched() || signal_pending(current)
before doing CONT_RUN.
>> AMD which does not implement the callback?
> Now I add the tscdeadline msr emulation and vmx-preemption timer
> fastpath pair for Intel platform.
But this would cause a crash if you run on AMD.
Paolo
next prev parent reply other threads:[~2020-04-22 8:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-21 11:20 [PATCH 0/2] KVM: VMX: Tscdeadline timer " Wanpeng Li
2020-04-21 11:20 ` [PATCH 1/2] KVM: X86: TSCDEADLINE MSR " Wanpeng Li
2020-04-21 11:37 ` Paolo Bonzini
2020-04-22 0:48 ` Wanpeng Li
2020-04-22 8:38 ` Paolo Bonzini [this message]
2020-04-22 8:46 ` Wanpeng Li
2020-04-21 11:20 ` [PATCH 2/2] KVM: VMX: Handle preemption timer fastpath Wanpeng Li
2020-04-21 11:40 ` Paolo Bonzini
2020-04-22 1:01 ` Wanpeng Li
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=d87e0a4b-608a-451b-e3f0-968d46b6cc26@redhat.com \
--to=pbonzini@redhat.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kernellwp@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=lihaiwei@tencent.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sean.j.christopherson@intel.com \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.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
all inboxes | Powered by JetHome®