[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251027205409.GB3183341@ax162>
Date: Mon, 27 Oct 2025 13:54:09 -0700
From: Nathan Chancellor <nathan@...nel.org>
To: Alexander Lobakin <aleksander.lobakin@...el.com>
Cc: Kees Cook <kees@...nel.org>, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>,
Nick Desaulniers <nick.desaulniers+lkml@...il.com>,
Bill Wendling <morbo@...gle.com>,
Justin Stitt <justinstitt@...gle.com>,
Sami Tolvanen <samitolvanen@...gle.com>,
Russell King <linux@...linux.org.uk>,
Tony Nguyen <anthony.l.nguyen@...el.com>,
Michal Kubiak <michal.kubiak@...el.com>,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev,
linux-arm-kernel@...ts.infradead.org, netdev@...r.kernel.org,
intel-wired-lan@...ts.osuosl.org
Subject: Re: [PATCH 3/3] libeth: xdp: Disable generic kCFI pass for
libeth_xdp_tx_xmit_bulk()
On Mon, Oct 27, 2025 at 03:59:51PM +0100, Alexander Lobakin wrote:
> Hmmm,
>
> For this patch:
>
> Acked-by: Alexander Lobakin <aleksander.lobakin@...el.com>
Thanks a lot for taking a look, even if it seems like we might not
actually go the route of working around this.
> However,
>
> The XSk metadata infra in the kernel relies on that when we call
> xsk_tx_metadata_request(), we pass a static const struct with our
> callbacks and then the compiler makes all these calls direct.
> This is not limited to libeth (although I realize that it triggered
> this build failure due to the way how I pass these callbacks), every
> driver which implements XSk Tx metadata and calls
> xsk_tx_metadata_request() relies on that these calls will be direct,
> otherwise there'll be such performance penalty that is unacceptable
> for XSk speeds.
Hmmmm, I am not really sure how you could guarantee that these calls are
turned direct from indirect aside from placing compile time assertions
around like this... when you say "there'll be such performance penalty
that is unacceptable for XSk speeds", does that mean that everything
will function correctly but slower than expected or does the lack of
proper speed result in functionality degredation?
> Maybe xsk_tx_metadata_request() should be __nocfi as well? Or all
> the callers of it?
I would only expect __nocfi_generic to be useful for avoiding a problem
such as this. __nocfi would be too big of a hammer because it would
cause definite problems if these calls were emitted as indirect ones, as
they would not have the CFI setup on the caller side, resulting in
problems that are now flagged by commit 894af4a1cde6 ("objtool: Validate
kCFI calls") in mainline. It sounds like it could be useful on
xsk_tx_metadata_request() if we decide to further pursue this series but
given we could just bump the version of LLVM necessary for CONFIG_CFI on
ARM, we may just go that route.
Cheers,
Nathan
Powered by blists - more mailing lists