qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: ~jhogberg <john.hogberg@ericsson.com>, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org
Subject: Re: [PATCH qemu v2 1/2] target/arm: Handle IC IVAU to improve compatibility with JITs
Date: Wed, 14 Jun 2023 05:52:15 +0200	[thread overview]
Message-ID: <3f4e8ef6-1ee3-4cca-c34d-fb5cf4ff9b2a@linaro.org> (raw)
In-Reply-To: <168656283612.26761.9869630057811681568-1@git.sr.ht>

On 6/8/23 19:49, ~jhogberg wrote:
> From: John Högberg<john.hogberg@ericsson.com>
> 
> Unlike architectures with precise self-modifying code semantics
> (e.g. x86) ARM processors do not maintain coherency for instruction
> execution and memory, and require the explicit use of cache
> management instructions as well as an instruction barrier to make
> code updates visible (the latter on every core that is going to
> execute said code).
> 
> While this is required to make JITs work on actual hardware, QEMU
> has gotten away with not handling this since it does not emulate
> caches, and unconditionally invalidates code whenever the softmmu
> or the user-mode page protection logic detects that code has been
> modified.
> 
> Unfortunately the latter does not work in the face of dual-mapped
> code (a common W^X workaround), where one page is executable and
> the other is writable: user-mode has no way to connect one with the
> other as that is only known to the kernel and the emulated
> application.
> 
> This commit works around the issue by invalidating code in
> IC IVAU instructions.
> 
> Resolves:https://gitlab.com/qemu-project/qemu/-/issues/1034
> 
> Co-authored-by: Richard Henderson<richard.henderson@linaro.org>
> Signed-off-by: John Högberg<john.hogberg@ericsson.com>
> ---
>   target/arm/helper.c | 47 ++++++++++++++++++++++++++++++++++++++++++---
>   1 file changed, 44 insertions(+), 3 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


  reply	other threads:[~2023-06-14  3:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-12  9:40 [PATCH qemu v2 0/2] target/arm: Improve user-mode compatibility with JITs ~jhogberg
2023-06-08 17:49 ` [PATCH qemu v2 1/2] target/arm: Handle IC IVAU to improve " ~jhogberg
2023-06-14  3:52   ` Richard Henderson [this message]
2023-06-09 12:04 ` [PATCH qemu v2 2/2] tests/tcg/aarch64: Add testcases for IC IVAU and dual-mapped code ~jhogberg
2023-06-19 13:26   ` Peter Maydell
2023-06-19 14:31     ` John Högberg
2023-06-19 14:33       ` Peter Maydell

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=3f4e8ef6-1ee3-4cca-c34d-fb5cf4ff9b2a@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=john.hogberg@ericsson.com \
    --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).