[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <245f8011e1f8cccb16a25f080d9521376172f909.camel@intel.com>
Date: Mon, 15 Apr 2024 19:37:52 +0000
From: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
To: "kvm@...r.kernel.org" <kvm@...r.kernel.org>, "Yamahata, Isaku"
<isaku.yamahata@...el.com>
CC: "seanjc@...gle.com" <seanjc@...gle.com>, "Huang, Kai"
<kai.huang@...el.com>, "federico.parola@...ito.it"
<federico.parola@...ito.it>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "isaku.yamahata@...il.com"
<isaku.yamahata@...il.com>, "dmatlack@...gle.com" <dmatlack@...gle.com>,
"michael.roth@....com" <michael.roth@....com>, "pbonzini@...hat.com"
<pbonzini@...hat.com>
Subject: Re: [PATCH v2 07/10] KVM: x86: Always populate L1 GPA for
KVM_MAP_MEMORY
On Wed, 2024-04-10 at 15:07 -0700, isaku.yamahata@...el.com wrote:
> @@ -5882,18 +5884,40 @@ int kvm_arch_vcpu_map_memory(struct kvm_vcpu *vcpu,
> if (!tdp_enabled)
> return -EOPNOTSUPP;
>
> + /* Force to use L1 GPA despite of vcpu MMU mode. */
> + is_smm = !!(vcpu->arch.hflags & HF_SMM_MASK);
> + if (is_smm ||
> + vcpu->arch.mmu != &vcpu->arch.root_mmu ||
> + vcpu->arch.walk_mmu != &vcpu->arch.root_mmu) {
> + vcpu->arch.hflags &= ~HF_SMM_MASK;
> + mmu = vcpu->arch.mmu;
> + walk_mmu = vcpu->arch.walk_mmu;
> + vcpu->arch.mmu = &vcpu->arch.root_mmu;
> + vcpu->arch.walk_mmu = &vcpu->arch.root_mmu;
> + kvm_mmu_reset_context(vcpu);
> + }
> +
> /* reload is optimized for repeated call. */
After the kvm_mmu_reset_context(), what benefit is there to the operation? And
it happening for every call of kvm_arch_vcpu_map_memory()?
> kvm_mmu_reload(vcpu);
Powered by blists - more mailing lists