All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: cota@braap.org, peter.maydell@linaro.org,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH for-8.0 03/11] linux-user: Diagnose misaligned -R size
Date: Wed, 22 Mar 2023 08:07:36 -0700	[thread overview]
Message-ID: <20230322150744.175010-4-richard.henderson@linaro.org> (raw)
In-Reply-To: <20230322150744.175010-1-richard.henderson@linaro.org>

We have been enforcing host page alignment for the non-R
fallback of MAX_RESERVED_VA, but failing to enforce for -R.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/main.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/linux-user/main.c b/linux-user/main.c
index 4b18461969..39d9bd4d7a 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -793,6 +793,12 @@ int main(int argc, char **argv, char **envp)
      */
     max_reserved_va = MAX_RESERVED_VA(cpu);
     if (reserved_va != 0) {
+        if (reserved_va % qemu_host_page_size) {
+            char *s = size_to_str(qemu_host_page_size);
+            fprintf(stderr, "Reserved virtual address not aligned mod %s\n", s);
+            g_free(s);
+            exit(EXIT_FAILURE);
+        }
         if (max_reserved_va && reserved_va > max_reserved_va) {
             fprintf(stderr, "Reserved virtual address too big\n");
             exit(EXIT_FAILURE);
-- 
2.34.1



  parent reply	other threads:[~2023-03-22 15:08 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-22 15:07 [PATCH for-8.0 00/11] tcg patch queue Richard Henderson
2023-03-22 15:07 ` [PATCH for-8.0 01/11] util: import GTree as QTree Richard Henderson
2023-03-22 15:07 ` [PATCH for-8.0 02/11] tcg: use QTree instead of GTree Richard Henderson
2023-03-22 15:07 ` Richard Henderson [this message]
2023-03-22 15:07 ` [PATCH for-8.0 04/11] include/exec: Change reserved_va semantics to last byte Richard Henderson
2023-03-22 15:07 ` [PATCH for-8.0 05/11] accel/tcg: Pass last not end to page_set_flags Richard Henderson
2023-03-22 15:07 ` [PATCH for-8.0 06/11] accel/tcg: Pass last not end to page_reset_target_data Richard Henderson
2023-03-22 15:07 ` [PATCH for-8.0 07/11] accel/tcg: Pass last not end to PAGE_FOR_EACH_TB Richard Henderson
2023-03-22 15:07 ` [PATCH for-8.0 08/11] accel/tcg: Pass last not end to page_collection_lock Richard Henderson
2023-03-22 15:07 ` [PATCH for-8.0 09/11] accel/tcg: Pass last not end to tb_invalidate_phys_page_range__locked Richard Henderson
2023-03-22 15:07 ` [PATCH for-8.0 10/11] accel/tcg: Pass last not end to tb_invalidate_phys_range Richard Henderson
2023-03-22 15:07 ` [PATCH for-8.0 11/11] linux-user/arm: Take more care allocating commpage Richard Henderson
2023-03-27  8:38   ` Alex Bennée
2023-03-27 12:47     ` Philippe Mathieu-Daudé
2023-03-27 17:36     ` Richard Henderson
2023-03-27 19:27       ` Richard Henderson
2023-03-27 19:42       ` Alex Bennée
2023-03-26  4:51 ` [PATCH for-8.0 00/11] tcg patch queue Richard Henderson

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=20230322150744.175010-4-richard.henderson@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=cota@braap.org \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.