linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Cathy Avery <cavery@redhat.com>,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: vkuznets@redhat.com, wei.huang2@amd.com
Subject: Re: [PATCH] KVM: SVM: Use a separate vmcb for the nested L2 guest
Date: Tue, 22 Sep 2020 17:04:39 +0200	[thread overview]
Message-ID: <a6ed7866-69c3-ab5e-7219-d7c5075509db@redhat.com> (raw)
In-Reply-To: <20200917192306.2080-1-cavery@redhat.com>

On 17/09/20 21:23, Cathy Avery wrote:
> 
> 2) There is a workaround in nested_svm_vmexit() where
> 
>    if (svm->vmcb01->control.asid == 0)
>        svm->vmcb01->control.asid = svm->nested.vmcb02->control.asid;
> 
>    This was done as a result of the kvm selftest 'state_test'. In that
>    test svm_set_nested_state() is called before svm_vcpu_run().
>    The asid is assigned by svm_vcpu_run -> pre_svm_run for the current
>    vmcb which is now vmcb02 as we are in nested mode subsequently
>    vmcb01.control.asid is never set as it should be.

I think the asid should be kept in svm->asid, and copied to
svm->vmcb->control.asid in svm_vcpu_run.  It's slightly overkill for
non-nested but it simplifies the nested case a lot so it's worth it.

That would be a first patch in the series, placed before this one.

Paolo


  parent reply	other threads:[~2020-09-22 15:04 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-17 19:23 [PATCH] KVM: SVM: Use a separate vmcb for the nested L2 guest Cathy Avery
2020-09-18 15:16 ` Babu Moger
2020-09-18 15:27   ` Cathy Avery
2020-09-18 16:46     ` Babu Moger
2020-09-18 21:11 ` Wei Huang
2020-09-21 14:07   ` Cathy Avery
2020-09-22 15:02     ` Paolo Bonzini
2020-09-22 15:04 ` Paolo Bonzini [this message]
2020-09-24 15:17 ` Maxim Levitsky
2020-10-07 22:14 ` Maxim Levitsky
2020-10-08  5:52   ` Paolo Bonzini
2020-10-08 10:23     ` Maxim Levitsky
2020-10-08 10:39       ` Maxim Levitsky
2020-10-08 10:54         ` Maxim Levitsky
2020-10-08 12:46           ` Cathy Avery
2020-10-08 13:11             ` Maxim Levitsky
2020-10-08 13:52               ` Cathy Avery
2020-10-08 14:19                 ` Maxim Levitsky
2020-10-09 12:31       ` Cathy Avery

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=a6ed7866-69c3-ab5e-7219-d7c5075509db@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=cavery@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vkuznets@redhat.com \
    --cc=wei.huang2@amd.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).