Hi Lianbo,
> + * Get the max shift of the size of struct page.
> + * Most of the time, it is 64 bytes, but not sure.
> + */
> +static int arm64_get_struct_page_max_shift(struct machine_specific *ms)
> +{
> + unsigned long v = ms->struct_page_size;
> +
> + if (16 < v && v <= 32)
> + return 5;
> + if (32 < v && v <= 64)
> + return 6;
> + if (64 < v && v <= 128)
> + return 7;
> +
> + error(FATAL, "We should not have such struct page size:%d!\n",
v);
> + return 0;
> +}
>
If I understand the above function correctly, can it be replaced
by ceil(log2(v))? That can keep it consistent with the kernel. But the
weakness is to include the header math.h in arm64.c. Do you have any
specific concerns about this?
For example:
return ceil(log2(v));
It is okay for me.
+
> diff --git a/defs.h b/defs.h
> index bf2c59b..81ac049 100644
> --- a/defs.h
> +++ b/defs.h
> @@ -3386,6 +3386,7 @@ struct machine_specific {
> ulong VA_START;
> ulong CONFIG_ARM64_KERNELPACMASK;
> ulong physvirt_offset;
> + ulong struct_page_size;
> };
>
Can you add this one to the arm64_dump_machdep_table()?
No problem..
Thanks
Huang Shijie