From nobody Wed May 1 00:28:02 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505251241013349.90169835473966; Tue, 12 Sep 2017 14:20:41 -0700 (PDT) Received: from localhost ([::1]:38669 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drsbo-0005ay-6D for importer@patchew.org; Tue, 12 Sep 2017 17:20:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32942) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drsay-0005Cl-Lq for qemu-devel@nongnu.org; Tue, 12 Sep 2017 17:19:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1drsav-0001m0-To for qemu-devel@nongnu.org; Tue, 12 Sep 2017 17:19:48 -0400 Received: from mail-qk0-x241.google.com ([2607:f8b0:400d:c09::241]:37543) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1drsav-0001lh-PN for qemu-devel@nongnu.org; Tue, 12 Sep 2017 17:19:45 -0400 Received: by mail-qk0-x241.google.com with SMTP id r66so7754150qke.4 for ; Tue, 12 Sep 2017 14:19:45 -0700 (PDT) Received: from yoga.offpageads.com ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id b27sm8680164qtc.78.2017.09.12.14.19.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Sep 2017 14:19:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rQmcQCRikpOypinZdUCvXTutKIDquVoVlz3/6xASRRM=; b=Fajb952wWCCTZ744535NTwX9LNDSrSR+24UyUyyngbRFl1von3kUP68yCIJdcJrwVK FFsNC6QDL9Nelcvq+FchKlKF7rVMiU4xKhVoGURR40vrSFPtWEaECyhI44x/hpitdk7s b7q5Z28dpGPwEEGTC1H9lZwQHQbjP9nrqXPuaucN4NzAbOOv2la8UWT3ZIecgb0sfrHL xcr7+OwEq4BVQSDeW3/ctGP0kboaZ35yaS3eLcKyaBgTEwqlLRk4Hzf2o8QmX3N1ZSpE +kidL4bVQzqUcBPLXxDJ62L1rV4IUq+ir0fA6ssGKfyI96t/TdzYNbNTn+AxJmaqeqPu EElw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=rQmcQCRikpOypinZdUCvXTutKIDquVoVlz3/6xASRRM=; b=Vj3PHdgZmEDUo5totUpdOa8wqKDdczq3+lkD+6lVQh/Nr7x8JJeHZaGjYBJF6PGWaC UzzXYbxdhJwhYVCdmpCO/Gmg69mzqxPTWG4YjijxSMgg1Siz6fKP92GHszhZa2Zzf4Fx FFM6uAtxEZoCVB0sp9cyIlr+ui6TMmuT3FVbPeHfCFmY32Vn/VKyJpS39MlBActFJdNJ gp/R2riAqONbPhUKYf3wa059MPgbH7cQfixJFA84xDdYe9B8syBP5S57c2+yhnKS2YMB Oiu3ChD4ZihmXx/KPfZD97O7/VUXVl44/EURlRrGBcfIYUee9Te0EdDWG+BmOiRdczei 9zSg== X-Gm-Message-State: AHPjjUjRbYAZVVyaWPrcXR7Dy7+7CQ/8YvNOUZdRKRVFvnL6NnaJQ0ej R36GHYb15TRujw== X-Google-Smtp-Source: AOwi7QDtwwf27P/MarZUEgRjHsv0xzkscUNNNuTUr+e1LiPmgBUQCtKOWheGfpjTAPNQAakdRNltNw== X-Received: by 10.55.158.68 with SMTP id h65mr20261441qke.322.1505251185116; Tue, 12 Sep 2017 14:19:45 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Paolo Bonzini , Richard Henderson , Peter Crosthwaite , Thomas Huth Date: Tue, 12 Sep 2017 18:19:34 -0300 Message-Id: <20170912211934.20919-1-f4bug@amsat.org> X-Mailer: git-send-email 2.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::241 Subject: [Qemu-devel] [PATCH] accel/tcg: move USER code to user-exec.c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Suggested-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- Based-on: 20170911213328.9701-5-f4bug@amsat.org accel/tcg/tcg-runtime.c | 54 ---------------------------------------------= ---- accel/tcg/user-exec.c | 52 +++++++++++++++++++++++++++++++++++++++++++++= ++ 2 files changed, 52 insertions(+), 54 deletions(-) diff --git a/accel/tcg/tcg-runtime.c b/accel/tcg/tcg-runtime.c index 3e23649dd7..aafb171294 100644 --- a/accel/tcg/tcg-runtime.c +++ b/accel/tcg/tcg-runtime.c @@ -178,57 +178,3 @@ void HELPER(exit_atomic)(CPUArchState *env) { cpu_loop_exit_atomic(ENV_GET_CPU(env), GETPC()); } - -#ifndef CONFIG_SOFTMMU -/* The softmmu versions of these helpers are in cputlb.c. */ - -/* Do not allow unaligned operations to proceed. Return the host address.= */ -static void *atomic_mmu_lookup(CPUArchState *env, target_ulong addr, - int size, uintptr_t retaddr) -{ - /* Enforce qemu required alignment. */ - if (unlikely(addr & (size - 1))) { - cpu_loop_exit_atomic(ENV_GET_CPU(env), retaddr); - } - return g2h(addr); -} - -/* Macro to call the above, with local variables from the use context. */ -#define ATOMIC_MMU_LOOKUP atomic_mmu_lookup(env, addr, DATA_SIZE, GETPC()) - -#define ATOMIC_NAME(X) HELPER(glue(glue(atomic_ ## X, SUFFIX), END)) -#define EXTRA_ARGS - -#define DATA_SIZE 1 -#include "atomic_template.h" - -#define DATA_SIZE 2 -#include "atomic_template.h" - -#define DATA_SIZE 4 -#include "atomic_template.h" - -#ifdef CONFIG_ATOMIC64 -#define DATA_SIZE 8 -#include "atomic_template.h" -#endif - -/* The following is only callable from other helpers, and matches up - with the softmmu version. */ - -#ifdef CONFIG_ATOMIC128 - -#undef EXTRA_ARGS -#undef ATOMIC_NAME -#undef ATOMIC_MMU_LOOKUP - -#define EXTRA_ARGS , TCGMemOpIdx oi, uintptr_t retaddr -#define ATOMIC_NAME(X) \ - HELPER(glue(glue(glue(atomic_ ## X, SUFFIX), END), _mmu)) -#define ATOMIC_MMU_LOOKUP atomic_mmu_lookup(env, addr, DATA_SIZE, retaddr) - -#define DATA_SIZE 16 -#include "atomic_template.h" -#endif /* CONFIG_ATOMIC128 */ - -#endif /* !CONFIG_SOFTMMU */ diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 2a975eaf69..492ea0826c 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -24,6 +24,7 @@ #include "qemu/bitops.h" #include "exec/cpu_ldst.h" #include "translate-all.h" +#include "exec/helper-proto.h" =20 #undef EAX #undef ECX @@ -573,3 +574,54 @@ int cpu_signal_handler(int host_signum, void *pinfo, #error host CPU specific signal handler needed =20 #endif + +/* The softmmu versions of these helpers are in cputlb.c. */ + +/* Do not allow unaligned operations to proceed. Return the host address.= */ +static void *atomic_mmu_lookup(CPUArchState *env, target_ulong addr, + int size, uintptr_t retaddr) +{ + /* Enforce qemu required alignment. */ + if (unlikely(addr & (size - 1))) { + cpu_loop_exit_atomic(ENV_GET_CPU(env), retaddr); + } + return g2h(addr); +} + +/* Macro to call the above, with local variables from the use context. */ +#define ATOMIC_MMU_LOOKUP atomic_mmu_lookup(env, addr, DATA_SIZE, GETPC()) + +#define ATOMIC_NAME(X) HELPER(glue(glue(atomic_ ## X, SUFFIX), END)) +#define EXTRA_ARGS + +#define DATA_SIZE 1 +#include "atomic_template.h" + +#define DATA_SIZE 2 +#include "atomic_template.h" + +#define DATA_SIZE 4 +#include "atomic_template.h" + +#ifdef CONFIG_ATOMIC64 +#define DATA_SIZE 8 +#include "atomic_template.h" +#endif + +/* The following is only callable from other helpers, and matches up + with the softmmu version. */ + +#ifdef CONFIG_ATOMIC128 + +#undef EXTRA_ARGS +#undef ATOMIC_NAME +#undef ATOMIC_MMU_LOOKUP + +#define EXTRA_ARGS , TCGMemOpIdx oi, uintptr_t retaddr +#define ATOMIC_NAME(X) \ + HELPER(glue(glue(glue(atomic_ ## X, SUFFIX), END), _mmu)) +#define ATOMIC_MMU_LOOKUP atomic_mmu_lookup(env, addr, DATA_SIZE, retaddr) + +#define DATA_SIZE 16 +#include "atomic_template.h" +#endif /* CONFIG_ATOMIC128 */ --=20 2.14.1