RFC KVM: x86/mmu: simplify argument to kvm page fault handler
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest10 patches 7 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/10 | KVM: x86/mmu: make kvm_mmu_do_page_fault() receive single argumentarch/ arch/ arch/ | +31 | 0 replies | |
| 2/10 | KVM: x86/mmu: make kvm_mmu:page_fault receive single argumentarch/ arch/ arch/ +1 more | +20 | 0 replies | |
| 3/10 | KVM: x86/mmu: make direct_page_fault() receive single argumentarch/ arch/ | +30 | 0 replies | |
| 4/10 | KVM: x86/mmu: make try_async_pf() receive single argumentarch/ arch/ arch/ | +42 | 0 replies | |
| 5/10 | KVM: x86/mmu: make page_fault_handle_page_track() receive single argumentarch/ arch/ | +7 | 0 replies | |
| 6/10 | KVM: x86/mmu: make handle_abnormal_pfn() receive single argumentarch/ arch/ | +9 | 0 replies | |
| 7/10 | KVM: x86/mmu: make fast_page_fault() receive single argumentarch/ | +5 | 0 replies | |
| 8/10 | KVM: x86/mmu: make __direct_map() receive single argumentarch/ | +12 | 0 replies | |
| 9/10 | KVM: x86/mmu: make kvm_tdp_mmu_map() receive single argumentarch/ arch/ arch/ | +13 | 0 replies | |
| 10/10 | KVM: x86/mmu: make FNAME(fetch) receive single argumentarch/ | +16 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC PATCH 00/10] KVM: x86/mmu: simplify argument to kvm page fault handler
This is a preliminary clean up for TDX which complicates KVM page fault execution path. simplify those execution path as preparation.
The current kvm page fault handlers passes around many arguments to the functions.
To simplify those arguments and local variables, introduce data structure, struct kvm_page_fault, to hold those arguments, variables, and passes around the pointer to struct kvm_page_fault.
struct kvm_page_fault is allocated on stack on the caller of kvm fault handler, kvm_mmu_do_page_fault().
And then push down the pointer to inner functions step by step.
The conversion order is as follows
. kvm_mmu_do_page_fault() with introducing struct kvm_page_fault
. kvm_mmu.page_fault(): kvm_tdp_page_fault(), nonpaging_page_fault(), FNAME(page_fault) . direct_page_fault()
. try_async_pf()
. page_fault_handle_page_track()
. handle_abnormal_pfn()
. fast_page_fault()
. __direct_map()
. kvm_tdp_mmu_map()
. FNAME(fetch)
Probably more functions should be converted. or some should not converted. Only code refactoring and no functional change is intended.
Isaku Yamahata (10):
KVM: x86/mmu: make kvm_mmu_do_page_fault() receive single argument
KVM: x86/mmu: make kvm_mmu:page_fault receive single argument
KVM: x86/mmu: make direct_page_fault() receive single argument
KVM: x86/mmu: make try_async_pf() receive single argument
KVM: x86/mmu: make page_fault_handle_page_track() receive single
argument
KVM: x86/mmu: make handle_abnormal_pfn() receive single argument
KVM: x86/mmu: make fast_page_fault() receive single argument
KVM: x86/mmu: make __direct_map() receive single argument
KVM: x86/mmu: make kvm_tdp_mmu_map() receive single argument
KVM: x86/mmu: make FNAME(fetch) receive single argument
arch/x86/include/asm/kvm_host.h | 4 +- arch/x86/kvm/mmu.h | 49 ++++++++++-- arch/x86/kvm/mmu/mmu.c | 130 +++++++++++++++++--------------- arch/x86/kvm/mmu/paging_tmpl.h | 60 +++++++-------- arch/x86/kvm/mmu/tdp_mmu.c | 21 +++--- arch/x86/kvm/mmu/tdp_mmu.h | 4 +- arch/x86/kvm/x86.c | 4 +- 7 files changed, 156 insertions(+), 116 deletions(-)
Signature · 1 line
2.25.1