From patchwork Thu Dec 12 04:00:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 181412 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp388113ile; Wed, 11 Dec 2019 20:03:44 -0800 (PST) X-Google-Smtp-Source: APXvYqwmITmlYR0O/3bkpMn8fSuZhsp/huM4NG2zAl5Sem9XRScWIGv86MeFMEn2CZM+HyPPg1ZP X-Received: by 2002:ac8:7699:: with SMTP id g25mr5672660qtr.75.1576123424331; Wed, 11 Dec 2019 20:03:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576123424; cv=none; d=google.com; s=arc-20160816; b=u8z2X+pXJDa0OTP+6ssBWx2kIdX+9cgBRJBpHZFPrRu95ud3vwzP53oKR2lLn3WSDu aPNnIYivQL45VsBDJU2dJR6svNuHUUSMr/XmEM408oIgdGlUdhN2yaiAlfbLHgC0tPf9 v0HgR5KhZ5dCv9HQDuBUQ5P5EP0O1dj5AewMNbQ9GJBRETW2sXEC0RAWfvFGuE3uuh9P qqHeWsXFqYDb99JYWfotQF8TVwVpuQFfIvQVzKsfU5u7GRgqkZoo7ruL106dd0x8pq7C 1yWKqsVC7SBznQ46dg3/Mu+HFypelfVB1RNxkpwIIX3+kXlIjFFc36T6WY3Duc8elqZw x/jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=L1jHeOFQAeKhXPKxXaTdBBGGRizQ9egD6BUcKiL091Y=; b=OZ3rrEXBjU4Bg4k66i8jKUhsORv27Q4JzfrX6MXejjft4Qd7vjSqcsu3VvDn6TnZM+ k8oqYmP5N49AP1/nYluSEQvqjdXygXl6bua7J6TkcK/GD0Ekah2FwjIb9cunqKSGkWOz GnUEhWhNZhqPh0Ig1t9HZU9qT0nqqGTOaTLC1IS2GgbuUzFmQ8cTrHy/ge+XPO6p0jGw h/VXBvrpWO8Ob7W4ZAabolNSsRjFuF1wG9KLAxKVEPqyvVU2rn3TvjCQDMmQ+8uV3NM2 AHODpPxceAGKaJe0HGx9obTO1/LF6MdxF5q7QeZrRVRwP2cSF7uNYarSeHBdUqGOCUPu BF6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ngvvf0m1; 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=pass (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 k11si2143638qtk.275.2019.12.11.20.03.44 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Dec 2019 20:03:44 -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=pass header.i=@linaro.org header.s=google header.b=ngvvf0m1; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:53886 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ifFhX-0004Hz-AU for patch@linaro.org; Wed, 11 Dec 2019 23:03:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47286) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ifFeg-0000ma-Q2 for qemu-devel@nongnu.org; Wed, 11 Dec 2019 23:00:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ifFef-0003t6-Ge for qemu-devel@nongnu.org; Wed, 11 Dec 2019 23:00:46 -0500 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]:39046) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ifFef-0003rX-9k for qemu-devel@nongnu.org; Wed, 11 Dec 2019 23:00:45 -0500 Received: by mail-pg1-x529.google.com with SMTP id b137so431722pga.6 for ; Wed, 11 Dec 2019 20:00:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=L1jHeOFQAeKhXPKxXaTdBBGGRizQ9egD6BUcKiL091Y=; b=ngvvf0m12phzezTxO2R/YcUIPZttTSx5rUZkNwmrZd9CJvyXaHKmSBwFwasG6yS2Kx VC2iXGzvqnwiKw9gs1BrFMXn23Um0XPlAnOKXghBpCsLoA5+74taJcyfE5ZBqhXY5ARO S2lqnlFdACthxnPyotpgsjLaJwQrvJfJ000vxUdHHrze3Y9cyoBl1FZmz4PTHZxudcLa tPxONjESayKzV1v+og8bZt33DEV3LzKORVBOlTfLjXNeXwCZ+PfpoIAX750aEHT0Lh/q Ao6y5Y3TEcTrbuvaBPJgvt2cn3G2CmmwII/jAzB7QC4W6OyZyAFoB0yXgmv7fr3YKlaf K5TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=L1jHeOFQAeKhXPKxXaTdBBGGRizQ9egD6BUcKiL091Y=; b=JS/r/SAR8rCg+Hp86akag03Xd7wddhZzlPG8jpxpXIsOgVgagCqQLZ2z2ztAo0VMci 5YddoJIFtSF9Gy7aNHew6IiSqSCcEtK+TBQRyyQzp5Heo2uQoZmzVBOp/QTPNLp7fyGg o4D37J1pUy3BaDcbQwN0SY2R81noi/XbwzD1Q7adgeKJo/5+QvM2ybaakcrgo5dpDGmG Q+ni/2HSneSPuPAuR5oWyiMW/i2Pp3bwYPExsn05JzUmQ6Z+6ncWN/PxlKM1eyoW0mYl Z8o1hNYSVbyHfJlNIiLTbA45Co0nzC+CqGFFlhM5J27SX65d331NUr9ayyaekNt8I55e ZPvg== X-Gm-Message-State: APjAAAUP+PRF+BNhSIzO3nl0H9QZ2HDkfEmEEOL9XzU8mmWd3rS+Ks6T 9Qcp91HXC758eDm8jioOJGxuPjc47zU= X-Received: by 2002:a62:7c54:: with SMTP id x81mr7370703pfc.180.1576123243988; Wed, 11 Dec 2019 20:00:43 -0800 (PST) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id z130sm4666391pgz.6.2019.12.11.20.00.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Dec 2019 20:00:43 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 02/28] cputlb: Use trace_mem_get_info instead of trace_mem_build_info Date: Wed, 11 Dec 2019 20:00:13 -0800 Message-Id: <20191212040039.26546-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191212040039.26546-1-richard.henderson@linaro.org> References: <20191212040039.26546-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::529 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" In the cpu_ldst templates, we already require a MemOp, and it is cleaner and clearer to pass that instead of 3 separate arguments describing the memory operation. Signed-off-by: Richard Henderson --- include/exec/cpu_ldst_template.h | 22 +++++++++++----------- include/exec/cpu_ldst_useronly_template.h | 12 ++++++------ 2 files changed, 17 insertions(+), 17 deletions(-) -- 2.20.1 diff --git a/include/exec/cpu_ldst_template.h b/include/exec/cpu_ldst_template.h index 54b5e858ce..0ad5de3ef9 100644 --- a/include/exec/cpu_ldst_template.h +++ b/include/exec/cpu_ldst_template.h @@ -86,9 +86,9 @@ glue(glue(glue(cpu_ld, USUFFIX), MEMSUFFIX), _ra)(CPUArchState *env, RES_TYPE res; target_ulong addr; int mmu_idx = CPU_MMU_INDEX; - TCGMemOpIdx oi; + MemOp op = MO_TE | SHIFT; #if !defined(SOFTMMU_CODE_ACCESS) - uint16_t meminfo = trace_mem_build_info(SHIFT, false, MO_TE, false, mmu_idx); + uint16_t meminfo = trace_mem_get_info(op, mmu_idx, false); trace_guest_mem_before_exec(env_cpu(env), ptr, meminfo); #endif @@ -96,9 +96,9 @@ glue(glue(glue(cpu_ld, USUFFIX), MEMSUFFIX), _ra)(CPUArchState *env, entry = tlb_entry(env, mmu_idx, addr); if (unlikely(entry->ADDR_READ != (addr & (TARGET_PAGE_MASK | (DATA_SIZE - 1))))) { - oi = make_memop_idx(SHIFT, mmu_idx); + TCGMemOpIdx oi = make_memop_idx(op, mmu_idx); res = glue(glue(helper_ret_ld, URETSUFFIX), MMUSUFFIX)(env, addr, - oi, retaddr); + oi, retaddr); } else { uintptr_t hostaddr = addr + entry->addend; res = glue(glue(ld, USUFFIX), _p)((uint8_t *)hostaddr); @@ -125,9 +125,9 @@ glue(glue(glue(cpu_lds, SUFFIX), MEMSUFFIX), _ra)(CPUArchState *env, int res; target_ulong addr; int mmu_idx = CPU_MMU_INDEX; - TCGMemOpIdx oi; -#if !defined(SOFTMMU_CODE_ACCESS) - uint16_t meminfo = trace_mem_build_info(SHIFT, true, MO_TE, false, mmu_idx); + MemOp op = MO_TE | MO_SIGN | SHIFT; +#ifndef SOFTMMU_CODE_ACCESS + uint16_t meminfo = trace_mem_get_info(op, mmu_idx, false); trace_guest_mem_before_exec(env_cpu(env), ptr, meminfo); #endif @@ -135,7 +135,7 @@ glue(glue(glue(cpu_lds, SUFFIX), MEMSUFFIX), _ra)(CPUArchState *env, entry = tlb_entry(env, mmu_idx, addr); if (unlikely(entry->ADDR_READ != (addr & (TARGET_PAGE_MASK | (DATA_SIZE - 1))))) { - oi = make_memop_idx(SHIFT, mmu_idx); + TCGMemOpIdx oi = make_memop_idx(op & ~MO_SIGN, mmu_idx); res = (DATA_STYPE)glue(glue(helper_ret_ld, SRETSUFFIX), MMUSUFFIX)(env, addr, oi, retaddr); } else { @@ -167,9 +167,9 @@ glue(glue(glue(cpu_st, SUFFIX), MEMSUFFIX), _ra)(CPUArchState *env, CPUTLBEntry *entry; target_ulong addr; int mmu_idx = CPU_MMU_INDEX; - TCGMemOpIdx oi; + MemOp op = MO_TE | SHIFT; #if !defined(SOFTMMU_CODE_ACCESS) - uint16_t meminfo = trace_mem_build_info(SHIFT, false, MO_TE, true, mmu_idx); + uint16_t meminfo = trace_mem_get_info(op, mmu_idx, true); trace_guest_mem_before_exec(env_cpu(env), ptr, meminfo); #endif @@ -177,7 +177,7 @@ glue(glue(glue(cpu_st, SUFFIX), MEMSUFFIX), _ra)(CPUArchState *env, entry = tlb_entry(env, mmu_idx, addr); if (unlikely(tlb_addr_write(entry) != (addr & (TARGET_PAGE_MASK | (DATA_SIZE - 1))))) { - oi = make_memop_idx(SHIFT, mmu_idx); + TCGMemOpIdx oi = make_memop_idx(op, mmu_idx); glue(glue(helper_ret_st, SUFFIX), MMUSUFFIX)(env, addr, v, oi, retaddr); } else { diff --git a/include/exec/cpu_ldst_useronly_template.h b/include/exec/cpu_ldst_useronly_template.h index dbdc7a845d..e5a3d1983a 100644 --- a/include/exec/cpu_ldst_useronly_template.h +++ b/include/exec/cpu_ldst_useronly_template.h @@ -70,8 +70,8 @@ glue(glue(cpu_ld, USUFFIX), MEMSUFFIX)(CPUArchState *env, abi_ptr ptr) ret = glue(glue(ld, USUFFIX), _p)(g2h(ptr)); clear_helper_retaddr(); #else - uint16_t meminfo = trace_mem_build_info(SHIFT, false, MO_TE, false, - MMU_USER_IDX); + MemOp op = MO_TE | SHIFT; + uint16_t meminfo = trace_mem_get_info(op, MMU_USER_IDX, false); trace_guest_mem_before_exec(env_cpu(env), ptr, meminfo); ret = glue(glue(ld, USUFFIX), _p)(g2h(ptr)); #endif @@ -102,8 +102,8 @@ glue(glue(cpu_lds, SUFFIX), MEMSUFFIX)(CPUArchState *env, abi_ptr ptr) ret = glue(glue(lds, SUFFIX), _p)(g2h(ptr)); clear_helper_retaddr(); #else - uint16_t meminfo = trace_mem_build_info(SHIFT, true, MO_TE, false, - MMU_USER_IDX); + MemOp op = MO_TE | MO_SIGN | SHIFT; + uint16_t meminfo = trace_mem_get_info(op, MMU_USER_IDX, false); trace_guest_mem_before_exec(env_cpu(env), ptr, meminfo); ret = glue(glue(lds, SUFFIX), _p)(g2h(ptr)); qemu_plugin_vcpu_mem_cb(env_cpu(env), ptr, meminfo); @@ -131,8 +131,8 @@ static inline void glue(glue(cpu_st, SUFFIX), MEMSUFFIX)(CPUArchState *env, abi_ptr ptr, RES_TYPE v) { - uint16_t meminfo = trace_mem_build_info(SHIFT, false, MO_TE, true, - MMU_USER_IDX); + MemOp op = MO_TE | SHIFT; + uint16_t meminfo = trace_mem_get_info(op, MMU_USER_IDX, true); trace_guest_mem_before_exec(env_cpu(env), ptr, meminfo); glue(glue(st, SUFFIX), _p)(g2h(ptr), v); qemu_plugin_vcpu_mem_cb(env_cpu(env), ptr, meminfo);