From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Maxim Levitsky <mlevitsk@redhat.com>
Cc: Sean Christopherson <seanjc@google.com>,
Wanpeng Li <wanpengli@tencent.com>,
Jim Mattson <jmattson@google.com>,
kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH v2 10/15] KVM: x86: hyper-v: Always use to_hv_vcpu() accessor to get to 'struct kvm_vcpu_hv'
Date: Tue, 09 Feb 2021 09:38:35 +0100 [thread overview]
Message-ID: <874kiloctw.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <53c5fc3d29ed35ca3252cd5f6547dcb113ab21b9.camel@redhat.com>
Maxim Levitsky <mlevitsk@redhat.com> writes:
> On Tue, 2021-01-26 at 14:48 +0100, Vitaly Kuznetsov wrote:
>
>
> ...
>> _vcpu_mask(
>> static u64 kvm_hv_flush_tlb(struct kvm_vcpu *vcpu, u64 ingpa, u16 rep_cnt, bool ex)
>> {
>> struct kvm *kvm = vcpu->kvm;
>> - struct kvm_vcpu_hv *hv_vcpu = &vcpu->arch.hyperv;
>> + struct kvm_vcpu_hv *hv_vcpu = to_hv_vcpu(current_vcpu);
> You probably mean vcpu here instead of current_vcpu. Today I smoke tested the kvm/nested-svm branch,
> and had this fail on me while testing windows guests.
>
Yes!!!
We were using 'current_vcpu' instead of 'vcpu' here before but Sean
warned me about the danger of shadowing global 'current_vcpu' so I added
'KVM: x86: hyper-v: Stop shadowing global 'current_vcpu' variable' to
the series. Aparently, I missed this 'current_vcpu' while
rebasing. AFAIU, normally vcpu == current_vcpu when entering this
function so nothing blew up in my testing.
Thanks for the report! I'll be sending a patch to fix this shortly.
>
> Other than that HyperV seems to work and even survive nested migration (I had one
> windows reboot but I suspect windows update did it.)
> I'll leave my test overnight (now with updates disabled) to see if it
> is stable.
That's good to hear! Are you testing on Intel or AMD? With AMD there's a
stale bug somewhere which prevents Gen2 (UEFI) L2 guests from booting,
the firmare just hangs somewhere not making any progress. Both Hyper-V
2016 and 2019 seem to be affected. Gen1 guests (including Windows in
root partition) work fine. I tried approaching it a couple times but
with no luck so far. Not sure if this is CPU specific or something...
--
Vitaly
next prev parent reply other threads:[~2021-02-09 8:40 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-26 13:48 [PATCH v2 00/15] KVM: x86: Conditional Hyper-V emulation enablement Vitaly Kuznetsov
2021-01-26 13:48 ` [PATCH v2 01/15] selftests: kvm: Move kvm_get_supported_hv_cpuid() to common code Vitaly Kuznetsov
2021-01-26 13:48 ` [PATCH v2 02/15] selftests: kvm: Properly set Hyper-V CPUIDs in evmcs_test Vitaly Kuznetsov
2021-01-26 13:48 ` [PATCH v2 03/15] KVM: x86: hyper-v: Drop unused kvm_hv_vapic_assist_page_enabled() Vitaly Kuznetsov
2021-01-26 13:48 ` [PATCH v2 04/15] KVM: x86: hyper-v: Rename vcpu_to_hv_vcpu() to to_hv_vcpu() Vitaly Kuznetsov
2021-01-26 13:48 ` [PATCH v2 05/15] KVM: x86: hyper-v: Rename vcpu_to_synic()/synic_to_vcpu() Vitaly Kuznetsov
2021-01-26 13:48 ` [PATCH v2 06/15] KVM: x86: hyper-v: Rename vcpu_to_stimer()/stimer_to_vcpu() Vitaly Kuznetsov
2021-01-26 13:48 ` [PATCH v2 07/15] KVM: x86: hyper-v: Rename vcpu_to_hv_syndbg() to to_hv_syndbg() Vitaly Kuznetsov
2021-01-26 13:48 ` [PATCH v2 08/15] KVM: x86: hyper-v: Introduce to_kvm_hv() helper Vitaly Kuznetsov
2021-01-26 13:48 ` [PATCH v2 09/15] KVM: x86: hyper-v: Stop shadowing global 'current_vcpu' variable Vitaly Kuznetsov
2021-01-26 13:48 ` [PATCH v2 10/15] KVM: x86: hyper-v: Always use to_hv_vcpu() accessor to get to 'struct kvm_vcpu_hv' Vitaly Kuznetsov
2021-02-08 23:06 ` Maxim Levitsky
2021-02-09 8:38 ` Vitaly Kuznetsov [this message]
2021-02-09 10:31 ` Maxim Levitsky
2021-01-26 13:48 ` [PATCH v2 11/15] KVM: x86: hyper-v: Prepare to meet unallocated Hyper-V context Vitaly Kuznetsov
2021-01-28 14:19 ` Paolo Bonzini
2021-01-28 15:21 ` Vitaly Kuznetsov
2021-01-28 16:58 ` Paolo Bonzini
2021-01-26 13:48 ` [PATCH v2 12/15] KVM: x86: hyper-v: Allocate 'struct kvm_vcpu_hv' dynamically Vitaly Kuznetsov
2021-01-26 13:48 ` [PATCH v2 13/15] KVM: x86: hyper-v: Make Hyper-V emulation enablement conditional Vitaly Kuznetsov
2021-01-26 13:48 ` [PATCH v2 14/15] KVM: x86: hyper-v: Allocate Hyper-V context lazily Vitaly Kuznetsov
2021-01-26 13:48 ` [PATCH v2 15/15] KVM: x86: hyper-v: Drop hv_vcpu_to_vcpu() helper Vitaly Kuznetsov
2021-01-28 14:25 ` [PATCH v2 00/15] KVM: x86: Conditional Hyper-V emulation enablement Paolo Bonzini
2021-02-08 14:18 ` Vitaly Kuznetsov
2021-02-08 15:02 ` Paolo Bonzini
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=874kiloctw.fsf@vitty.brq.redhat.com \
--to=vkuznets@redhat.com \
--cc=jmattson@google.com \
--cc=kvm@vger.kernel.org \
--cc=mlevitsk@redhat.com \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.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