From patchwork Tue Apr 11 01:04:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 672298 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:184:0:0:0:0 with SMTP id p4csp536587wrx; Mon, 10 Apr 2023 18:10:20 -0700 (PDT) X-Google-Smtp-Source: AKy350alN+pkD8Vo97/D55tricffY3shVZJjcGph3cR1nXAHImgg7rCtwnlS5uXo/v5DufErwYIA X-Received: by 2002:a05:6214:491:b0:5c8:dc85:ea1e with SMTP id pt17-20020a056214049100b005c8dc85ea1emr26760350qvb.32.1681175420743; Mon, 10 Apr 2023 18:10:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681175420; cv=none; d=google.com; s=arc-20160816; b=mDUMkvU9O2hTmlJR0sVxlw2op7OlOgzb9iFTiYq/Jerdn7VIOYzo49uBxm5RALyIuz Wn6/hm7ZxnMnHZzps5rMzyapKeS4eVBusMEWAEQA0JRHIlpx6VP8rPFgIUGtuqHMgiJ9 K2YFwFTSYEhOG3SnrR2cqkGjwGhrjg4+20GDsA6/NQnTnhnW/k5MPahply0+JSdbg65F FUJiaZ5OLM+sc3tbmZxhOsPh0RFXRCu/NwBbXwE6aPyhFMKsSM04D49Uduc0DQbMbSa7 cQhxkXSLE8tRb5joulVNRG4PoV8N82PHPFujrnI7Y/MSy/2AHfeR4vmy/NVJ7XgUg7iW Qpbw== 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=vffLA6ITUH1RC89+Um/oqg3axNWKis5tXBpqYQoVR8s=; b=f+8zdh0OimnUNxMzWp9AA5wRpeL7Y2ZAoty0TWXD9SHXKARZPZQYNVVdBvzqHrzVTi p+Xuts06bWJowgu+KRAJAd3q2COTH3kOCSkzJEu+wfisdUZ5zaMtPz8nrvHUL+DCdAy/ 26JQARoYBSxMMQ4DHkw23NnurDC6nlIj50Y4wQ/EeoRGnZpcznCVsKAapJYUSoMVPim0 Bu2kepczNMZmWRTPW8dFlHbXgk32+VznNhfq2GswVVezrav7ItWEjseyJQwJr1985MrY PXDbL6mjGfkqENI/0xCFfamdkEcF0rT7YwZoWgItHDnzDkJ9w336oF0Zd5//Snefszai oERQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SX+0qKue; 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 g7-20020a0562140ac700b0053b81ec39f4si8909846qvi.462.2023.04.10.18.10.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Apr 2023 18:10:20 -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=SX+0qKue; 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 1pm2TP-0007y9-DT; Mon, 10 Apr 2023 21:07:03 -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 1pm2TC-0006Q1-Cy for qemu-devel@nongnu.org; Mon, 10 Apr 2023 21:06:50 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pm2TA-0000Xf-KV for qemu-devel@nongnu.org; Mon, 10 Apr 2023 21:06:50 -0400 Received: by mail-pj1-x1032.google.com with SMTP id l9-20020a17090a3f0900b0023d32684e7fso287898pjc.1 for ; Mon, 10 Apr 2023 18:06:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681175208; 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=vffLA6ITUH1RC89+Um/oqg3axNWKis5tXBpqYQoVR8s=; b=SX+0qKuejVeKodYBxSyk/c74ufKyZSJiedICp+cHuN1g6+IRVfjDigDGyD07Tg5jia JY21yqacr4PMMcNiPOmndMCRsalKYtKHqhu5/D3Y6G6EZg7Th28y0dexO/OGveo65hFJ Rw+qjJAVPRe2DKmsfSeEkD6jC/Wjhs5W3fuNbQFYI7qpApJS41kV8Wb2RU1CKqS34G3H BoI0uq75aqXbv93SBwQFi9Z4/0K991NLWSRfcu4yeVhl+I1UgzSUOfEA5WQdCd1dV8Ak 6qKDz+FXYzOmVESS/W23OP0oiG7QqGMPkj6nZYc25e2pjgxmWB/tZtY7OKbFS8Y80GB3 tJzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681175208; 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=vffLA6ITUH1RC89+Um/oqg3axNWKis5tXBpqYQoVR8s=; b=bx6Un1jxiAKvC33z8Xldq0qW0/k396BfqKAnFfVPtZDbaznHqD2gtWnWm+p4vo/fXP yhpsiQFqWMGGPPlr0w4aZ4FWC926JBpqVinJC/CG9oohyK4ni6Itn06epi2/DwIXUEfw 8Kj0Mt5mpNm2pbKDxUegKYdn0wxzdZNP2TY4ydukWpMa4dYxwEN01yBdC2VVOXWMBtwX cI25bAuet86mVMD7hgQs9/FFR98BZvCoQtaFo54W2+iYwJR2zkplKecPb+aBGiIsF48S wOtpsF4ZL23e54nSOiv5RGV/7F9UC+aCm0yIwlfumy57jfnQuoFtM9yOfuQM64N5atRb 4o8A== X-Gm-Message-State: AAQBX9eKpz69lt9eN8monjY5YKI8VjRvO1UU2tuvkRPF5xE7k2PHvjDw IwrnmM+oySXPcIAxDL6MXP2mu3mrQpkA/BtM/p6vAQ== X-Received: by 2002:a17:903:6c4:b0:1a6:523c:8583 with SMTP id kj4-20020a17090306c400b001a6523c8583mr1967808plb.68.1681175207750; Mon, 10 Apr 2023 18:06:47 -0700 (PDT) Received: from stoup.WiFi.IPv4InfoBelow (h146.238.133.40.static.ip.windstream.net. [40.133.238.146]) by smtp.gmail.com with ESMTPSA id s10-20020a65690a000000b0051b0e564963sm1320291pgq.49.2023.04.10.18.06.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Apr 2023 18:06:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org Subject: [PATCH v2 34/54] tcg: Widen helper_*_st[bw]_mmu val arguments Date: Mon, 10 Apr 2023 18:04:52 -0700 Message-Id: <20230411010512.5375-35-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230411010512.5375-1-richard.henderson@linaro.org> References: <20230411010512.5375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.google.com X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 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, SUSPICIOUS_RECIPS=2.51 autolearn=no 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 While the old type was correct in the ideal sense, some ABIs require the argument to be zero-extended. Using uint32_t for all such values is a decent compromise. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- include/tcg/tcg-ldst.h | 10 +++++++--- accel/tcg/cputlb.c | 6 +++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/include/tcg/tcg-ldst.h b/include/tcg/tcg-ldst.h index 2ba22bd5fe..f79bb4ef0c 100644 --- a/include/tcg/tcg-ldst.h +++ b/include/tcg/tcg-ldst.h @@ -55,15 +55,19 @@ tcg_target_ulong helper_be_ldsw_mmu(CPUArchState *env, target_ulong addr, tcg_target_ulong helper_be_ldsl_mmu(CPUArchState *env, target_ulong addr, MemOpIdx oi, uintptr_t retaddr); -void helper_ret_stb_mmu(CPUArchState *env, target_ulong addr, uint8_t val, +/* + * Value extended to at least uint32_t, so that some abis do not require + * zero-extension from uint8_t or uint16_t. + */ +void helper_ret_stb_mmu(CPUArchState *env, target_ulong addr, uint32_t val, MemOpIdx oi, uintptr_t retaddr); -void helper_le_stw_mmu(CPUArchState *env, target_ulong addr, uint16_t val, +void helper_le_stw_mmu(CPUArchState *env, target_ulong addr, uint32_t val, MemOpIdx oi, uintptr_t retaddr); void helper_le_stl_mmu(CPUArchState *env, target_ulong addr, uint32_t val, MemOpIdx oi, uintptr_t retaddr); void helper_le_stq_mmu(CPUArchState *env, target_ulong addr, uint64_t val, MemOpIdx oi, uintptr_t retaddr); -void helper_be_stw_mmu(CPUArchState *env, target_ulong addr, uint16_t val, +void helper_be_stw_mmu(CPUArchState *env, target_ulong addr, uint32_t val, MemOpIdx oi, uintptr_t retaddr); void helper_be_stl_mmu(CPUArchState *env, target_ulong addr, uint32_t val, MemOpIdx oi, uintptr_t retaddr); diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index e984a98dc4..665c41fc12 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -2503,7 +2503,7 @@ full_stb_mmu(CPUArchState *env, target_ulong addr, uint64_t val, store_helper(env, addr, val, oi, retaddr, MO_UB); } -void helper_ret_stb_mmu(CPUArchState *env, target_ulong addr, uint8_t val, +void helper_ret_stb_mmu(CPUArchState *env, target_ulong addr, uint32_t val, MemOpIdx oi, uintptr_t retaddr) { full_stb_mmu(env, addr, val, oi, retaddr); @@ -2516,7 +2516,7 @@ static void full_le_stw_mmu(CPUArchState *env, target_ulong addr, uint64_t val, store_helper(env, addr, val, oi, retaddr, MO_LEUW); } -void helper_le_stw_mmu(CPUArchState *env, target_ulong addr, uint16_t val, +void helper_le_stw_mmu(CPUArchState *env, target_ulong addr, uint32_t val, MemOpIdx oi, uintptr_t retaddr) { full_le_stw_mmu(env, addr, val, oi, retaddr); @@ -2529,7 +2529,7 @@ static void full_be_stw_mmu(CPUArchState *env, target_ulong addr, uint64_t val, store_helper(env, addr, val, oi, retaddr, MO_BEUW); } -void helper_be_stw_mmu(CPUArchState *env, target_ulong addr, uint16_t val, +void helper_be_stw_mmu(CPUArchState *env, target_ulong addr, uint32_t val, MemOpIdx oi, uintptr_t retaddr) { full_be_stw_mmu(env, addr, val, oi, retaddr);