[PATCH 2/2] KVM: arm64: Remove extra argument for __pvkm_host_{share,unshare}_hyp()
Marc Zyngier
maz at kernel.org
Thu Dec 11 00:15:28 PST 2025
On Wed, 10 Dec 2025 13:21:02 +0000,
Alexandru Elisei <alexandru.elisei at arm.com> wrote:
>
> __pvkm_host_share_hyp() and __pkvm_host_unshare_hyp() both have one
> parameter, the pfn, not two. Even though correctness isn't impacted because
> the SMCCC handlers pass the first argument and ignore the second one, let's
> call the functions with the proper number of arguments.
>
> Signed-off-by: Alexandru Elisei <alexandru.elisei at arm.com>
> ---
> arch/arm64/kvm/mmu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c
> index 7cc964af8d30..6c6abcd8e89e 100644
> --- a/arch/arm64/kvm/mmu.c
> +++ b/arch/arm64/kvm/mmu.c
> @@ -497,7 +497,7 @@ static int share_pfn_hyp(u64 pfn)
> this->count = 1;
> rb_link_node(&this->node, parent, node);
> rb_insert_color(&this->node, &hyp_shared_pfns);
> - ret = kvm_call_hyp_nvhe(__pkvm_host_share_hyp, pfn, 1);
> + ret = kvm_call_hyp_nvhe(__pkvm_host_share_hyp, pfn);
> unlock:
> mutex_unlock(&hyp_shared_pfns_lock);
>
Yeah, we lost all form of type-checking when everything was hastily
converted to SMCCC to avoid function pointers. Somehow, I feel that
the cure was worse than the disease.
I wish we'd reintroduce some form of compile-time checks, maybe by
having generated stubs?
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
More information about the linux-arm-kernel
mailing list