From patchwork Mon Dec 16 22:11:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 181810 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp4934365ile; Mon, 16 Dec 2019 14:20:25 -0800 (PST) X-Google-Smtp-Source: APXvYqx0kBr7fO7glsEqhe7/PfUZo5h4yR/u4uoELiVwvl2TeujjP+M9+vzfH9OoRgIVfNg9mK6S X-Received: by 2002:a05:620a:14a6:: with SMTP id x6mr1939589qkj.206.1576534825449; Mon, 16 Dec 2019 14:20:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576534825; cv=none; d=google.com; s=arc-20160816; b=OdYaty6hBAcjb0QhLGkIFLy7iyGhibJjLRLrC+fqDgahkM/IJWmf/b40DrrheIY4WA Vnd6e+mOJxmkUODMZkrPmxkc8fbQTCcfLtUkzwd+BUALh0Pe6wLY6T1tKJVzxXl29P3N e/LXan27VuxR80TQbgibpzjELfzaKrgqY65aIGgCBVGqF5YZPJzdGlHGXlmtx0NrXO2M ILi/dUBPqDtMR5SJwcgDFlKdxZzdxr6DTWlRyq1/gAkeEDeT2B2FySO/qW+o+QaiUMsi ZK/BCKcy6wPbswh/Z+IKPydjO15dmUj53oOhAialRaNuTvZWAlESQrD9Fq02nW+eRECS VSWQ== 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=lsCNvFrnH2M18XdHCXW5ZamBsqq1c0FHuOYep4yKETk=; b=dTUwbNq9CnFjEgL2j96KOenDCP39ndrq4xKHha7mT4KKm+SkBhCT+6u91JpEIGhV54 501YHdKlbjG/h6Ze2Q35MBO2jZnc6rO9a6WTOODzvWhWv9Ak59RC44oqx2b71kdgx5BR ejvY84eMij+q7M8ITdg2QtyzqAI2M8ljmyXY1gH4fZXCQBQH9VCojRV2OtaMm4Mpsfbu w0nEpKcgTBf3woPjysD9j7PAZ+CzpJCaWCen83cqMzcOjWoVZFvCSqYx5ffA1B3tnktm +BNSD2385YLjS6g/xo8vlMWoc8/vLEUvAHwyKhc9sPGRaypAJOqpXfTziJPsGN+unXAx rmMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=M1OUPrME; 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 67si10452089qtg.124.2019.12.16.14.20.25 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Dec 2019 14:20:25 -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=M1OUPrME; 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]:60766 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igyj2-0006vj-PY for patch@linaro.org; Mon, 16 Dec 2019 17:20:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36702) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igybB-0004xZ-8J for qemu-devel@nongnu.org; Mon, 16 Dec 2019 17:12:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igyb9-00072b-OK for qemu-devel@nongnu.org; Mon, 16 Dec 2019 17:12:17 -0500 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:45680) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1igyb9-00072H-J8 for qemu-devel@nongnu.org; Mon, 16 Dec 2019 17:12:15 -0500 Received: by mail-pf1-x441.google.com with SMTP id 2so6361575pfg.12 for ; Mon, 16 Dec 2019 14: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=lsCNvFrnH2M18XdHCXW5ZamBsqq1c0FHuOYep4yKETk=; b=M1OUPrMEEdTWjq9e9kBnv9dRB2o0OsoH21mIPE3FnQ8a2f4PDm1MY6/3FroKZE1lL3 YrJiUTaITQbM9vJg+H0t2SyHJhWGIB0OPdpYWJ2hcCdIKI8iFAPhejlXi6GPQ8Pp8MWB hDcXQ8ErVaMLkOL99Nrj45rng+IU4UKjPVm5shQGlHz+B0l4SChaXF5r8tZQ3zENvuzW cgzQXsHF53XPVMIuwlKj8nFmDi7n0B+8/sULxt92IyT0lhFbLShF8KtD5yKTBSNRSRo0 ySM5b+5R+JuDbZK+S1Mbv9nFKBaCkNmIS3H+r51SFmAf251hRnkPyeIjKd6DzkYAChWs Kfew== 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=lsCNvFrnH2M18XdHCXW5ZamBsqq1c0FHuOYep4yKETk=; b=K93+Pyhr1HkiC6sPEhdceTyN19FIRaX3HWhNSo9+xssjyrcGW+sDAPWMYCPONgzB6G Fc8a/RTkKgZWfDPAjOy2NPSfAtLAXUKSgzEAAtTpDd5t1fK2lkiZY91TzQUUFY5zbHSj v0c/xXyWQt25pkSaGOAytpSgP61y0LQqu5idkFHwansd3IKf8WzyG3bTLF7AiWjPo/h0 t2SF+zwTA+jetayAavqIPVthf9iyvoUUujdptg5DK2KjuxdjmdSlR0eIAZSllvhXBZzt gUeFn7sk3TvncaMySvL/lC1oWMyV6JhGqeJ3d5kMgtnvUfC6uUY3gJkvxtXYUu4ekb9f ecNA== X-Gm-Message-State: APjAAAWNE1RUAbluk3yjj87RaeQ4o7WGmGd9LGFcbXYUwZsxqkKGtVba g7bAHUYO1MuVjtqOMEcOBZR5pQkYP+A= X-Received: by 2002:a63:2ccc:: with SMTP id s195mr20644457pgs.75.1576534334271; Mon, 16 Dec 2019 14:12:14 -0800 (PST) Received: from localhost.localdomain ([2605:e000:c74f:dc00:6838:d2b2:17e2:8445]) by smtp.gmail.com with ESMTPSA id d6sm529767pjl.8.2019.12.16.14.12.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2019 14:12:13 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 08/28] target/i386: Use cpu_*_mmuidx_ra instead of templates Date: Mon, 16 Dec 2019 12:11:38 -1000 Message-Id: <20191216221158.29572-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191216221158.29572-1-richard.henderson@linaro.org> References: <20191216221158.29572-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::441 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 , 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 Signed-off-by: Richard Henderson --- target/i386/seg_helper.c | 56 ++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 28 deletions(-) -- 2.20.1 Reviewed-by: Alex Bennée 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,