[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z7y14Q3ifu7U1tHI@blossom>
Date: Mon, 24 Feb 2025 13:09:37 -0500
From: Alyssa Rosenzweig <alyssa@...enzweig.io>
To: sven@...npeter.dev
Cc: Janne Grunau <j@...nau.net>, asahi@...ts.linux.dev,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Hector Martin <marcan@...can.st>
Subject: Re: [PATCH 2/4] soc: apple: rtkit: Implement OSLog buffers properly
> + if (ep == APPLE_RTKIT_EP_OSLOG) {
> + buffer->size = FIELD_GET(APPLE_RTKIT_OSLOG_SIZE, msg);
> + buffer->iova = FIELD_GET(APPLE_RTKIT_OSLOG_IOVA, msg) << 12;
> + } else {
> + buffer->size = FIELD_GET(APPLE_RTKIT_BUFFER_REQUEST_SIZE, msg) << 12;
> + buffer->iova = FIELD_GET(APPLE_RTKIT_BUFFER_REQUEST_IOVA, msg);
> + }
The shifts are suspiciously asymmetric. Are we really sure this is
correct? My guess is that both size & iova for both oslog & buffer need
to be page-aligned, so all 4 lines should be shifted, and the bit
offsets should be adjusted in turn, and the lower 12-bits in oslog_size
and buffer_iova are reserved. But that's just a guess.
Anyway if this logic is really what we want it deserves a comment
because it looks like a typo.
(Likewise later in the patch)
Powered by blists - more mailing lists