From patchwork Wed Jul 10 17:35:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Juszkiewicz X-Patchwork-Id: 811792 Delivered-To: patch@linaro.org Received: by 2002:adf:ee12:0:b0:367:895a:4699 with SMTP id y18csp868443wrn; Wed, 10 Jul 2024 10:36:22 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW/KVlRm7tMRs8f1iJZFGdmzSQSEoVnYdbFdPEu5jxJKVcddYrL4H1Ypxd8a75qpIxZ1djSylJ2IHjU+IhNUqZ5 X-Google-Smtp-Source: AGHT+IGgep63YcVGhEJn5MtN6s+QEg808Uo2CT2Ry7i4S168xaBYn/TvkwMUNOUvM3m7j4OwZF6G X-Received: by 2002:a05:6214:1cce:b0:6b5:2bfa:edd5 with SMTP id 6a1803df08f44-6b74af7539dmr7367066d6.17.1720632982162; Wed, 10 Jul 2024 10:36:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720632982; cv=none; d=google.com; s=arc-20160816; b=nQBEuiuZZ5MKEiBrDsKZxHzvEuAB5FYDKIjadZh99PPcLjXzx+U9fbKULiQFM+5zQd lo+J5oSOZA975uK2em1biLhJalJgtTxB1jn+ODjv6GDkIXabSlIUmuff7HpD9xwesgPY oWV7LM9fZba9Qku3ql/uNXoYQ4Ufp6Ags3cxZs9Q80ofe/95nhTuJlSRAfK9n7J9V9IG g+B/EvNt6LZgQMgbX2dYTyS/AtaF4qw4p9haYPc4Yaa0A6L+C+ZJEdVmIj+fmF/S9xT9 fgxNmsvpRdZUoOqrJdF1KHj0ZYNvTK8kSMoZQAY+dL+13VqhlS0reu1w8CGlSGn6o8+U 9n9A== 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; bh=mwagZqSCpedYb+WqMmDTr5Fxxg7AlmwoZwYNHZ85Sr8=; fh=JUheaOjOSqTLW/EiG+V3hkK3/QF0uCT5G8az9TpE/D0=; b=kiM7qzQaUjd0aUYFrEIQIBzrcl8wYNuPrCBS/eVwmJkI99oTcCmZMaYt/h8yxD2gof XaUWbPaDyCcTu3msfPBQKwyPKvREVotRsK7nPKcpCQE8owCYIMA4xVSxaVuVgXBvhbnd hXt4Z8/mQbqjUWN9C7WHeE8PT1FC8/FRMsUfmdIjgR69V+D545lz8XAc7ItWVxRICLT6 JmBGgKPdp4luwVE9bEDNXaQWzoALMggCYkCAD4nn9WS9UEdnU3ikzDYUI9gdzkZNh3QM YF20NVb/obz/VxraB/Y4WnRKiW3mSGRwO/G+x70qyyekss4Ao3J2s5BrohTaiu7vI1mh ScOg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 6a1803df08f44-6b61bab7d01si50567356d6.416.2024.07.10.10.36.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jul 2024 10:36:22 -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; 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=fail (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 1sRbE8-0008Kg-OL; Wed, 10 Jul 2024 13:35:36 -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 1sRbE6-0008Hs-82; Wed, 10 Jul 2024 13:35:34 -0400 Received: from muminek.juszkiewicz.com.pl ([213.251.184.221]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sRbDy-0007FJ-Ji; Wed, 10 Jul 2024 13:35:33 -0400 Received: from localhost (localhost [127.0.0.1]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTP id EED10261989; Wed, 10 Jul 2024 19:35:20 +0200 (CEST) X-Virus-Scanned: Debian amavis at juszkiewicz.com.pl Received: from muminek.juszkiewicz.com.pl ([127.0.0.1]) by localhost (muminek.juszkiewicz.com.pl [127.0.0.1]) (amavis, port 10024) with ESMTP id qd8wG7v7voex; Wed, 10 Jul 2024 19:35:19 +0200 (CEST) Received: from applejack.lan (83.8.74.165.ipv4.supernova.orange.pl [83.8.74.165]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTPSA id 44644260662; Wed, 10 Jul 2024 19:35:18 +0200 (CEST) From: Marcin Juszkiewicz To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell , Marcin Juszkiewicz Subject: [PATCH 1/1] target/arm: calculate cache sizes properly Date: Wed, 10 Jul 2024 19:35:12 +0200 Message-ID: <20240710173512.424547-1-marcin.juszkiewicz@linaro.org> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Received-SPF: softfail client-ip=213.251.184.221; envelope-from=marcin.juszkiewicz@linaro.org; helo=muminek.juszkiewicz.com.pl X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 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 Neoverse-V1 TRM says that NumSets are [27:13] not :32 like in code. With this fix all cores which use make_ccsidr64() function have proper size of cpu caches. Signed-off-by: Marcin Juszkiewicz --- target/arm/tcg/cpu64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/arm/tcg/cpu64.c b/target/arm/tcg/cpu64.c index fe232eb306..98144e1d20 100644 --- a/target/arm/tcg/cpu64.c +++ b/target/arm/tcg/cpu64.c @@ -50,7 +50,7 @@ static uint64_t make_ccsidr64(unsigned assoc, unsigned linesize, sets = cachesize / (assoc * linesize); assert(cachesize % (assoc * linesize) == 0); - return ((uint64_t)(sets - 1) << 32) + return ((uint64_t)(sets - 1) << 13) | ((assoc - 1) << 3) | (lg_linesize - 4); }