[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAG_fn=VBUiVf5aN44SQX04ZdXOOtGu3DjbW3-ZNorzNZZ6M0CA@mail.gmail.com>
Date: Thu, 13 Jul 2023 18:37:43 +0200
From: Alexander Potapenko <glider@...gle.com>
To: glider@...gle.com, catalin.marinas@....com, will@...nel.org,
pcc@...gle.com, andreyknvl@...il.com,
andriy.shevchenko@...ux.intel.com, linux@...musvillemoes.dk,
yury.norov@...il.com
Cc: linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
eugenis@...gle.com
Subject: Re: [v2 3/5] arm64: mte: implement CONFIG_ARM64_MTE_COMP
> +/* Compress the data inline. */
> +static u64 ea0_compress_inline(int len, u8 *tags, short *sizes)
> +{
> + u64 result;
> +
> + ea0_compress_to_buf(len, tags, sizes, (u8 *)&result, sizeof(result));
> + result = be64_to_cpu(result);
This be64_to_cpu() is leftover from the previous compressor
implementation which treated u64 as u8[8] (i.e. big-endian).
The new implementation works with the native u64 representation, so
the conversion is not needed anymore (and actually produces invalid
handles that can't be stored in Xarray).
I will drop this call in v3.
> +bool ea0_decompress(u64 handle, u8 *tags)
> +{
> + u8 *storage = ea0_storage(handle);
> + int size = ea0_storage_size(handle);
> +
> + if (size == 128) {
> + memcpy(tags, storage, size);
> + return true;
> + }
> + if (size == 8) {
> + handle = cpu_to_be64(handle);
Ditto.
Powered by blists - more mailing lists