From: Paolo Bonzini <pbonzini@redhat.com>
To: Maxim Levitsky <mlevitsk@redhat.com>, Li Qiang <liq3ea@gmail.com>
Cc: Qemu Developers <qemu-devel@nongnu.org>,
Avi Kivity <avi.kivity@gmail.com>
Subject: Re: Questions about the real mode in kvm/qemu
Date: Thu, 26 Sep 2019 12:00:11 +0200 [thread overview]
Message-ID: <4a8d36ed-4a3b-fd12-303d-fc1ee50b2980@redhat.com> (raw)
In-Reply-To: <f8a138f8c00df4886045d6771415336a7e43b887.camel@redhat.com>
On 26/09/19 11:41, Maxim Levitsky wrote:
>> Thinking more about it, I suppose that saves memory (the same EPT page
>> tables can now be used independent of guest CR0.PG), at the cost of
>> making TLB misses a little slower.
> Don't really understand what you mean.
> Isn't this always the case that EPT and guest paging
> are independent (at least when no nesting is involved)?
There are two possibilities:
1) emulate CR0.PG=0 with EPT + identity page
- advantage: the EPT pages will be reused once the guest sets CR0.PG=1
- disadvantage: TLB misses have to walk two levels of page tables
2) emulate CR0.PG=0 with EPT disabled. Similar to ept=0, CR3 will point
to PAE page tables that do the HVA->GPA transition.
- advantage: faster TLB misses
- disadvantage: need to build separate page tables for CR0.PG=1 (EPT
format) and CR0.PG=0 (PAE format), need to "waste" 4k of GPA space for
the identity map
Paolo
next prev parent reply other threads:[~2019-09-26 10:01 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-26 7:52 Questions about the real mode in kvm/qemu Li Qiang
2019-09-26 8:31 ` Maxim Levitsky
2019-09-26 8:52 ` Li Qiang
2019-09-26 8:59 ` Maxim Levitsky
2019-09-26 9:18 ` Paolo Bonzini
2019-09-26 9:24 ` Maxim Levitsky
2019-09-26 9:33 ` Paolo Bonzini
2019-09-26 9:41 ` Maxim Levitsky
2019-09-26 10:00 ` Paolo Bonzini [this message]
2019-09-26 10:03 ` Maxim Levitsky
2019-09-28 22:10 ` Avi Kivity
2019-09-29 7:39 ` Li Qiang
2019-09-26 9:15 ` Paolo Bonzini
2019-09-26 9:35 ` Maxim Levitsky
2019-09-26 9:35 ` Li Qiang
2019-09-26 9:53 ` Paolo Bonzini
2019-09-26 11:47 ` Li Qiang
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=4a8d36ed-4a3b-fd12-303d-fc1ee50b2980@redhat.com \
--to=pbonzini@redhat.com \
--cc=avi.kivity@gmail.com \
--cc=liq3ea@gmail.com \
--cc=mlevitsk@redhat.com \
--cc=qemu-devel@nongnu.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).