On Tue, Jan 02, 2024 at 12:58:01PM +1100, Richard Henderson wrote:
> This option controls the host page size. From the mis-usage in
> our own testsuite, this is easily confused with guest page size.
>
> The only thing that occurs when changing the host page size is
> that stuff breaks, because one cannot actually change the host
> page size. Therefore reject all but the no-op setting as part
> of the deprecation process.
>
> Reviewed-by: Warner Losh <[email protected]>
> Signed-off-by: Richard Henderson <[email protected]>
> ---
> docs/about/deprecated.rst | 7 +++++++
> docs/user/main.rst | 3 ---
> bsd-user/main.c | 9 +++++----
> linux-user/main.c | 11 ++++++-----
> 4 files changed, 18 insertions(+), 12 deletions(-)
[...]
> diff --git a/linux-user/main.c b/linux-user/main.c
> index 5f217cc2a8..9ba4dc5872 100644
> --- a/linux-user/main.c
> +++ b/linux-user/main.c
> @@ -332,10 +332,11 @@ static void handle_arg_ld_prefix(const char *arg)
>
> static void handle_arg_pagesize(const char *arg)
> {
> - qemu_host_page_size = atoi(arg);
> - if (qemu_host_page_size == 0 ||
> - (qemu_host_page_size & (qemu_host_page_size - 1)) != 0) {
> - fprintf(stderr, "page size must be a power of two\n");
> + unsigned size, want = qemu_real_host_page_size();
> +
> + if (qemu_strtoui(arg, NULL, 10, &size) || size != want) {
> + error_report("Deprecated page size option cannot "
> + "change host page size (%u)", want);
> exit(EXIT_FAILURE);
I wonder if this should rather be a warning for one release?
[...]