From patchwork Sat Dec 28 23:11:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 182519 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp4649588ild; Sat, 28 Dec 2019 15:25:57 -0800 (PST) X-Google-Smtp-Source: APXvYqwvqRedgAyQ2Qpm3UACRZw3opLwNYiI+EUwwx/UCD2I4gQT3/RsWytuW23BomNF/zjBgQz1 X-Received: by 2002:a05:6830:1f89:: with SMTP id v9mr62054887otr.90.1577575556986; Sat, 28 Dec 2019 15:25:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577575556; cv=none; d=google.com; s=arc-20160816; b=U0wEHtP9U9+lT58/LKEfTvUcRUaLHgRD7SsyWhRIFmjIIXRSWE0Dw8u3eJQLWMIc8T CVp0A72rVWz5EK27p7h6CFyb9idQyVS5DeFzCXRLS57mZ1oXLeg2xLvqlbaDn9C1+AFR SiXFrUuU/yOvmoYtZNpCTO15CgqHIJAoS1FGfR1CWM5TtD2G/c/NBd9ppz6rxo0cAKYL MwNq8tMJSQSjDNIwNltok894Icpbrdi67ugD3VPnZv2fnyimcUQKHDTHjYqlFAbwCKn6 iuRHxq8w9XMioqvMXQcnJqFoTQkFlYfIWiVE8ncj94B2X0sC4hRfmfzsKpBCnlTsM++C bzQA== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=ldCBPIWc8mhUIrG4FNbVFhLO4ifRLpZg7PBUswXT7Cc=; b=BWbq9sPDHUm8Rq1pdDjRRLg9Lw6W5hQk/8tE3pllkc9iSXC1s6wpCLBOpUD/6AO8gz OAukBYkkntmlN749fPw62O5ivbtuG8RTQaDcIhJMFz7eg4ZjAjAGobOBeOMYs9q+E42i VrshbmE0hMdZyR+AwDLjA36HvLXydUD2kcKxuNRM22FoD2ER8BZDiPkGONim7ZS6y3ck 8knN1CqaTuKCer2la8d0Gpgany0O60hHkuiQd6iP91rtlqGrC4Web3XooVAstqklY44g vpsLr91FqZQlCKFZEPu0ApjFtTV4IIwQ6XqJU0ou9lgGTAvE07b5rFJyi6OuOTy75DsY 3SXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rAvUPbul; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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. [209.51.188.17]) by mx.google.com with ESMTPS id z22si12727744otq.94.2019.12.28.15.25.56 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 28 Dec 2019 15:25:56 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rAvUPbul; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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]:47464 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ilLT1-0005YA-Tz for patch@linaro.org; Sat, 28 Dec 2019 18:25:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40969) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ilLFo-00055t-Dw for qemu-devel@nongnu.org; Sat, 28 Dec 2019 18:12:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ilLFn-0006rB-90 for qemu-devel@nongnu.org; Sat, 28 Dec 2019 18:12:16 -0500 Received: from mail-pj1-x1042.google.com ([2607:f8b0:4864:20::1042]:38755) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ilLFn-0006mv-2b for qemu-devel@nongnu.org; Sat, 28 Dec 2019 18:12:15 -0500 Received: by mail-pj1-x1042.google.com with SMTP id l35so6556610pje.3 for ; Sat, 28 Dec 2019 15:12:15 -0800 (PST) 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=ldCBPIWc8mhUIrG4FNbVFhLO4ifRLpZg7PBUswXT7Cc=; b=rAvUPbulxQ1IDCZxEo3CsHXYgQ0eMBdCYt0KnanZHmD3Qkxx+j95lNQZYXNGzOw8ts A92wqy972KKkv2WNMm9FzR3ncl042lClEB/E6jfAvnKy4qTkhd1K3tWe4vHILc/5/Lgk PYGuCq6iQkABixfdq4k3lU3gmXOSQ7au3UuQ5QviH7pkZUX+RfA5EefT8TDUTCTmEWHn FAlpv7aAptTbCW9u91Vs/nabU0HVMLUIZypvY7qRV6+JVXRp3XQUVV3B/ppi9C2Mr6c9 AtRRsS2i6mic34GpTB5SfcS2cGRmsFDgzmZLWVcuS5/jmHOwAVaxlEF+UG1Yt/XE+5dt ooWQ== 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=ldCBPIWc8mhUIrG4FNbVFhLO4ifRLpZg7PBUswXT7Cc=; b=dAT1SkMagCkCAMog6lYgMgYUDIMvxnVtRiZjWuWbxz9LrH6f/GhMsv1te7jUkqWxUT 1BlnBMCpzhbWjuc+X3Ct4QmpnkyNEXYNtqszJW27IGPCUZ3M+vowJwAvcJsqMJOfnHLd cIi9ahpvfizvv6xRxxMSr1uRvXeA+eaei+1SEasgAbYB5TiAEQ9PdQ26yOEN0LfPMZ8P aNe6R0Uh5a4S95+i6dczsf14V2Tvw6ltIegI55Y9eUqMQHWY/LWNQGnrUfcaeNB/SXWR 5WxtHlOO9MFLtjZi9rhde2VzM47sK5xwkhhoeCwwtXFX7BocFj0MiMk2jYB4cZBdhz3P FNPw== X-Gm-Message-State: APjAAAVmVBWJ5JLguAo5LiwJWZIOFlnM0wJ0espYL0UgmQb6DyxBWk+x PferaXRAgSWAvdu85vfpNWjD7MdVYzM= X-Received: by 2002:a17:90a:c708:: with SMTP id o8mr36390626pjt.104.1577574733752; Sat, 28 Dec 2019 15:12:13 -0800 (PST) Received: from localhost.localdomain (194-223-58-9.tpgi.com.au. [194.223.58.9]) by smtp.gmail.com with ESMTPSA id c18sm21077186pfr.40.2019.12.28.15.12.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2019 15:12:13 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 14/29] target/i386: Use cpu_*_mmuidx_ra instead of templates Date: Sun, 29 Dec 2019 10:11:09 +1100 Message-Id: <20191228231124.18307-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191228231124.18307-1-richard.henderson@linaro.org> References: <20191228231124.18307-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:4864:20::1042 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , Eduardo Habkost Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Do not use exec/cpu_ldst_{,useronly_}template.h directly, but instead use the functional interface. Cc: Eduardo Habkost Acked-by: Paolo Bonzini Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- target/i386/seg_helper.c | 56 ++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 28 deletions(-) -- 2.20.1 diff --git a/target/i386/seg_helper.c b/target/i386/seg_helper.c index 87a627f9dc..b96de068ca 100644 --- a/target/i386/seg_helper.c +++ b/target/i386/seg_helper.c @@ -37,37 +37,37 @@ # define LOG_PCALL_STATE(cpu) do { } while (0) #endif -#ifdef CONFIG_USER_ONLY -#define MEMSUFFIX _kernel -#define DATA_SIZE 1 -#include "exec/cpu_ldst_useronly_template.h" +/* + * TODO: Convert callers to compute cpu_mmu_index_kernel once + * and use *_mmuidx_ra directly. + */ +#define cpu_ldub_kernel_ra(e, p, r) \ + cpu_ldub_mmuidx_ra(e, p, cpu_mmu_index_kernel(e), r) +#define cpu_lduw_kernel_ra(e, p, r) \ + cpu_lduw_mmuidx_ra(e, p, cpu_mmu_index_kernel(e), r) +#define cpu_ldl_kernel_ra(e, p, r) \ + cpu_ldl_mmuidx_ra(e, p, cpu_mmu_index_kernel(e), r) +#define cpu_ldq_kernel_ra(e, p, r) \ + cpu_ldq_mmuidx_ra(e, p, cpu_mmu_index_kernel(e), r) -#define DATA_SIZE 2 -#include "exec/cpu_ldst_useronly_template.h" +#define cpu_stb_kernel_ra(e, p, v, r) \ + cpu_stb_mmuidx_ra(e, p, v, cpu_mmu_index_kernel(e), r) +#define cpu_stw_kernel_ra(e, p, v, r) \ + cpu_stw_mmuidx_ra(e, p, v, cpu_mmu_index_kernel(e), r) +#define cpu_stl_kernel_ra(e, p, v, r) \ + cpu_stl_mmuidx_ra(e, p, v, cpu_mmu_index_kernel(e), r) +#define cpu_stq_kernel_ra(e, p, v, r) \ + cpu_stq_mmuidx_ra(e, p, v, cpu_mmu_index_kernel(e), r) -#define DATA_SIZE 4 -#include "exec/cpu_ldst_useronly_template.h" +#define cpu_ldub_kernel(e, p) cpu_ldub_kernel_ra(e, p, 0) +#define cpu_lduw_kernel(e, p) cpu_lduw_kernel_ra(e, p, 0) +#define cpu_ldl_kernel(e, p) cpu_ldl_kernel_ra(e, p, 0) +#define cpu_ldq_kernel(e, p) cpu_ldq_kernel_ra(e, p, 0) -#define DATA_SIZE 8 -#include "exec/cpu_ldst_useronly_template.h" -#undef MEMSUFFIX -#else -#define CPU_MMU_INDEX (cpu_mmu_index_kernel(env)) -#define MEMSUFFIX _kernel -#define DATA_SIZE 1 -#include "exec/cpu_ldst_template.h" - -#define DATA_SIZE 2 -#include "exec/cpu_ldst_template.h" - -#define DATA_SIZE 4 -#include "exec/cpu_ldst_template.h" - -#define DATA_SIZE 8 -#include "exec/cpu_ldst_template.h" -#undef CPU_MMU_INDEX -#undef MEMSUFFIX -#endif +#define cpu_stb_kernel(e, p, v) cpu_stb_kernel_ra(e, p, v, 0) +#define cpu_stw_kernel(e, p, v) cpu_stw_kernel_ra(e, p, v, 0) +#define cpu_stl_kernel(e, p, v) cpu_stl_kernel_ra(e, p, v, 0) +#define cpu_stq_kernel(e, p, v) cpu_stq_kernel_ra(e, p, v, 0) /* return non zero if error */ static inline int load_segment_ra(CPUX86State *env, uint32_t *e1_ptr,