public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Ene <sebastianene@google.com>
To: Sudeep Holla <sudeep.holla@arm.com>
Cc: catalin.marinas@arm.com, james.morse@arm.com,
	jean-philippe@linaro.org, maz@kernel.org, oliver.upton@linux.dev,
	qperret@google.com, qwandor@google.com, suzuki.poulose@arm.com,
	tabba@google.com, will@kernel.org, yuzenghui@huawei.com,
	lpieralisi@kernel.org, kvmarm@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, kernel-team@android.com
Subject: Re: [PATCH v2 1/4] KVM: arm64: Trap FFA_VERSION host call in pKVM
Date: Thu, 13 Jun 2024 11:55:40 +0000	[thread overview]
Message-ID: <ZmrePPCdc28OLyPb@google.com> (raw)
In-Reply-To: <Zmmph6YlIsBhJQqd@bogus>

On Wed, Jun 12, 2024 at 02:58:31PM +0100, Sudeep Holla wrote:
> On Wed, May 15, 2024 at 05:22:55PM +0000, Sebastian Ene wrote:
> > The pKVM hypervisor initializes with FF-A version 1.0. The spec requires
> > that no other FF-A calls to be issued before the version negotiation
> > phase is complete. Split the hypervisor proxy initialization code in two
> > parts so that we can move the later one after the host negotiates its
> > version.
> 
> Blank line here would be nice.
> 

Added blank line.

> > Without trapping the call, the host drivers can negotiate a higher
> > version number with TEE which can result in a different memory layout
> > described during the memory sharing calls.
> >
> 
> LGTM(apart from minor nits),
> 
> Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
> 

Thanks Sudeep, I will incorporate the tag it in v3.

> > Signed-off-by: Sebastian Ene <sebastianene@google.com>
> > ---
> >  arch/arm64/kvm/hyp/nvhe/ffa.c | 123 +++++++++++++++++++++++++---------
> >  1 file changed, 92 insertions(+), 31 deletions(-)
> >
> > diff --git a/arch/arm64/kvm/hyp/nvhe/ffa.c b/arch/arm64/kvm/hyp/nvhe/ffa.c
> > index 320f2eaa14a9..72f1206c85fb 100644
> > --- a/arch/arm64/kvm/hyp/nvhe/ffa.c
> > +++ b/arch/arm64/kvm/hyp/nvhe/ffa.c
> > @@ -1,4 +1,5 @@
> >  // SPDX-License-Identifier: GPL-2.0-only
> > +//
> 
> It should be OK but still spurious for $subject 😉
> 
> [...]
> 

Dropped this.

> > @@ -700,7 +789,6 @@ bool kvm_host_ffa_handler(struct kvm_cpu_context *host_ctxt, u32 func_id)
> >  int hyp_ffa_init(void *pages)
> >  {
> >  	struct arm_smccc_res res;
> > -	size_t min_rxtx_sz;
> >  	void *tx, *rx;
> >
> >  	if (kvm_host_psci_config.smccc_version < ARM_SMCCC_VERSION_1_2)
> > @@ -726,35 +814,7 @@ int hyp_ffa_init(void *pages)
> >  	if (FFA_MAJOR_VERSION(res.a0) != 1)
> >  		return -EOPNOTSUPP;
> >
> > -	arm_smccc_1_1_smc(FFA_ID_GET, 0, 0, 0, 0, 0, 0, 0, &res);
> > -	if (res.a0 != FFA_SUCCESS)
> > -		return -EOPNOTSUPP;
> > -
> > -	if (res.a2 != HOST_FFA_ID)
> > -		return -EINVAL;
> > -
> > -	arm_smccc_1_1_smc(FFA_FEATURES, FFA_FN64_RXTX_MAP,
> > -			  0, 0, 0, 0, 0, 0, &res);
> > -	if (res.a0 != FFA_SUCCESS)
> > -		return -EOPNOTSUPP;
> > -
> > -	switch (res.a2) {
> > -	case FFA_FEAT_RXTX_MIN_SZ_4K:
> > -		min_rxtx_sz = SZ_4K;
> > -		break;
> > -	case FFA_FEAT_RXTX_MIN_SZ_16K:
> > -		min_rxtx_sz = SZ_16K;
> > -		break;
> > -	case FFA_FEAT_RXTX_MIN_SZ_64K:
> > -		min_rxtx_sz = SZ_64K;
> > -		break;
> > -	default:
> > -		return -EINVAL;
> > -	}
> > -
> > -	if (min_rxtx_sz > PAGE_SIZE)
> > -		return -EOPNOTSUPP;
> > -
> > +	hyp_ffa_version = FFA_VERSION_1_0;
> >  	tx = pages;
> >  	pages += KVM_FFA_MBOX_NR_PAGES * PAGE_SIZE;
> >  	rx = pages;
> > @@ -773,8 +833,9 @@ int hyp_ffa_init(void *pages)
> >  	};
> >
> >  	host_buffers = (struct kvm_ffa_buffers) {
> > -		.lock	= __HYP_SPIN_LOCK_UNLOCKED,
> > +		.lock   = __HYP_SPIN_LOCK_UNLOCKED,
> 
> Spurious or intentional whitespace change ? I can't make out from the mail.
> 
> --

I dropped this, it was a spurious whitespace change.

> Regards,
> Sudeep

Cheers,
Seb

  reply	other threads:[~2024-06-13 11:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-15 17:22 [PATCH v2 0/4] KVM: arm64: pKVM host proxy FF-A fixes Sebastian Ene
2024-05-15 17:22 ` [PATCH v2 1/4] KVM: arm64: Trap FFA_VERSION host call in pKVM Sebastian Ene
2024-06-12 13:58   ` Sudeep Holla
2024-06-13 11:55     ` Sebastian Ene [this message]
2024-05-15 17:22 ` [PATCH v2 2/4] KVM: arm64: Add support for FFA_PARTITION_INFO_GET Sebastian Ene
2024-06-12 14:30   ` Sudeep Holla
2024-06-13 12:29     ` Sebastian Ene
2024-05-15 17:22 ` [PATCH v2 3/4] KVM: arm64: Fix the identification range for the FF-A smcs Sebastian Ene
2024-06-12 14:38   ` Sudeep Holla
2024-06-13 12:37     ` Sebastian Ene
2024-05-15 17:22 ` [PATCH v2 4/4] KVM: arm64: Use FF-A 1.1 with pKVM Sebastian Ene
2024-06-12 14:41   ` Sudeep Holla
2024-06-12 14:46 ` [PATCH v2 0/4] KVM: arm64: pKVM host proxy FF-A fixes Sudeep Holla

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=ZmrePPCdc28OLyPb@google.com \
    --to=sebastianene@google.com \
    --cc=catalin.marinas@arm.com \
    --cc=james.morse@arm.com \
    --cc=jean-philippe@linaro.org \
    --cc=kernel-team@android.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=maz@kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=qperret@google.com \
    --cc=qwandor@google.com \
    --cc=sudeep.holla@arm.com \
    --cc=suzuki.poulose@arm.com \
    --cc=tabba@google.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