From: Richard Henderson <richard.henderson@linaro.org>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <rth@twiddle.net>
Subject: Re: [PATCH 2/2] exec: Ensure variable page size is only used with TARGET_PAGE_BITS_VARY
Date: Tue, 24 Nov 2020 08:12:39 -0800 [thread overview]
Message-ID: <acc4b0d4-4ed9-dc04-35e1-13e3807e1913@linaro.org> (raw)
In-Reply-To: <20201104093534.3064440-3-f4bug@amsat.org>
On 11/4/20 1:35 AM, Philippe Mathieu-Daudé wrote:
> If TARGET_PAGE_BITS_VARY is not supported, machines should not
> intent to modify the target page size.
> As set_preferred_target_page_bits() is supposed to return 'false'
> on failure (documented in "qemu-common.h"), return false to
> indicate failure if this ever happens.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> include/qemu-common.h | 4 +++-
> exec-vary.c | 4 +++-
> 2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/include/qemu-common.h b/include/qemu-common.h
> index fda7dc6ca77..3ea616d4567 100644
> --- a/include/qemu-common.h
> +++ b/include/qemu-common.h
> @@ -70,7 +70,9 @@ void cpu_exec_step_atomic(CPUState *cpu);
> * size may be smaller than any given CPU's preference).
> * Returns true on success, false on failure (which can only happen
> * if this is called after the system has already finalized its
> - * choice of page size and the requested page size is smaller than that).
> + * choice of page size and the requested page size is smaller than
> + * that). Only target supporting variable page size should set a
> + * preferred target page size.
> */
> bool set_preferred_target_page_bits(int bits);
>
> diff --git a/exec-vary.c b/exec-vary.c
> index ff905f2a8fb..4b0b7f193af 100644
> --- a/exec-vary.c
> +++ b/exec-vary.c
> @@ -86,8 +86,10 @@ bool set_preferred_target_page_bits(int bits)
> }
> init_target_page.bits = bits;
> }
> -#endif
> return true;
> +#else
> + return false;
> +#endif
I guess the only generic caller is the one in softmmu/vl.c, which is protected
by machine_class->minimum_page_bits != 0. So this affects exactly one machine
outside arm -- fuloong2e.
Certainly we should not allow an impossible setting. I wonder if it is worth
doing return bits == TARGET_PAGE_BITS?
Either way,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
next prev parent reply other threads:[~2020-11-24 16:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-04 9:35 [PATCH 0/2] exec: Ensure variable page size is only used with TARGET_PAGE_BITS_VARY Philippe Mathieu-Daudé
2020-11-04 9:35 ` [PATCH 1/2] MAINTAINERS: Cover exec-vary.c (variable page size) Philippe Mathieu-Daudé
2020-11-04 9:35 ` [PATCH 2/2] exec: Ensure variable page size is only used with TARGET_PAGE_BITS_VARY Philippe Mathieu-Daudé
2020-11-24 16:12 ` Richard Henderson [this message]
2020-11-23 12:28 ` [PATCH-for-6.0 0/2] " Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=acc4b0d4-4ed9-dc04-35e1-13e3807e1913@linaro.org \
--to=richard.henderson@linaro.org \
--cc=f4bug@amsat.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).