[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <26526121-e008-0694-bd26-55ce17471c3d@redhat.com>
Date: Thu, 12 Apr 2018 16:36:20 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: KarimAllah Ahmed <karahmed@...zon.de>, x86@...nel.org,
linux-kernel@...r.kernel.org, kvm@...r.kernel.org
Cc: hpa@...or.com, jmattson@...gle.com, mingo@...hat.com,
rkrcmar@...hat.com, tglx@...utronix.de
Subject: Re: [PATCH 05/10] KVM/nVMX: Use kvm_vcpu_map when mapping the L1 MSR
bitmap
On 21/02/2018 18:47, KarimAllah Ahmed wrote:
> ... since using kvm_vcpu_gpa_to_page() and kmap() will only work for guest
> memory that has a "struct page".
>
> The life-cycle of the mapping also changes to avoid doing map and unmap on
> every single exit (which becomes very expesive once we use memremap). Now
> the memory is mapped and only unmapped when a new VMCS12 is loaded into the
> vCPU (or when the vCPU is freed!).
In this particular case SMM is not an issue because it cannot use VMX.
Therefore it's safe to ignore non-SMM address spaces. You can then
introduce
int kvm_map_gfn(struct kvm_vcpu *vcpu gfn_t gfn,
struct kvm_host_map *map)
calling kvm_gfn_to_memslot + __kvm_map_gfn
which could also handle the caching aspect. But please let's look at it
later, making the lifecycle change separate from the new API.
Paolo
> Signed-off-by: KarimAllah Ahmed <karahmed@...zon.de>
> ---
> arch/x86/kvm/vmx.c | 19 ++++++++++++-------
> 1 file changed, 12 insertions(+), 7 deletions(-)
Powered by blists - more mailing lists