From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80063C433FE for ; Tue, 21 Sep 2021 06:57:39 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0C38661183 for ; Tue, 21 Sep 2021 06:57:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0C38661183 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=opensource.wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:46036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSZij-00021L-TI for qemu-devel@archiver.kernel.org; Tue, 21 Sep 2021 02:57:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52856) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSZfq-0007a7-K5 for qemu-devel@nongnu.org; Tue, 21 Sep 2021 02:54:39 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:32908) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSZfo-0003Yx-VB for qemu-devel@nongnu.org; Tue, 21 Sep 2021 02:54:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1632207277; x=1663743277; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JAjCL/YBrrsIN6lr0YfwCaKEn9AIJQHYJAHcywrCO+Y=; b=gM4hk5OKRszYGWXl8a5yhRNjPAZ8PFibyfw0Xu7mCbJTr9QedJXzBhJp gr5uNHjLjnSsIwlCQSghIpK2465oTSN6IR+/y3blK0d/Lx2iO426jL2ST enwK63tb96B7PF1eHcChExI66waDQVBLiWnsw6S/2QbnUXArqSZHcCYAe b+KSLSOVfhD/DxEnZ2s8l5bafIdNtXX76+Bi3OXkO9YZzA6K6Ej42f/fu NM2XeVZSzxbKe1Nx8ZYTxXn3lemSNhY0zyoJwn5DxzRmCYl1PmsjesvL2 kBfa0FZxfgHqX8lCaDqNFZcrO6XryYEyUm0N+QtKJMHyjkZ1ZjTXJqt7G g==; X-IronPort-AV: E=Sophos;i="5.85,310,1624291200"; d="scan'208";a="181039194" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 21 Sep 2021 14:54:36 +0800 IronPort-SDR: kwXzHysLXnGugceOOxo7SUoToEp8piOlBEw+beeBq6nveWZ7G+ygTs30YuaXRHvvA7oVJYM4z8 1CPPsniI2V4mIDgRZPqMPgypKXXaWxlgqZxuIgpIeLmCwAQOxavCZT6yVnj7+SkL8St1gHqPUa 8vFxris+Aa+ESk40SobmXYlmbKrqtkwmlzW449BEnfweULObN9gyoTNx1oVm8hjezom2kJYurS B7gu0fe5iN5y/Kfxu2M5nzUkyBaAPUcLqrCHAbqtnJkEUNB01d8XRa3V1SntOBTT8WVVWqoAud kd8/S9yCXjX6MiiUWPjLPMFI Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2021 23:30:49 -0700 IronPort-SDR: boz3thHWapmoPvTa/DW/an5MsVT8Ol5rpIH+VCAGustW8DqaJSN8aZ2WbSLhYTI0aqjsPOVwbm K/oSaahfLi7517ZXrvOf/01ldW2DjUt5Zk85LwZ6kpELMepQ+yZOwsX8iJJv7rVXEuVutEFfWb 9115uRhjWUbK/tmuXEBB/h8sZ/9w6irmIYqNIga4upza/DZZ2OgUxqrKI26WsuPb66ABn5ezvQ rwjE9agNnVRZ0iId4gd+ezac3XqEslSOfqtfAGILDjdMHJuTPTKiSqPU7dGY0PTN/YGTX4gXVz /Hg= WDCIronportException: Internal Received: from usg-ed-osssrv.wdc.com ([10.3.10.180]) by uls-op-cesaip01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2021 23:54:36 -0700 Received: from usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTP id 4HDBxR0X7rz1Rws7 for ; Mon, 20 Sep 2021 23:54:35 -0700 (PDT) Authentication-Results: usg-ed-osssrv.wdc.com (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=opensource.wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= opensource.wdc.com; h=content-transfer-encoding:mime-version :references:in-reply-to:x-mailer:message-id:date:subject:to :from; s=dkim; t=1632207274; x=1634799275; bh=JAjCL/YBrrsIN6lr0Y fwCaKEn9AIJQHYJAHcywrCO+Y=; b=QR2H4Ck9frzUZjPEbIBXF1wenIRMQyfg3Q 4y62khqC4sIK7+FfVGgI54WkUzbSpBjgCfT6/wQDWdz+Rl1SJRS33ACJWW63aIo4 nwtswK2y2HBeB2MOXF3o1qn6Hdys2vnJxHpOYHBwP9slaBPptriEwnnGTh4I/vZi 4lVR3FDqqHwt4yY6UPmFpKkCDuh/+hiT4v2sPUusCAB5W4MTnUnbWWkhwJp3nFWo 4gUSexwE92y3TtHtVI1/AU79BDXIxShKomZLpVc+sdTgljs3xeC8rsSYw6yByPPX GUAkCm5hbpI9eWpPqGtAVvUWJxV/vBDdqx7ObuQFGUwFSPFDpoOw== X-Virus-Scanned: amavisd-new at usg-ed-osssrv.wdc.com Received: from usg-ed-osssrv.wdc.com ([127.0.0.1]) by usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id O4mtypHE4h3u for ; Mon, 20 Sep 2021 23:54:34 -0700 (PDT) Received: from toolbox.alistair23.me (unknown [10.225.165.26]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTPSA id 4HDBxL2JFPz1RvlH; Mon, 20 Sep 2021 23:54:29 -0700 (PDT) From: Alistair Francis To: qemu-devel@nongnu.org, peter.maydell@linaro.org Cc: alistair23@gmail.com, LIU Zhiwei , Bin Meng , Alistair Francis Subject: [PULL v2 02/21] target/riscv: Fix satp write Date: Tue, 21 Sep 2021 16:53:53 +1000 Message-Id: <20210921065412.312381-3-alistair.francis@opensource.wdc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210921065412.312381-1-alistair.francis@opensource.wdc.com> References: <20210921065412.312381-1-alistair.francis@opensource.wdc.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=216.71.154.45; envelope-from=prvs=891501f09=alistair.francis@opensource.wdc.com; helo=esa6.hgst.iphmx.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.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_MED=-2.3, SPF_HELO_PASS=-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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: LIU Zhiwei These variables should be target_ulong. If truncated to int, the bool conditions they indicate will be wrong. As satp is very important for Linux, this bug almost fails every boot. Signed-off-by: LIU Zhiwei Reviewed-by: Bin Meng Reviewed-by: Alistair Francis Message-id: 20210901124539.222868-1-zhiwei_liu@c-sky.com Signed-off-by: Alistair Francis --- target/riscv/csr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/riscv/csr.c b/target/riscv/csr.c index 50a2c3a3b4..ba9818f6a5 100644 --- a/target/riscv/csr.c +++ b/target/riscv/csr.c @@ -986,7 +986,7 @@ static RISCVException read_satp(CPURISCVState *env, i= nt csrno, static RISCVException write_satp(CPURISCVState *env, int csrno, target_ulong val) { - int vm, mask, asid; + target_ulong vm, mask, asid; =20 if (!riscv_feature(env, RISCV_FEATURE_MMU)) { return RISCV_EXCP_NONE; --=20 2.31.1