From patchwork Sun Sep 17 15:05:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 112854 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp2747089qgf; Sun, 17 Sep 2017 08:13:22 -0700 (PDT) X-Received: by 10.200.47.114 with SMTP id k47mr48289787qta.109.1505661202586; Sun, 17 Sep 2017 08:13:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505661202; cv=none; d=google.com; s=arc-20160816; b=euByXDtP6fRse5Y3RsrGoXdio6UJYuiTqHTPsujH1AqolTrMxGJoxobTuf5LN04s17 lXxl1dNH4iWinGCqppZiz+18zsD6f683Cr6Wp5ndBJftpzcVfLpD4Ihbctyhb52CwJV4 CkmFldikX/T7lVb6AxQEVc2QuJMJagJ9KjJQ0umXNDxe/0SIONMDyfZuFoh4EY5qQDeW gEEuQsy0J539ELScff8QfPj3n4ivqKXmolLcuK5b/JSUreEQ80MOfDIVcMcIHcJLPEUw QKxaybvdYhcZd9JDyzzPoOr7eBdFJhyhabINi1CHjBK9qtP4FMUjl4FBxrA1d4QLYEs8 HtrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=O2BBeaV36ezdbIs//Kxz1ig22FezlVNGTVT9nIb5zOI=; b=Ne3BdcRwW34ZRs1CE0Rfd/uqAEYuyo6gcRbEjCftJBjQ4RI+gAWKNB2IOrOYTJ9TM5 A+V35C3zYYMIgMcYltctQoPXZNs7o4aScq8noddXHjzdzBcDIkLchfeVzA++kE4bfKXE cit1cJl7khrbUBIhteSgX4TS7KL59hav25A0xtp5L/5q4mwXNZOadnFt6XPxIdwW3lht NuIXw5CGctRQUr1bPkipE7I5PduQ3ftuKdhyCtPhMHOZ7cqn/DfXuixBH+6/RrVg9BEF Ap0EnPeXGkIzRebC4y1GxD54Jx0Scd9FOtwzDNPm62PDntzWexc/mAEjunqeMqHv0FVp uJmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=AsIHG6dN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id o84si5038335qke.120.2017.09.17.08.13.22 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 17 Sep 2017 08:13:22 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=AsIHG6dN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60934 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dtbG4-0005fx-Ax for patch@linaro.org; Sun, 17 Sep 2017 11:13:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52467) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dtb8u-0007zQ-Dd for qemu-devel@nongnu.org; Sun, 17 Sep 2017 11:06:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dtb8s-0008B7-0Y for qemu-devel@nongnu.org; Sun, 17 Sep 2017 11:05:56 -0400 Received: from mail-oi0-x22f.google.com ([2607:f8b0:4003:c06::22f]:49536) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dtb8r-0008Ar-RE for qemu-devel@nongnu.org; Sun, 17 Sep 2017 11:05:53 -0400 Received: by mail-oi0-x22f.google.com with SMTP id t21so3682310oih.6 for ; Sun, 17 Sep 2017 08:05:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=O2BBeaV36ezdbIs//Kxz1ig22FezlVNGTVT9nIb5zOI=; b=AsIHG6dNi1shPpjFjZfhGitn4eqC7jmcw+lrcyxTFNGD4OWx0UBUplrdJWG3AhySMV VVdQ+MiBHLb7f9YeqzjhN09UjUUGeEHaZFsQreMi6iIpp2Ys+8Ei3t7ly+D86QPt4n7/ +Pz0UAruvqE1H8NxwHaprOl6O8JVe6+uhsuw0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=O2BBeaV36ezdbIs//Kxz1ig22FezlVNGTVT9nIb5zOI=; b=ZAQfCPDVoPG2F0bJQBcXc1tGpBmUKpQ49HmtWNR7JyosjOzZwrkZWmT+akwn5MWjz4 PiQ9aaPi4K6rrYiyLkE9dz6g9mnahYzkiIDkpq6f9l4xLkr5iuEuJgnGSuZ4fcvZksFi GZp6590VsayLO7BI0PjvBzP2sG9UTKHSTU/16hbRdTRjkwjAjbBbrDpqsOZ6zcWOflxO TqYkmK5h9fda06Kk4dieGHg7+nPb/s2vgekgWyiXVQaIJIHW9VVPoREwa0qE8N9R838L KYOjLKStInRQ669R4syqKL6qQfx0G8Et4XKA6gr1rHohno13nX3kdnAO3zjaZq0ubJx4 4E1Q== X-Gm-Message-State: AHPjjUi234SlSQi7hCI6GdesMEm6Ka/UlE4VmCqHw37aRag4u9h1oO6m eWRD6fDjyC+34EPdFSgX9w== X-Google-Smtp-Source: AOwi7QB3qMRpjKQN7HSMpAZrpDU1XOAxMsdlg8NODhUGDtgpZvxtQvIjcugc0yxFFOcw4nUH7V0WZg== X-Received: by 10.202.234.84 with SMTP id i81mr31556253oih.187.1505660752887; Sun, 17 Sep 2017 08:05:52 -0700 (PDT) Received: from bigtime.twiddle.net (162.189-204-159.bestel.com.mx. [189.204.159.162]) by smtp.gmail.com with ESMTPSA id j2sm5348789oia.20.2017.09.17.08.05.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 17 Sep 2017 08:05:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sun, 17 Sep 2017 08:05:24 -0700 Message-Id: <20170917150535.8284-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170917150535.8284-1-richard.henderson@linaro.org> References: <20170917150535.8284-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::22f Subject: [Qemu-devel] [PULL 06/17] 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: peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Suggested-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20170912211934.20919-1-f4bug@amsat.org> Signed-off-by: Richard Henderson --- accel/tcg/tcg-runtime.c | 54 ------------------------------------------------- accel/tcg/user-exec.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 54 deletions(-) -- 2.13.5 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" #undef EAX #undef ECX @@ -573,3 +574,54 @@ int cpu_signal_handler(int host_signum, void *pinfo, #error host CPU specific signal handler needed #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 */