Hi Yulong,
Thanks for your patch!
On Mon, Feb 26, 2024 at 3:20 PM Yulong TANG 汤玉龙 <yulong.tang(a)nio.com> wrote:
I have no objection to the lzo-rle decompression feature for crash.
However I have some concern of your patch:
The patch you attached is a "lzorle_decompress_safe" implementation
which is copied from kernel source code. One of the drawbacks of
copying kernel source code is, kernel is constantly evolving, the code
you copied here today maybe updated someday later, and in support of
different kernel versions, we need to keep a bunch of
switch(kernel_version) and case code to keep the compatibility, which
is what we are trying to avoid.
In addition, the code you copied has deliberately deleted the "if
defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)" part, which may also
cause some problem, and as far as I know, there is no good way in
crash to determine the kernel config status, please feel free to
correct me if I'm wrong.
Hi Tao,
I discovered that there seems to be an array called ikconfig_all in kernel.c which records
the kernel config status, and there is an API called get_kernel_config(char *conf_name,
char **str) for obtaining kernel configuration. This might help solve the second problem
you raised.
For example, adding a line:
#define CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
get_kernel_config("CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS", NULL);
Thanks,
Yulong