qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: laurent@vivier.eu
Subject: [PATCH v3 4/5] linux-user: Add x86_64 vsyscall page to /proc/self/maps
Date: Wed, 12 Feb 2020 19:22:22 -0800	[thread overview]
Message-ID: <20200213032223.14643-5-richard.henderson@linaro.org> (raw)
In-Reply-To: <20200213032223.14643-1-richard.henderson@linaro.org>

The page isn't (necessarily) present in the host /proc/self/maps,
and even if it might be it isn't present in page_flags, and even
if it was it might not have the same set of page permissions.

The easiest thing to do, particularly when it comes to the
"[vsyscall]" note at the end of line, is to special case it.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
v3: Use TARGET_VSYSCALL_PAGE.
---
 linux-user/syscall.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index d60142f069..b684727b83 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7012,6 +7012,16 @@ static int open_self_maps(void *cpu_env, int fd)
         }
     }
 
+#ifdef TARGET_VSYSCALL_PAGE
+    /*
+     * We only support execution from the vsyscall page.
+     * This is as if CONFIG_LEGACY_VSYSCALL_XONLY=y from v5.3.
+     */
+    dprintf(fd, TARGET_FMT_lx "-" TARGET_FMT_lx 
+            " --xp 00000000 00:00 0 [vsyscall]\n",
+            TARGET_VSYSCALL_PAGE, TARGET_VSYSCALL_PAGE + TARGET_PAGE_SIZE);
+#endif
+
     free(line);
     fclose(fp);
 
-- 
2.20.1



  parent reply	other threads:[~2020-02-13  3:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-13  3:22 [PATCH v3 0/5] linux-user: Implement x86_64 vsyscalls Richard Henderson
2020-02-13  3:22 ` [PATCH v3 1/5] target/i386: Renumber EXCP_SYSCALL Richard Henderson
2020-02-13  3:22 ` [PATCH v3 2/5] linux-user/i386: Split out gen_signal Richard Henderson
2020-02-13  3:22 ` [PATCH v3 3/5] linux-user/i386: Emulate x86_64 vsyscalls Richard Henderson
2020-02-13  3:22 ` Richard Henderson [this message]
2020-02-13  3:22 ` [PATCH v3 5/5] linux-user: Flush out implementation of gettimeofday Richard Henderson
2020-02-13  4:08 ` [PATCH v3 0/5] linux-user: Implement x86_64 vsyscalls no-reply
2020-02-25 19:59 ` Richard Henderson
2020-02-25 20:36   ` Laurent Vivier

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=20200213032223.14643-5-richard.henderson@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=laurent@vivier.eu \
    --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).