From: Jiri Palecek <jpalecek@web.de>
To: Paolo Bonzini <pbonzini@redhat.com>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
kvm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, "Radim Krčmář" <rkrcmar@redhat.com>,
"Joerg Roedel" <joro@8bytes.org>,
"KarimAllah Ahmed" <karahmed@amazon.de>
Subject: Re: Re: [PATCH] KVM/nSVM: properly map nested VMCB
Date: Sat, 10 Aug 2019 20:35:11 +0200 [thread overview]
Message-ID: <6282e1bf-1eaa-450d-7f6a-b868ebab09d0@web.de> (raw)
In-Reply-To: <b46872ce-5305-aa25-9593-d882da3c0872@redhat.com>
Hello,
On 04. 06. 19 19:27, Paolo Bonzini wrote:
> On 04/06/19 18:09, Vitaly Kuznetsov wrote:
>> Commit 8c5fbf1a7231 ("KVM/nSVM: Use the new mapping API for mapping guest
>> memory") broke nested SVM completely: kvm_vcpu_map()'s second parameter is
>> GFN so vmcb_gpa needs to be converted with gpa_to_gfn(), not the other way
>> around.
>>
>> Fixes: 8c5fbf1a7231 ("KVM/nSVM: Use the new mapping API for mapping guest memory")
>> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
>> ---
>> arch/x86/kvm/svm.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
>> index 735b8c01895e..5beca1030c9a 100644
>> --- a/arch/x86/kvm/svm.c
>> +++ b/arch/x86/kvm/svm.c
>> @@ -3293,7 +3293,7 @@ static int nested_svm_vmexit(struct vcpu_svm *svm)
>> vmcb->control.exit_int_info_err,
>> KVM_ISA_SVM);
>>
>> - rc = kvm_vcpu_map(&svm->vcpu, gfn_to_gpa(svm->nested.vmcb), &map);
>> + rc = kvm_vcpu_map(&svm->vcpu, gpa_to_gfn(svm->nested.vmcb), &map);
>> if (rc) {
>> if (rc == -EINVAL)
>> kvm_inject_gp(&svm->vcpu, 0);
>> @@ -3583,7 +3583,7 @@ static bool nested_svm_vmrun(struct vcpu_svm *svm)
>>
>> vmcb_gpa = svm->vmcb->save.rax;
>>
>> - rc = kvm_vcpu_map(&svm->vcpu, gfn_to_gpa(vmcb_gpa), &map);
>> + rc = kvm_vcpu_map(&svm->vcpu, gpa_to_gfn(vmcb_gpa), &map);
>> if (rc) {
>> if (rc == -EINVAL)
>> kvm_inject_gp(&svm->vcpu, 0);
>>
> Oops. Queued, thanks.
Given that this fix didn't make it to 5.2, and its straightforwardness,
could you send it to stable for inclusion?
Regards
Jiri Palecek
next prev parent reply other threads:[~2019-08-10 18:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-04 16:09 [PATCH] KVM/nSVM: properly map nested VMCB Vitaly Kuznetsov
2019-06-04 16:48 ` Sean Christopherson
2019-06-04 17:27 ` Paolo Bonzini
2019-08-10 18:35 ` Jiri Palecek [this message]
2019-08-14 12:43 ` 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=6282e1bf-1eaa-450d-7f6a-b868ebab09d0@web.de \
--to=jpalecek@web.de \
--cc=joro@8bytes.org \
--cc=karahmed@amazon.de \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.com \
--cc=vkuznets@redhat.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).