Re: [PATCH v7 3/4] KVM: arm64: Tweak parameters of guest cache maintenance functions

From: wangyanan (Y)
Date: Fri Jun 18 2021 - 09:14:19 EST




On 2021/6/18 19:30, Marc Zyngier wrote:
On Thu, 17 Jun 2021 11:58:23 +0100,
Yanan Wang <wangyanan55@xxxxxxxxxx> wrote:
Adjust the parameter "kvm_pfn_t pfn" of __clean_dcache_guest_page
and __invalidate_icache_guest_page to "void *va", which paves the
way for converting these two guest CMO functions into callbacks in
structure kvm_pgtable_mm_ops. No functional change.

Signed-off-by: Yanan Wang <wangyanan55@xxxxxxxxxx>
---
arch/arm64/include/asm/kvm_mmu.h | 9 ++-------
arch/arm64/kvm/mmu.c | 28 +++++++++++++++-------------
2 files changed, 17 insertions(+), 20 deletions(-)

[...]

@@ -1219,7 +1221,7 @@ bool kvm_set_spte_gfn(struct kvm *kvm, struct kvm_gfn_range *range)
* We've moved a page around, probably through CoW, so let's treat it
* just like a translation fault and clean the cache to the PoC.
*/
- clean_dcache_guest_page(pfn, PAGE_SIZE);
+ clean_dcache_guest_page(page_address(pfn_to_page(pfn), PAGE_SIZE);
This obviously doesn't compile. I have fixed it locally, but in the
future please make sure that patch series can be bisected correctly.
Ah, yes, I figure out what I have missed by mistake now, and this should
have never happened... Much thanks for the local fixes for this series.
Also thank Fuad for the naming reference and review.

Regards,
Yanan
.
Thanks,

M.