From: Laurent Vivier <laurent@vivier.eu>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, riku.voipio@iki.fi, peter.maydell@linaro.org
Subject: Re: [PATCH 0/3] linux-user: Implement x86_64 vsyscalls
Date: Wed, 15 Jan 2020 11:14:35 +0100 [thread overview]
Message-ID: <7f8c782f-6ee2-bc7c-db94-4b0784ed58eb@vivier.eu> (raw)
In-Reply-To: <20200114210921.11216-1-richard.henderson@linaro.org>
Le 14/01/2020 à 22:09, Richard Henderson a écrit :
> The x86_64 abi has a legacy vsyscall page. The kernel folk
> have been trying to deprecate this since at least v3.1, but
>
> (1) We don't implement the vdso that replaces vsyscalls,
> (2) As of v5.5, the vsyscall page is still enabled by default.
>
> This lack is affecting Peter's linux-user testing.
>
> The dependency is not obvious because Peter is running the tests
> on x86_64, so the host is providing a vsyscall page to qemu.
>
> Because of how user-only memory operations are handled, with no
> validation of guest vs host pages, so long as qemu chooses to
> run with guest_base == 0, the guest may Just So Happen to read
> the host's vsyscall page.
>
> Complicating this, new OS releases may use a kernel configured
> with CONFIG_LEGACY_VSYSCALL_XONLY=y, which means the the vsyscall
> page cannot be read, only executed. Which means that the guest
> then cannot read the host vsyscall page during translation and
> will SIGSEGV.
>
> Exactly which of these many variables is affecting Peter's testing
> with Ubuntu 18.04 of my TCG merge, I'm not exactly sure. I suspect
> that it is the change to drop the textseg_addr adjustment to user-only
> static binaries. IIRC bionic does not support -static-pie, which is
> the preferred replacement. This could mean that the host and guest
> binaries overlap, which leads to guest_base != 0.
>
> I vaguely remember someone (Paolo?) implementing something like
> this many years ago, but clearly it never got merged.
>
> In any case, this emulation has been missing for too long.
>
>
> r~
>
>
> Richard Henderson (3):
> target/i386: Renumber EXCP_SYSCALL
> linux-user/i386: Split out gen_signal
> linux-user/i386: Emulate x86_64 vsyscalls
>
> target/i386/cpu.h | 6 +-
> linux-user/i386/cpu_loop.c | 197 ++++++++++++++++++++++++++-----------
> target/i386/translate.c | 16 ++-
> 3 files changed, 155 insertions(+), 64 deletions(-)
>
Thank you Richard.
I'll take this series through the linux-user branch except if you prefer
to do the pull request yourself via another branch (x86 tcg?).
Thanks,
Laurent
next prev parent reply other threads:[~2020-01-15 10:15 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-14 21:09 [PATCH 0/3] linux-user: Implement x86_64 vsyscalls Richard Henderson
2020-01-14 21:09 ` [PATCH 1/3] target/i386: Renumber EXCP_SYSCALL Richard Henderson
2020-01-15 7:22 ` Philippe Mathieu-Daudé
2020-01-15 9:55 ` Alex Bennée
2020-01-14 21:09 ` [PATCH 2/3] linux-user/i386: Split out gen_signal Richard Henderson
2020-01-15 7:22 ` Philippe Mathieu-Daudé
2020-01-15 9:58 ` Alex Bennée
2020-01-14 21:09 ` [PATCH 3/3] linux-user/i386: Emulate x86_64 vsyscalls Richard Henderson
2020-01-16 10:51 ` Alex Bennée
2020-01-16 16:26 ` Alex Bennée
2020-01-16 18:19 ` Richard Henderson
2020-01-16 18:22 ` Richard Henderson
2020-01-16 20:15 ` Alex Bennée
2020-01-14 23:35 ` [PATCH 0/3] linux-user: Implement " Paolo Bonzini
2020-01-15 7:01 ` Laurent Desnogues
2020-01-15 10:14 ` Laurent Vivier [this message]
2020-01-15 17:28 ` Richard Henderson
2020-01-16 14:05 ` Alex Bennée
2020-01-16 19:37 ` Richard Henderson
2020-01-16 14:30 ` Alex Bennée
2020-01-16 18:31 ` 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=7f8c782f-6ee2-bc7c-db94-4b0784ed58eb@vivier.eu \
--to=laurent@vivier.eu \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=riku.voipio@iki.fi \
/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).