From: "Radim Krčmář" <rkrcmar@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
aderumier@odiso.com, stable@vger.kernel.org
Subject: Re: [PATCH 2/2] KVM: x86: map/unmap private slots in __x86_set_memory_region
Date: Tue, 13 Oct 2015 18:45:01 +0200 [thread overview]
Message-ID: <20151013164500.GC6877@potion.brq.redhat.com> (raw)
In-Reply-To: <561D3126.8060402@redhat.com>
2015-10-13 18:28+0200, Paolo Bonzini:
> On 13/10/2015 17:39, Radim Krčmář wrote:
>> 2015-10-12 14:09+0200, Paolo Bonzini:
>>> Otherwise, two copies (one of them never used and thus bogus) are
>>> allocated for the regular and SMM address spaces. This breaks
>>> SMM with EPT but without unrestricted guest support, because the
>>> SMM copy of the identity page map is all zeros.
>>
>> (Have you found out why EPT+unrestricted didn't use the alternative SMM
>> mapping as well?)
>
> Yes, that I already knew; EPT+unrestricted uses CR0.PG=0 directly so
> it doesn't use the identity page at all. (CR0.PG=0 w/o unrestricted
> instead runs with CR0.PG=1. CR3 load and store exits are enabled,
> and the guest CR3 always points to the identity page map while the
> guest runs).
Thank you.
>>> + } else {
>>> + if (!slot->npages)
>>> + return 0;
>>> +
>>> + hva = 0;
>>> + }
>>> +
>>> + old = *slot;
>>
>> (Assignment could be in the 'else' == !size branch, GCC would have fun.)
>
> It would have fun _and_ warn, which is why it's not in the else branch. :)
I wondered if its "used uninitialized" analyzer got any better :)
prev parent reply other threads:[~2015-10-13 16:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-12 12:09 [PATCH 0/2] KVM: fix SMM with ept=1/unrestricted_guest=0 Paolo Bonzini
2015-10-12 12:09 ` [PATCH 1/2] KVM: x86: build kvm_userspace_memory_region in x86_set_memory_region Paolo Bonzini
2015-10-13 15:03 ` Radim Krčmář
2015-10-12 12:09 ` [PATCH 2/2] KVM: x86: map/unmap private slots in __x86_set_memory_region Paolo Bonzini
2015-10-13 15:39 ` Radim Krčmář
2015-10-13 16:28 ` Paolo Bonzini
2015-10-13 16:45 ` Radim Krčmář [this message]
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=20151013164500.GC6877@potion.brq.redhat.com \
--to=rkrcmar@redhat.com \
--cc=aderumier@odiso.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=stable@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.