mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sebastian Ene <sebastianene@google.com>
To: Mankyum Kim <mankyum.kim@samsung.com>
Cc: Marc Zyngier <maz@kernel.org>, Oliver Upton <oupton@kernel.org>,
	Will Deacon <will@kernel.org>, Fuad Tabba <fuad.tabba@linux.dev>,
	Andrew Walbran <qwandor@google.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"kvmarm@lists.linux.dev" <kvmarm@lists.linux.dev>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: Re: [PATCH] KVM: arm64: Allow smaller FF-A RX/TX buffers
Date: Mon, 24 Aug 2026 09:05:12 +0000	[thread overview]
Message-ID: <aowJSDF7SpEHD7FW@google.com> (raw)
In-Reply-To: <20260824005345epcms2p8db2a7aad5598b624129873d1a1abf8ff@epcms2p8>

>On Mon, Aug 24, 2026 at 09:53:45AM +0900, Mankyum Kim wrote:

Hello,

>Hi Sebastian,
>
>
>
>Thanks for the feedback. I took another look at the SPMC capability
>reporting and found an important detail that I missed in v1.
>
>
>
>With FF-A, the SPMC in this configuration advertises both the minimum
>and maximum RX/TX buffer sizes as 4K. `hyp_ffa_post_init()` currently
>only considers the minimum size and ignores the maximum.
>
(making it readable as the reply was sent in html format)

The max size discovery has been added from FF-A 1.2. Old SPMCs with <
1.2 will not have it.

>
>
>I agree that the host-facing FFA_FEATURES should report pKVM's RX/TX
>requirement, as you suggested. That would keep the host/pKVM mapping at
>the host page granularity and also avoid the partial-page sharing issue
>Marc pointed out.
>
>
>
>However, with a 16K host/pKVM, the host would then request:
>
>
>
>```
>
>FFA_RXTX_MAP(..., page-count=4)
>
>```
>
>
>
>and the current `ffa_map_hyp_buffers(npages)` would forward the same
>page count to the SPMC. This SPMC advertises a maximum RX/TX buffer size
>of 4K, so the 16K mapping is rejected.
>

Right, I see what you mean. In this case we would have to :

- keep track in a variable for the size of the hyp mailbox buffer
  (pkvm_ffa_bufsz) let's say

- make hyp_ffa_post_init aware of the max RX/TX discovered size if we
  are running with FF-A >= 1.2

  if max_rxtx_sz < PAGE_SIZE * KVM_FFA_MBOX_NR_PAGES:
  	pkvm_ffa_bufsz = max_rxtx_sz;

- if we are running with FF-A < 1.2:
	pkvm_ffa_bufsz = min_rxtx_sz

- update the code for the host-facing FFA_FEATURES to report
  pkvm_ffa_bufsz when queried from host and make sure we use that
  instead of the paths that use KVM_FFA_MBOX_NR_PAGES

>
>
>It therefore looks like supporting this configuration would require
>separating the host-facing RX/TX size from the SPMC-facing RX/TX size. I
>also noticed that several paths currently use `KVM_FFA_MBOX_NR_PAGES *
>PAGE_SIZE` as the capacity of the hyp buffers, so simply mapping the hyp
>buffers with a page count of one doesn't seem sufficient.
>
>
>
>I'll drop the approach taken in v1.
>
>
>
>Does this match your understanding? In particular, do you think your
>configurable mailbox work could be extended to support different
>host-facing and SPMC-facing RX/TX sizes, or would you handle that
>separately?
>
>
>
>Thanks,
>
>Mankyum

Thanks,
Sebastian

      parent reply	other threads:[~2026-08-24  9:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-20  5:42 Kim Mankyum via B4 Relay
2026-08-20  8:30 ` Marc Zyngier
2026-08-20 13:25 ` Sebastian Ene
     [not found] ` <CGME20260820132522epcas2p329199ce99df0337540735564d881116a@epcms2p8>
     [not found]   ` <20260824005345epcms2p8db2a7aad5598b624129873d1a1abf8ff@epcms2p8>
2026-08-24  9:05     ` Sebastian Ene [this message]

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=aowJSDF7SpEHD7FW@google.com \
    --to=sebastianene@google.com \
    --cc=fuad.tabba@linux.dev \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mankyum.kim@samsung.com \
    --cc=maz@kernel.org \
    --cc=oupton@kernel.org \
    --cc=qwandor@google.com \
    --cc=will@kernel.org \
    /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

all inboxes | Powered by JetHome®