Thread (8 messages) flat view 8 messages, 4 authors, 19h ago

Re: [PATCH v2] powerpc/powernv: Cache OPAL check_token() results

From: Shivang Upadhyay <hidden>
Date: 2026-09-23 06:13:55
Also in: lkml

Hi Aditya,

Thanks for the review.

On Tue, 2026-09-22 at 11:06 +0530, Aditya Gupta wrote:
not a suggestion to change anything, just an observation:

based on this in skiboot:
void __opal_register(uint64_t token, void *func, unsigned int nargs)
{
	assert(token <= OPAL_LAST);
...

static int64_t opal_check_token(uint64_t token)
{
	if (token > OPAL_LAST)
		return OPAL_TOKEN_ABSENT;
along with other usages of OPAL_LAST in skiboot, OPAL_LAST is being
treated as a valid token.

there are no handlers for OPAL_LAST and kernel doesn't do
opal_check_token for this

I feel the logic should better be fixed in opal to not consider
OPAL_LAST
As per my current understanding, I assume OPAL_LAST is meant to be the
length of all valid opal tokens, Not a valid call itself.
at the same time it maybe safer to have length as OPAL_LAST+1 here,
though it is not necessary, so the patch looks good to me

Reviewed-by: Aditya Gupta <redacted>
Thanks.
~Shivang.

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help