Hi, Kazu:
On 2024/03/01 17:48, Tao Liu wrote:
hmm, as far as I know, not many kernels are configured with
CONFIG_IKCONFIG=y, e.g. RHEL kernels don't have it. so if it depends
only on ikconfig, it will not work on many kernels.
Thank you for the correction.
It's good to use ikconfig, but isn't there any other way?
For example, it looks like it's always set to y on x86. so maybe we can
have a default value depending on architecture, for no ikconfig kernels.
config X86
...
select HAVE_EFFICIENT_UNALIGNED_ACCESS
Thanks,
Kazu
Yes, it seems that some architectures have this configuration enabled by default, such as
ARM, ARM64, and X86. These are also commonly used architectures.
So setting the default to CONFIG_Y for these architectures and CONFIG_N for others. Then,
we can check whether IKCONFIG is enabled to retrieve the actual value. Do you think this
is acceptable?
like this:
- bool efficient_unaligned_access =
(get_kernel_config("CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS", NULL) ==
IKCONFIG_Y);
+ bool efficient_unaligned_access;
+
+#if defined(ARM) || defined(ARM64) || defined(X86)
+ efficient_unaligned_access = true;
+#else
+ efficient_unaligned_access = false;
+#endif
+
+ if (kt->ikconfig_flags & IKCONFIG_AVAIL)
+ efficient_unaligned_access =
(get_kernel_config("CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS", NULL) ==
IKCONFIG_Y);
Thanks,
Yulong