From: Alexandru Elisei <alexandru.elisei@arm.com>
To: Marc Zyngier <maz@kernel.org>
Cc: oupton@kernel.org, joey.gouly@arm.com, suzuki.poulose@arm.com,
yuzenghui@huawei.com, qperret@google.com, will@kernel.org,
linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev
Subject: Re: [PATCH 2/2] KVM: arm64: Remove extra argument for __pvkm_host_{share,unshare}_hyp()
Date: Thu, 11 Dec 2025 09:33:40 +0000 [thread overview]
Message-ID: <aTqP9M_E7ROGpfbB@raptor> (raw)
In-Reply-To: <86zf7po2n3.wl-maz@kernel.org>
Hi Marc,
On Thu, Dec 11, 2025 at 08:15:28AM +0000, Marc Zyngier wrote:
> On Wed, 10 Dec 2025 13:21:02 +0000,
> Alexandru Elisei <alexandru.elisei@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@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?
I also think compile-time checks would be useful, do you have something
particular in mind?
If not, right now I can't think of a way to generate the stubs automagically,
but I can give it a (probably bad) try and take it from there.
Thanks,
Alex
next prev parent reply other threads:[~2025-12-11 9:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-10 13:21 [PATCH 0/2] KVM: arm64: pKVM fixes Alexandru Elisei
2025-12-10 13:21 ` [PATCH 1/2] KVM: arm64: Copy FGT traps to unprotected pKVM VCPU on VCPU load Alexandru Elisei
2025-12-11 20:36 ` Will Deacon
2025-12-12 10:30 ` Alexandru Elisei
2025-12-12 8:04 ` Fuad Tabba
2025-12-10 13:21 ` [PATCH 2/2] KVM: arm64: Remove extra argument for __pvkm_host_{share,unshare}_hyp() Alexandru Elisei
2025-12-11 8:15 ` Marc Zyngier
2025-12-11 9:33 ` Alexandru Elisei [this message]
2025-12-11 11:57 ` Marc Zyngier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aTqP9M_E7ROGpfbB@raptor \
--to=alexandru.elisei@arm.com \
--cc=joey.gouly@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=maz@kernel.org \
--cc=oupton@kernel.org \
--cc=qperret@google.com \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.org \
--cc=yuzenghui@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).