lkml.org 
[lkml]   [2024]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/7] KVM: x86/mmu: Extract __kvm_mmu_do_page_fault()
On Wed, Apr 17, 2024 at 11:34:46AM -0400,
Paolo Bonzini <pbonzini@redhat.com> wrote:

> From: Isaku Yamahata <isaku.yamahata@intel.com>
>
> Extract out __kvm_mmu_do_page_fault() from kvm_mmu_do_page_fault(). The
> inner function is to initialize struct kvm_page_fault and to call the fault
> handler, and the outer function handles updating stats and converting
> return code. KVM_MAP_MEMORY will call the KVM page fault handler.

To clarify to no update vcpu.stat, let me update the last sentence.

KVM_MAP_MEMORY will call the KVM page fault handler without vcpu stat that
doesn't make sense for pre-population because pre-population (outside TDX) has
the purpose of avoiding page faults


> This patch makes the emulation_type always set irrelevant to the return
> code. kvm_mmu_page_fault() is the only caller of kvm_mmu_do_page_fault(),
> and references the value only when PF_RET_EMULATE is returned. Therefore,
> this adjustment doesn't affect functionality.

For the technical correctness, let me mention about NULL emulation_type.
I added "," and "with non-NULL emulation_type" to the second sentence.
https://lore.kernel.org/all/621c260399a05338ba6d034e275e19714ad3665c.camel@intel.com/

This patch makes the emulation_type always set, irrelevant to the return
code. kvm_mmu_page_fault() is the only caller of kvm_mmu_do_page_fault() with
non-NULL emulation_type and references the value only when PF_RET_EMULATE is
returned. Therefore, this adjustment doesn't affect functionality.

--
Isaku Yamahata <isaku.yamahata@intel.com>

\
 
 \ /
  Last update: 2024-04-17 21:47    [W:0.041 / U:1.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site