linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Lendacky <thomas.lendacky@amd.com>
To: Sean Christopherson <seanjc@google.com>, Joerg Roedel <joro@8bytes.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>,
	x86@kernel.org, Brijesh Singh <brijesh.singh@amd.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Joerg Roedel <jroedel@suse.de>
Subject: Re: [PATCH v5 4/6] KVM: SVM: Add support to handle AP reset MSR protocol
Date: Wed, 20 Oct 2021 13:36:15 -0500	[thread overview]
Message-ID: <2ae35ebd-aaed-a3df-c74e-5a3be378b8af@amd.com> (raw)
In-Reply-To: <YXBUlYll8JDjH/Wd@google.com>

On 10/20/21 12:40 PM, Sean Christopherson wrote:
> On Wed, Oct 20, 2021, Joerg Roedel wrote:
> 
> Tying into above, handling this in SIPI is flawed.  For example, if the guest
> does INIT-SIPI-SIPI without a reset hold, KVM would incorrect set sw_exit_info_2
> on the SIPI.  Because this mess requires an INIT, KVM has lost track of whether
> the guest was in KVM_MP_STATE_AP_RESET_HOLD and thus can't know if the SIPI
> arrived after a reset hold.  Looking at KVM, IIUC, this bug is why the hack
> "received_first_sipi" exists.

The received_first_sipi is because the APs have to be started the very 
first time in the traditional way. The AP can't issue an AP reset hold if 
it hasn't started to begin with in which case there would be no GHCB mapped.

After the check to see if the  GHCB is mapped was added to 
sev_vcpu_deliver_sipi_vector(), the "received_first_sipi" could probably 
have been deleted at that point.

Thanks,
Tom


  parent reply	other threads:[~2021-10-20 18:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-20 12:44 [PATCH v5 0/6] KVM: SVM: Add initial GHCB protocol version 2 support Joerg Roedel
2021-10-20 12:44 ` [PATCH v5 1/6] KVM: SVM: Get rid of set_ghcb_msr() and *ghcb_msr_bits() functions Joerg Roedel
2021-10-20 12:44 ` [PATCH v5 2/6] KVM: SVM: Add helper to generate GHCB MSR verson info, and drop macro Joerg Roedel
2021-10-20 12:44 ` [PATCH v5 3/6] KVM: SVM: Move kvm_emulate_ap_reset_hold() to AMD specific code Joerg Roedel
2021-10-20 14:29   ` Sean Christopherson
2021-10-20 12:44 ` [PATCH v5 4/6] KVM: SVM: Add support to handle AP reset MSR protocol Joerg Roedel
2021-10-20 17:40   ` Sean Christopherson
2021-10-20 18:13     ` Tom Lendacky
2021-10-20 18:38       ` Sean Christopherson
2021-10-20 18:36     ` Tom Lendacky [this message]
2021-10-20 12:44 ` [PATCH v5 5/6] KVM: SVM: Add support for Hypervisor Feature support " Joerg Roedel
2021-10-20 12:44 ` [PATCH v5 6/6] KVM: SVM: Increase supported GHCB protocol version Joerg Roedel

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=2ae35ebd-aaed-a3df-c74e-5a3be378b8af@amd.com \
    --to=thomas.lendacky@amd.com \
    --cc=brijesh.singh@amd.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=jroedel@suse.de \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    --cc=x86@kernel.org \
    /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).