[Crash-utility] Re: [PATCH v4 ] Adding the zram decompression algorithm "lzo-rle" to support kernel versions >= 5.1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 15, 2024 at 2:32 PM HAGIO KAZUHITO(萩尾 一仁) <k-hagio-ab@xxxxxxx> wrote:
On 2024/04/09 18:30, Yulong Tang wrote:
> Hi, Lianbo
>
> Thank you for your review.
>
> Your concerns are valid, there are some bit operations performed here after get_unaligned_le16(), perhaps we can add a check.
>
> But the crash-utility should match the endianess of the vmcore file and the local machine, and whether the compression algorithm always compresses data in the same format, so may need to be tested on a big-endian machine.

Good catch, Lianbo.

It seems that in the kenrnel, le16_to_cpu in get_unaligned_le16 does
bswap_16 on a big-endian machine, probably we need to add something like

   #if __BYTE_ORDER == __BIG_ENDIAN
       return bswap_16(value);
   #else
       return value;
   #endif

Is it possible to test on a big-endian machine?

Sure. The macro '#if __BYTE_ORDER == __BIG_ENDIAN' takes effect on a big-endian machine. But it requires to include the header file 'byteswap.h' as below:
#include <byteswap.h>
 
In addition, there is a similar implementation, but I haven't tested it with Yulong's case. Can you help to check if this can work well for you? Yulong.

static inline uint16_t
get_unaligned_le16 (const uint8_t *p)
{
  return p[0] | p[1] << 8;
}


Thank
Lianbo


Thanks,
Kazu
--
Crash-utility mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxxxxxx
https://${domain_name}/admin/lists/devel.lists.crash-utility.osci.io/
Contribution Guidelines: https://github.com/crash-utility/crash/wiki

[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux