Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 801C1EB64DA for ; Tue, 20 Jun 2023 01:05:14 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qBPn5-0004cT-9C; Mon, 19 Jun 2023 21:04:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qBPn0-0004as-Dc for qemu-devel@nongnu.org; Mon, 19 Jun 2023 21:04:10 -0400 Received: from mail-b.sr.ht ([173.195.146.151]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qBPmx-0004d9-26 for qemu-devel@nongnu.org; Mon, 19 Jun 2023 21:04:10 -0400 Authentication-Results: mail-b.sr.ht; dkim=none Received: from git.sr.ht (unknown [173.195.146.142]) by mail-b.sr.ht (Postfix) with ESMTPSA id 3D5E811EE69; Tue, 20 Jun 2023 01:04:05 +0000 (UTC) From: ~jhogberg Date: Tue, 20 Jun 2023 01:04:04 +0000 MIME-Version: 1.0 Subject: [PATCH qemu v3 0/2] target/arm: Improve user-mode compatibility with JITs Message-ID: <168722304495.6281.8113287217736957231-0@git.sr.ht> X-Mailer: git.sr.ht To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=173.195.146.151; envelope-from=outgoing@sr.ht; helo=mail-b.sr.ht X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ~jhogberg Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org The test cases have been changed in v3 to fix some issues pointed out in code review. The main change is that the tests no longer naively copy C code around, opting instead to have hard-coded binary payloads. Given the small amount of code I found that the workarounds for position- independence and figuring out the actual code length were at least as ugly, but that's only my preference, please tell me if you'd prefer something different. ---- When running in user-mode QEMU currently fails to emulate JITs that use dual-mapped code to get around W^X restrictions, where one mapping is writable and one is executable. As it has no way of knowing that a write to the writable region is reflected in the executable one, it fails to invalidate previously translated code which leads to a crash at best. (Note that system mode is unaffected as the softmmu is fully aware of what is going on.) This patch series catches changes to dual-mapped code by honoring the cache management instructions required to make things work on actual hardware. See https://gitlab.com/qemu-project/qemu/-/issues/1034 for more background information John H=C3=B6gberg (2): target/arm: Handle IC IVAU to improve compatibility with JITs tests/tcg/aarch64: Add testcases for IC IVAU and dual-mapped code target/arm/helper.c | 47 ++++++++- tests/tcg/aarch64/Makefile.target | 3 +- tests/tcg/aarch64/icivau.c | 169 ++++++++++++++++++++++++++++++ 3 files changed, 215 insertions(+), 4 deletions(-) create mode 100644 tests/tcg/aarch64/icivau.c --=20 2.38.5