From patchwork Fri Apr 19 11:05:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 790192 Delivered-To: patch@linaro.org Received: by 2002:adf:e6ca:0:b0:346:15ad:a2a with SMTP id y10csp1005676wrm; Fri, 19 Apr 2024 04:06:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVEi2APY+uTr4RlMFjixDNQsKJb3TLhwbBg3KXQWhabvG4NXUZVVqyELXYMuN6QYzeRvbtx200SURbEzYTBKlzF X-Google-Smtp-Source: AGHT+IH+DVtc8ZB6xkX1+gZuErlx/eQqW8yanc7XZ/vj3TAh+dCnHs/za5HX7oqf57srhifhMMpK X-Received: by 2002:aca:1816:0:b0:3c7:c13:e67c with SMTP id h22-20020aca1816000000b003c70c13e67cmr1561605oih.7.1713524776887; Fri, 19 Apr 2024 04:06:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1713524776; cv=none; d=google.com; s=arc-20160816; b=AATBRID/Aaakach/7ow3zbkzzBTadMFjOMJWDVduhWgMopbmXMMZTS2Q8HQtxxXf8u N0tsApZx1Rb7pqjfiFgO6qpc9CGbxUYqqZ14XBEpaJLbWNdlbzcG9y1sB7npOlfvaUs5 Jzs5UT6je1m6IdevDcaQzqLgJEI4t94so4A7Z/AUriWlkKZW4/l9f2KMexQ7kCxTafUb 0RmiBSK4y/UZC6I3VCeInqVZs0cZ++8oadnhgnJWqy0k34sB56mwh9ghgLpCPhqQUju2 mwYTAmkRp9cQPRPL4K1OUryCxwlJD5G50iPpmODDn6QKZwxihFwsxaK8qZr+RPKXY2dp dkkg== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=KdTZXTwvt7Tibj/dR564Jrh2V5NCXVN+EQdPOip61Ds=; fh=34AXXcvMddlcO2UO9RPITn+GRAgB1DNSTc5BofHfQM0=; b=c0oh6dJmtzS9vqJVmjQlcVGU68RTSQgogyIx59I3SicChqV21k/hniKH0yYu3k1iee Etcjy9DlfvM3+ockVe4tWJ4QLbarLxHdtBpnECZQFbfCSla0NdllTLGekb+1W8/bq0ZS JQZV19G3NMWwX8oLQGYxNhMfsGmTPDOE52XATCenEsFhHRTDAh/aApYqZAxAAAh81O9g yfUC96JNcLH2V4Dpu9YrLXF7rTLBmHCvaAeRQxC3/pp83txSBbitjvgy/Qg8y1s13TbN Xi4BKKkX7RlBbOC1UoM5M/nAHGuztSbAMFBl/EaylJOupyN/Ii/WnH4OHp0IvWm+hzA5 v1jw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Mzq06ahm; 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 j16-20020a05622a039000b0043680b4652dsi3461182qtx.153.2024.04.19.04.06.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Apr 2024 04:06:16 -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=Mzq06ahm; 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 1rxm3X-0003Ah-5y; Fri, 19 Apr 2024 07:05:23 -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 1rxm3U-00039G-QC for qemu-devel@nongnu.org; Fri, 19 Apr 2024 07:05:20 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rxm3T-00017n-23 for qemu-devel@nongnu.org; Fri, 19 Apr 2024 07:05:20 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3481bb34e7dso1068299f8f.3 for ; Fri, 19 Apr 2024 04:05:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713524717; x=1714129517; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=KdTZXTwvt7Tibj/dR564Jrh2V5NCXVN+EQdPOip61Ds=; b=Mzq06ahm+tSV8vLYUKsmHYnTvan1asKQaU20iU7wQC02nvrD+9xiVepS1baLLcMZJs I1O2ATu0iTP5l5faz00JqlgPfy0JsyuOXAgLPZGTpvjnUQhYj61ZhtPVBpQIqRsi0M/a MpoipAOEbGnN4umKFmyaoqxBc8Efm1QPIxS5+EACDiqQXOf9rsHZFszisQFdBeFlCj7p QALekJx8I6YsKlPzqjWiZ3wzYa58/z6hYF4m8XfaCNTkjUjrXzfyR0MmWs+MQY99JcaV U5YCFl6NJjudz5k1ZA7a9HNXI+O4nqnTYkeC3aGauTfSRU9Is2/gChFpsuYl7DRmtBkh JHoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713524717; x=1714129517; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=KdTZXTwvt7Tibj/dR564Jrh2V5NCXVN+EQdPOip61Ds=; b=RbV+0fwBvKH7dTQ8yKrZ2BWcYaC2TlMumPhQ+e0kzb07tSKr6daByl7DJQpGGNyN+6 27bmUMVOh5bkkymupafHPorKYYRynDJXzBoJSDy/hCyyEy2XHjClrYD+uT9xHCEP35Ee Qu/f72ItewSwk6iO4+HmuQ4KHRHgmYMithTfIE92PYBM7V50j0AoWdWIt143ZR7ZXTXi Fzi+qkVlVWblJ5gkTAzy5QXj5W9zC+qIew1RGRfTvg99xnLvkc6CGicHwcXQSLC/sjId vRXuLRjy/bHYyHYMgxtrBqbTbmuWi8mCzJC87JWVhaynCNfKhPNjc7OJ82GrgwmPZPcT AZ9g== X-Gm-Message-State: AOJu0YyjZ8TIdqHzSbPLZUV7iIC1JQQmIAnvwV7tXEg8MEpeoCG6Jv9h ksHaZbq4mFzVZTWkgyuyN/0FZt8fiWmVVKwzBaMfg04akuScVATF0hY01xcHZT9Ykfvinma5NgU Aok8= X-Received: by 2002:a5d:64a6:0:b0:34a:65c8:7413 with SMTP id m6-20020a5d64a6000000b0034a65c87413mr1048059wrp.30.1713524716913; Fri, 19 Apr 2024 04:05:16 -0700 (PDT) Received: from m1x-phil.lan ([176.176.143.233]) by smtp.gmail.com with ESMTPSA id p3-20020a5d6383000000b00341b451a31asm4159105wru.36.2024.04.19.04.05.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 19 Apr 2024 04:05:16 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, Palmer Dabbelt , Bin Meng , Alistair Francis , Christoph Muellner , Philipp Tomsich , Liu Zhiwei , Weiwei Li , Palmer Dabbelt , Daniel Henrique Barboza , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Zhiwei Jiang Subject: [PATCH] target/riscv: Use get_address() to get address with Zicbom extensions Date: Fri, 19 Apr 2024 13:05:13 +0200 Message-ID: <20240419110514.69697-1-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.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 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 need to use get_address() to get an address from cpu_gpr[], since $zero is "special" (NULL). Fixes: e05da09b7c ("target/riscv: implement Zicbom extension") Reported-by: Zhiwei Jiang (姜智伟) Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Daniel Henrique Barboza --- target/riscv/insn_trans/trans_rvzicbo.c.inc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/riscv/insn_trans/trans_rvzicbo.c.inc b/target/riscv/insn_trans/trans_rvzicbo.c.inc index d5d7095903..6f6b29598d 100644 --- a/target/riscv/insn_trans/trans_rvzicbo.c.inc +++ b/target/riscv/insn_trans/trans_rvzicbo.c.inc @@ -31,27 +31,27 @@ static bool trans_cbo_clean(DisasContext *ctx, arg_cbo_clean *a) { REQUIRE_ZICBOM(ctx); - gen_helper_cbo_clean_flush(tcg_env, cpu_gpr[a->rs1]); + gen_helper_cbo_clean_flush(tcg_env, get_address(ctx, a->rs1, 0)); return true; } static bool trans_cbo_flush(DisasContext *ctx, arg_cbo_flush *a) { REQUIRE_ZICBOM(ctx); - gen_helper_cbo_clean_flush(tcg_env, cpu_gpr[a->rs1]); + gen_helper_cbo_clean_flush(tcg_env, get_address(ctx, a->rs1, 0)); return true; } static bool trans_cbo_inval(DisasContext *ctx, arg_cbo_inval *a) { REQUIRE_ZICBOM(ctx); - gen_helper_cbo_inval(tcg_env, cpu_gpr[a->rs1]); + gen_helper_cbo_inval(tcg_env, get_address(ctx, a->rs1, 0)); return true; } static bool trans_cbo_zero(DisasContext *ctx, arg_cbo_zero *a) { REQUIRE_ZICBOZ(ctx); - gen_helper_cbo_zero(tcg_env, cpu_gpr[a->rs1]); + gen_helper_cbo_zero(tcg_env, get_address(ctx, a->rs1, 0)); return true; }