qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org
Subject: [PATCH v2 1/9] linux-user: Diagnose misaligned -R size
Date: Fri, 17 Mar 2023 08:54:47 -0700	[thread overview]
Message-ID: <20230317155455.341843-2-richard.henderson@linaro.org> (raw)
In-Reply-To: <20230317155455.341843-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.

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



  reply	other threads:[~2023-03-17 15:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-17 15:54 [PATCH v2 0/9] accel/tcg: Fix page_set_flags and related [#1528] Richard Henderson
2023-03-17 15:54 ` Richard Henderson [this message]
2023-03-20 21:24   ` [PATCH v2 1/9] linux-user: Diagnose misaligned -R size Philippe Mathieu-Daudé
2023-03-17 15:54 ` [PATCH v2 2/9] linux-user: Rename max_reserved_va in main Richard Henderson
2023-03-17 15:54 ` [PATCH v2 3/9] include/exec: Replace reserved_va with max_reserved_va Richard Henderson
2023-03-20 21:32   ` Philippe Mathieu-Daudé
2023-03-17 15:54 ` [PATCH v2 4/9] accel/tcg: Pass last not end to page_set_flags Richard Henderson
2023-03-17 15:54 ` [PATCH v2 5/9] accel/tcg: Pass last not end to page_reset_target_data Richard Henderson
2023-03-17 15:54 ` [PATCH v2 6/9] accel/tcg: Pass last not end to PAGE_FOR_EACH_TB Richard Henderson
2023-03-17 15:54 ` [PATCH v2 7/9] accel/tcg: Pass last not end to page_collection_lock Richard Henderson
2023-03-17 15:54 ` [PATCH v2 8/9] accel/tcg: Pass last not end to tb_invalidate_phys_page_range__locked Richard Henderson
2023-03-20 21:35   ` Philippe Mathieu-Daudé
2023-03-17 15:54 ` [PATCH v2 9/9] accel/tcg: Pass last not end to tb_invalidate_phys_range 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=20230317155455.341843-2-richard.henderson@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=peter.maydell@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 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).