From patchwork Tue May 16 19:40:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 682425 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp21117wrt; Tue, 16 May 2023 12:59:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7q0R0DwlraZCvigEBxKdQJsbDYJilPTobxVw1SHSTPOu9028TkMYSTeCO5pUp0RkJPl24a X-Received: by 2002:a5d:5503:0:b0:306:2d3d:a108 with SMTP id b3-20020a5d5503000000b003062d3da108mr28758459wrv.11.1684267181213; Tue, 16 May 2023 12:59:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684267181; cv=none; d=google.com; s=arc-20160816; b=BWcR5nhip0Exg0zTAAPH07DAW8+uwBMx0M/IuQSSFBrTVwCNgsKaI1vJlWODaBGTmu R7tL0ue2iTVQ7Pmtfq7l15+OpP/kmc8CSsTy8zvUNK+CCiDfKiTkWd9q0Ya/dh2Vu6y1 wiFc6awCo5cF9BzTmSR7yLJNKtyssEH/NATAivUPlizRnG1kZ48s8KoTT8+oxBHDveIz f4RHmSRB+ximVd+GOGoEBzHRXYZmYU1+RcHHzAR11QWisO52ktxS/bx0W9c6bb3Hd1IB Tvtq3l6nUcP5ZCI0G041+Ohm3TKZpkmxV/sKiKzAqBAn7ICFffx+zjuiTDDqtRRnleC8 wR2Q== 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:cc:to :from:dkim-signature; bh=aZUd62xGtvRPa1FRa9Mi8zYQ92RuZVwVBZs3Zj8eEbg=; b=ZO7fc9KKWhkfl8/UTs6PVxRrm3XMAJp6P8lmDN0fYqfAKj4lgOIbIQ1w91BNQLkjYe F4Tem3j26jrxw7/GQmODfdpmXsK1mBHeV9LkeA4TKBqRVUZOPkpZ7HHqtKUaRHKLEZVE pR6qrp06hJf57i8vbylxSyIRmCbXebe9te/7G+qDcujNBLsZ1aW3QV+K4IXd8vPNwoDC q5RSisv/hLYkmj5QAUm9mO77QDgcM6PsAZgHKVgNuWNlX73w1v/ZUNSDRdE9fjrBr4mw WKkkVFYpGopcOP7xPN7P7HZ3qXA4tziMr+FeBFpe9eXEgKd7md+OBdk7kowkZuYQY2xp a8Ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XlVNmIKb; 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 t14-20020a5d534e000000b002d6f7a90367si170643wrv.598.2023.05.16.12.59.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 May 2023 12:59:41 -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=XlVNmIKb; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pz0YX-0006bf-PD; Tue, 16 May 2023 15:41:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pz0YW-0006ZW-F4 for qemu-devel@nongnu.org; Tue, 16 May 2023 15:41:56 -0400 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pz0YU-0002kQ-UB for qemu-devel@nongnu.org; Tue, 16 May 2023 15:41:56 -0400 Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-517ab9a4a13so13454317a12.1 for ; Tue, 16 May 2023 12:41:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684266113; x=1686858113; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aZUd62xGtvRPa1FRa9Mi8zYQ92RuZVwVBZs3Zj8eEbg=; b=XlVNmIKbrrbGacnSgcgO5afg1+ME5yMMZcoSitTUmvRPk1x0rfPqlUvu55SlGIlgdF KWj2OxMKAGP291nWrFiU2L6mX+/zagcb6gvOJMTr8+cgaUGlhxvomsUiEmIhd+KG9VS+ kqCettpfBsdVt4AZ+cFoKQbGggSRCvXkhMcrsgcHE1Qj1w0tIAJuNmrp683NbubbE0et OTVRJ9Gd0rBEr6f1Ig1G51b/smA5WwM0/LpdMs/B+Dy+ogQknfFsJOlx+nEHu4Bhkw5A ZKnsyGiBhq0dWF7IvqNRbvVOY7ERKxeS7wu+ASw/C4izRo8mUmuvC/5prWoKUDX83rsz Vllw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684266113; x=1686858113; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aZUd62xGtvRPa1FRa9Mi8zYQ92RuZVwVBZs3Zj8eEbg=; b=g6vLdoGJ8vjU1opq5yXJXt44L6WG2RgMMCuTCytDzu9plV4XUu7zb1Fdc3fDNp+hrx ZJRrgLyFRn3lreq2H5u62it/mwlBcihIb7fMyJMRV1GKSrc62Yoiy8s0hrfHEjIakhgu dB4P+3/h7QbBxpYZDuGMjNdsYbul8uVVI0GF9nUua8Jz23csWJ4edzGbeXD9Td7PheGC CHHKb33EeNSYvxdyfFdCB61ppV1W2P1vnZj/8QvI8EooanYiGxEgWk3/DT9fc5RjAVd4 fv+NhLOrGdfJ1j9p0phZoor5G5iTlM4IQzEmgxZmaI6kThLr+Bk9DR+N9PU0cmAAPHGm 7asQ== X-Gm-Message-State: AC+VfDxV5mrlMoGpDt/CPe9c4L8khfxamzTKNZqQwHJzLmj5MxvLMkBr K00XEbacaBvX1AMfhVkJTWPPsqCGopAtJk/Qstg= X-Received: by 2002:a05:6a21:3290:b0:100:9969:8cf with SMTP id yt16-20020a056a21329000b00100996908cfmr40995870pzb.49.1684266113671; Tue, 16 May 2023 12:41:53 -0700 (PDT) Received: from stoup.. ([2602:ae:1598:4c01:ec81:440e:33a4:40b9]) by smtp.gmail.com with ESMTPSA id z21-20020aa791d5000000b006260526cf0csm13771165pfa.116.2023.05.16.12.41.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 12:41:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 07/80] tcg/tci: Use helper_{ld,st}*_mmu for user-only Date: Tue, 16 May 2023 12:40:32 -0700 Message-Id: <20230516194145.1749305-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230516194145.1749305-1-richard.henderson@linaro.org> References: <20230516194145.1749305-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::534; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x534.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+patch=linaro.org@nongnu.org We can now fold these two pieces of code. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/tci.c | 89 ------------------------------------------------------- 1 file changed, 89 deletions(-) diff --git a/tcg/tci.c b/tcg/tci.c index 5bde2e1f2e..15f2f8c463 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -292,7 +292,6 @@ static uint64_t tci_qemu_ld(CPUArchState *env, target_ulong taddr, MemOp mop = get_memop(oi); uintptr_t ra = (uintptr_t)tb_ptr; -#ifdef CONFIG_SOFTMMU switch (mop & MO_SSIZE) { case MO_UB: return helper_ldub_mmu(env, taddr, oi, ra); @@ -311,58 +310,6 @@ static uint64_t tci_qemu_ld(CPUArchState *env, target_ulong taddr, default: g_assert_not_reached(); } -#else - void *haddr = g2h(env_cpu(env), taddr); - unsigned a_mask = (1u << get_alignment_bits(mop)) - 1; - uint64_t ret; - - set_helper_retaddr(ra); - if (taddr & a_mask) { - helper_unaligned_ld(env, taddr); - } - switch (mop & (MO_BSWAP | MO_SSIZE)) { - case MO_UB: - ret = ldub_p(haddr); - break; - case MO_SB: - ret = ldsb_p(haddr); - break; - case MO_LEUW: - ret = lduw_le_p(haddr); - break; - case MO_LESW: - ret = ldsw_le_p(haddr); - break; - case MO_LEUL: - ret = (uint32_t)ldl_le_p(haddr); - break; - case MO_LESL: - ret = (int32_t)ldl_le_p(haddr); - break; - case MO_LEUQ: - ret = ldq_le_p(haddr); - break; - case MO_BEUW: - ret = lduw_be_p(haddr); - break; - case MO_BESW: - ret = ldsw_be_p(haddr); - break; - case MO_BEUL: - ret = (uint32_t)ldl_be_p(haddr); - break; - case MO_BESL: - ret = (int32_t)ldl_be_p(haddr); - break; - case MO_BEUQ: - ret = ldq_be_p(haddr); - break; - default: - g_assert_not_reached(); - } - clear_helper_retaddr(); - return ret; -#endif } static void tci_qemu_st(CPUArchState *env, target_ulong taddr, uint64_t val, @@ -371,7 +318,6 @@ static void tci_qemu_st(CPUArchState *env, target_ulong taddr, uint64_t val, MemOp mop = get_memop(oi); uintptr_t ra = (uintptr_t)tb_ptr; -#ifdef CONFIG_SOFTMMU switch (mop & MO_SIZE) { case MO_UB: helper_stb_mmu(env, taddr, val, oi, ra); @@ -388,41 +334,6 @@ static void tci_qemu_st(CPUArchState *env, target_ulong taddr, uint64_t val, default: g_assert_not_reached(); } -#else - void *haddr = g2h(env_cpu(env), taddr); - unsigned a_mask = (1u << get_alignment_bits(mop)) - 1; - - set_helper_retaddr(ra); - if (taddr & a_mask) { - helper_unaligned_st(env, taddr); - } - switch (mop & (MO_BSWAP | MO_SIZE)) { - case MO_UB: - stb_p(haddr, val); - break; - case MO_LEUW: - stw_le_p(haddr, val); - break; - case MO_LEUL: - stl_le_p(haddr, val); - break; - case MO_LEUQ: - stq_le_p(haddr, val); - break; - case MO_BEUW: - stw_be_p(haddr, val); - break; - case MO_BEUL: - stl_be_p(haddr, val); - break; - case MO_BEUQ: - stq_be_p(haddr, val); - break; - default: - g_assert_not_reached(); - } - clear_helper_retaddr(); -#endif } #if TCG_TARGET_REG_BITS == 64