From patchwork Wed Oct 6 15:19:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515350 Delivered-To: patch@linaro.org Received: by 2002:ac0:b5cc:0:0:0:0:0 with SMTP id x12csp553305ime; Wed, 6 Oct 2021 08:53:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyK1VkzmJ5chwX93hfGdM4pRgYnJFhbVbzZHxNXMrPWH4/o8UM+ShF/2U8wINnZhLMhR+wf X-Received: by 2002:a0c:dc81:: with SMTP id n1mr7181942qvk.36.1633535605299; Wed, 06 Oct 2021 08:53:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633535605; cv=none; d=google.com; s=arc-20160816; b=sYy2D7FF4d1VAR2ACXJ5kfhmDF/C+K4h2AdpwHoavKKm3QqEUlr0MdcRomdIRYB8wL iM06YKUU/VGYffXSy2pJ44SuPj/97/tzlE+MkTDFIpL1V67A/53AVGjXV3Fob4GATqiQ UVsKY9nkeAF674Pk+4TSMlbgC/yX2NXuh1LbL1N3l3CQF8cbUeou67qYMrdcW1mdKbLo efPoGby5RAbypGtchyA5VyliG27RMZcxvDIhVunrx/8a6xGodrTb0Gn6lQbjc7d9RxmB nGwbOZ4y9k//hsgWMjJHouZMFsEOEg69PaAQZpb1mteXnxp4O9LSVvys9jspJ8u5NJEB /OiQ== 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=+Vng/DC/+XlWmqKHqL4mm5hlOnhfbQPPiclHE0IjIcQ=; b=UCfrjsYUZnvSqRVTiYKb2gzA/SiTrxtEVZsYj89UvZMySSPkVSWr9ZqAZGkffSwUtR wfuA9VsUVIntiPW0413R/Az1lNvIMFpaDR6/s8eWnn4MrDdtmfy/E5mqlihzf7ARL10G cNf6lIB+m8BZ2j3F82y49xCSTkP9CDBgiBMByg7FapY2D+YfYpSy63DsSyhd0BDQ31dZ H4jZ1MuHMN5DB+4aztW2eph0DGRfPFVmiHuEMC1kfvmy/9xEq3ti2sLes+dr5RDVpOHR NLRLn66CcHBEu8ZJaDjfn1fgNcMWH/8aqPYYi1im1DSMZifIvz/wARBfMZ1JsxGWKi92 Nw5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NBWfOc4r; 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 k11si12805762qtg.226.2021.10.06.08.53.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Oct 2021 08:53:25 -0700 (PDT) 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=NBWfOc4r; 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]:47402 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mY9ES-000618-OC for patch@linaro.org; Wed, 06 Oct 2021 11:53:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46968) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY8in-0002S4-GD for qemu-devel@nongnu.org; Wed, 06 Oct 2021 11:20:41 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]:39578) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mY8iS-0007d7-0s for qemu-devel@nongnu.org; Wed, 06 Oct 2021 11:20:32 -0400 Received: by mail-pf1-x42c.google.com with SMTP id g2so2654034pfc.6 for ; Wed, 06 Oct 2021 08:20:19 -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=+Vng/DC/+XlWmqKHqL4mm5hlOnhfbQPPiclHE0IjIcQ=; b=NBWfOc4ri7/Dprpf05gsR8q5tlJyxBbmb8BHPF9PUKArjDaAabqrTKd6nRZ/ate03I /2qpHN55ZXND8I6iFHA5JRHNnkiCXTx3PxBNofJRvzf6FEdSdpKdx9pRO/J32xgFPEmq HM099Gg+Vl4UNmkUcxTHAHTIziFHOCdT1fBOGypd+e6ZO6jraz/ShH6qyph8v8MJ0Q8E +why1gFk6dBn4SHpjCLf9J6vMRaS/9r7qVaHHppA3sV2xzpnfvX05QB37d6EVtKtPFLc 8XmJym9Ku3j+hUGzuqYRRuVWRq1tFulSnsTYppQvDvQ4eZG0C1io9rNlOhM1ElxOprv5 xP2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+Vng/DC/+XlWmqKHqL4mm5hlOnhfbQPPiclHE0IjIcQ=; b=1P5PWkXjBRgO12OK4l9Z+RxJRPH3PFxUfyVcL/wn2JiGysmOyktdMgYnmlWvoXoIYu VvgO8/n8wWUCUws1jeXCtOHSSMf1qhs0wTucnXfLSK71H/f6b6VhKR/ZhhOZ3z6FCF4m J/FU7LZ+A6C7XF/ON8TcwgVpwwkKFryH5zos7PinT3Ov7oq+Kgye9sdadQy7su57Uvzu eV6GQBzJbMgBunmeVXa7sjcb5oJ+sWNLw9Qtd/1MGBqsyOOHTmOx4xIMF0cWhotOn6qW e1hUF57hJxWA9ima30RhztjyLe/m48v3bcLJLQWAcp+yrjgq2e3hfFnLgvbFOto1lqDf E7pQ== X-Gm-Message-State: AOAM531Q2iGA35Sfsrg7uuF0EpGgi2C4GbEkucwJVg1nfmhKX/Re/jFR yaCOeF9O6pwIVPN5VYvdW6+I4LyxhVmojg== X-Received: by 2002:a62:5bc1:0:b0:44c:7905:777e with SMTP id p184-20020a625bc1000000b0044c7905777emr11257200pfb.0.1633533617881; Wed, 06 Oct 2021 08:20:17 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id 130sm22239256pfz.77.2021.10.06.08.20.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Oct 2021 08:20:17 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 04/28] accel/tcg: Drop signness in tracing in cputlb.c Date: Wed, 6 Oct 2021 08:19:50 -0700 Message-Id: <20211006152014.741026-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211006152014.741026-1-richard.henderson@linaro.org> References: <20211006152014.741026-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42c.google.com X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We are already inconsistent about whether or not MO_SIGN is set in trace_mem_get_info. Dropping it entirely allows some simplification. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 10 +++------- accel/tcg/user-exec.c | 45 ++++++------------------------------------- 2 files changed, 9 insertions(+), 46 deletions(-) -- 2.25.1 diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index b1e5471f94..0a1fdbefdd 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -2119,7 +2119,6 @@ static inline uint64_t cpu_load_helper(CPUArchState *env, abi_ptr addr, meminfo = trace_mem_get_info(op, mmu_idx, false); trace_guest_mem_before_exec(env_cpu(env), addr, meminfo); - op &= ~MO_SIGN; oi = make_memop_idx(op, mmu_idx); ret = full_load(env, addr, oi, retaddr); @@ -2137,8 +2136,7 @@ uint32_t cpu_ldub_mmuidx_ra(CPUArchState *env, abi_ptr addr, int cpu_ldsb_mmuidx_ra(CPUArchState *env, abi_ptr addr, int mmu_idx, uintptr_t ra) { - return (int8_t)cpu_load_helper(env, addr, mmu_idx, ra, MO_SB, - full_ldub_mmu); + return (int8_t)cpu_ldub_mmuidx_ra(env, addr, mmu_idx, ra); } uint32_t cpu_lduw_be_mmuidx_ra(CPUArchState *env, abi_ptr addr, @@ -2150,8 +2148,7 @@ uint32_t cpu_lduw_be_mmuidx_ra(CPUArchState *env, abi_ptr addr, int cpu_ldsw_be_mmuidx_ra(CPUArchState *env, abi_ptr addr, int mmu_idx, uintptr_t ra) { - return (int16_t)cpu_load_helper(env, addr, mmu_idx, ra, MO_BESW, - full_be_lduw_mmu); + return (int16_t)cpu_lduw_be_mmuidx_ra(env, addr, mmu_idx, ra); } uint32_t cpu_ldl_be_mmuidx_ra(CPUArchState *env, abi_ptr addr, @@ -2175,8 +2172,7 @@ uint32_t cpu_lduw_le_mmuidx_ra(CPUArchState *env, abi_ptr addr, int cpu_ldsw_le_mmuidx_ra(CPUArchState *env, abi_ptr addr, int mmu_idx, uintptr_t ra) { - return (int16_t)cpu_load_helper(env, addr, mmu_idx, ra, MO_LESW, - full_le_lduw_mmu); + return (int16_t)cpu_lduw_le_mmuidx_ra(env, addr, mmu_idx, ra); } uint32_t cpu_ldl_le_mmuidx_ra(CPUArchState *env, abi_ptr addr, diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 8fed542622..8f2644f26e 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -899,13 +899,7 @@ uint32_t cpu_ldub_data(CPUArchState *env, abi_ptr ptr) int cpu_ldsb_data(CPUArchState *env, abi_ptr ptr) { - int ret; - uint16_t meminfo = trace_mem_get_info(MO_SB, MMU_USER_IDX, false); - - trace_guest_mem_before_exec(env_cpu(env), ptr, meminfo); - ret = ldsb_p(g2h(env_cpu(env), ptr)); - qemu_plugin_vcpu_mem_cb(env_cpu(env), ptr, meminfo); - return ret; + return (int8_t)cpu_ldub_data(env, ptr); } uint32_t cpu_lduw_be_data(CPUArchState *env, abi_ptr ptr) @@ -921,13 +915,7 @@ uint32_t cpu_lduw_be_data(CPUArchState *env, abi_ptr ptr) int cpu_ldsw_be_data(CPUArchState *env, abi_ptr ptr) { - int ret; - uint16_t meminfo = trace_mem_get_info(MO_BESW, MMU_USER_IDX, false); - - trace_guest_mem_before_exec(env_cpu(env), ptr, meminfo); - ret = ldsw_be_p(g2h(env_cpu(env), ptr)); - qemu_plugin_vcpu_mem_cb(env_cpu(env), ptr, meminfo); - return ret; + return (int16_t)cpu_lduw_be_data(env, ptr); } uint32_t cpu_ldl_be_data(CPUArchState *env, abi_ptr ptr) @@ -965,13 +953,7 @@ uint32_t cpu_lduw_le_data(CPUArchState *env, abi_ptr ptr) int cpu_ldsw_le_data(CPUArchState *env, abi_ptr ptr) { - int ret; - uint16_t meminfo = trace_mem_get_info(MO_LESW, MMU_USER_IDX, false); - - trace_guest_mem_before_exec(env_cpu(env), ptr, meminfo); - ret = ldsw_le_p(g2h(env_cpu(env), ptr)); - qemu_plugin_vcpu_mem_cb(env_cpu(env), ptr, meminfo); - return ret; + return (int16_t)cpu_lduw_le_data(env, ptr); } uint32_t cpu_ldl_le_data(CPUArchState *env, abi_ptr ptr) @@ -1008,12 +990,7 @@ uint32_t cpu_ldub_data_ra(CPUArchState *env, abi_ptr ptr, uintptr_t retaddr) int cpu_ldsb_data_ra(CPUArchState *env, abi_ptr ptr, uintptr_t retaddr) { - int ret; - - set_helper_retaddr(retaddr); - ret = cpu_ldsb_data(env, ptr); - clear_helper_retaddr(); - return ret; + return (int8_t)cpu_ldub_data_ra(env, ptr, retaddr); } uint32_t cpu_lduw_be_data_ra(CPUArchState *env, abi_ptr ptr, uintptr_t retaddr) @@ -1028,12 +1005,7 @@ uint32_t cpu_lduw_be_data_ra(CPUArchState *env, abi_ptr ptr, uintptr_t retaddr) int cpu_ldsw_be_data_ra(CPUArchState *env, abi_ptr ptr, uintptr_t retaddr) { - int ret; - - set_helper_retaddr(retaddr); - ret = cpu_ldsw_be_data(env, ptr); - clear_helper_retaddr(); - return ret; + return (int16_t)cpu_lduw_be_data_ra(env, ptr, retaddr); } uint32_t cpu_ldl_be_data_ra(CPUArchState *env, abi_ptr ptr, uintptr_t retaddr) @@ -1068,12 +1040,7 @@ uint32_t cpu_lduw_le_data_ra(CPUArchState *env, abi_ptr ptr, uintptr_t retaddr) int cpu_ldsw_le_data_ra(CPUArchState *env, abi_ptr ptr, uintptr_t retaddr) { - int ret; - - set_helper_retaddr(retaddr); - ret = cpu_ldsw_le_data(env, ptr); - clear_helper_retaddr(); - return ret; + return (int16_t)cpu_lduw_le_data_ra(env, ptr, retaddr); } uint32_t cpu_ldl_le_data_ra(CPUArchState *env, abi_ptr ptr, uintptr_t retaddr)