From patchwork Sun Jan 19 01:43:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jiang X-Patchwork-Id: 1225339 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=BQJ5+DcO; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 480czP63wlz9sRG for ; Sun, 19 Jan 2020 12:44:16 +1100 (AEDT) Received: from localhost ([::1]:46678 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iszdM-00055B-GU for incoming@patchwork.ozlabs.org; Sat, 18 Jan 2020 20:44:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50785) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iszd0-00053f-HM for qemu-devel@nongnu.org; Sat, 18 Jan 2020 20:43:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iszcz-00023a-DI for qemu-devel@nongnu.org; Sat, 18 Jan 2020 20:43:50 -0500 Received: from mail-il1-x141.google.com ([2607:f8b0:4864:20::141]:33581) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iszcz-00022r-8z for qemu-devel@nongnu.org; Sat, 18 Jan 2020 20:43:49 -0500 Received: by mail-il1-x141.google.com with SMTP id v15so24523664iln.0 for ; Sat, 18 Jan 2020 17:43:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=zIaSPLmdzuuhDSd0Woflh28eBID3LaclEz0rr9Jlegk=; b=BQJ5+DcOwcfkkgd8otQqDQoLovTvoGSh5pVN874LG0/H4X+UgMKp6wo0SLErCXhBdi cah2ZXGSHz7STxKc07eAY0y4jnj1wIYi9YmfhSHh9f/kPGl4WSb73dC8R8RhJ49bbEzI Z638AEO2b1bPdUieX7U3cyNA5u7N5Od+KXx7GZZU9m8h2iUGJydViwLmEYeaSFi8g6ru sfdWFIsC2jjOA0kYW1dIuMO0Zrjpg8SSqostRpd9PEVBryM3xur8iU29NJ2xiaCAEfCq ovqRQ+OZ/AQ1FlverpDlkpRbIoCX54eh1rX+OLDn2i6jVFjfung7vIloKPmgDkeBoWkg W8VA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=zIaSPLmdzuuhDSd0Woflh28eBID3LaclEz0rr9Jlegk=; b=FxYxiT4YEeV67GkVWqgR6ZrrrOgQIWYSe/WAY7hxfTF9Q1BxdxUXEgmASrS65y9f6J ssdWUKgky3koyziJQ9x+8IBRIbXAlNxvHrcht9ggKR0vGVpMBHJXJWxazB++nFPL2x4m jQkFaUwghns7x1a0AxFCXEd2L0QIAKWqJWhRWIu+DqCTGyD86UVgzxqtCmYv1KeN69yZ IvTtkr2Ep0ZITz9eTgERlHgzG+eawFysJvAlii7vc9Dl0UQgexr5/5PljLRHZFgcn+Gp buFiNENJH88ZxAojm02/gI7MnuO6i5JPq46QVWqrGiF0R6GWu4EJXzxmS5x7raktYLfW aRrw== X-Gm-Message-State: APjAAAX4bDgDMUO9bCCE3ifF32FRRrA17BzNTchims3ginSK7CUlG8w7 gwB99F/gz2zaVsUgSt2VJS+Qh5tUihKMIblMmBjQn2hIwzY= X-Google-Smtp-Source: APXvYqxAu2Lyg3raNDhItn5x8Xywv+vl4SDUDS5V1p0rqxwvWO3tHdt7ixMkLx/HN6h9fGAedxUx8TaobMqv6wdSNJY= X-Received: by 2002:a92:2804:: with SMTP id l4mr5125905ilf.136.1579398227101; Sat, 18 Jan 2020 17:43:47 -0800 (PST) MIME-Version: 1.0 From: Ian Jiang Date: Sun, 19 Jan 2020 09:43:36 +0800 Message-ID: Subject: [PATCH] riscv: Fix defination of csr operations To: qemu-devel@nongnu.org X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::141 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: , Cc: Alistair Francis , Palmer Dabbelt , Sagar Karandikar , Bastian Koppelmann Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" There is a mistake in defining CSR operations for pmpcfg registers. This patch fixes the bug. Signed-off-by: Ian Jiang --- target/riscv/csr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) [CSR_PMPADDR0 ... CSR_PMPADDR15] = { pmp, read_pmpaddr, write_pmpaddr }, /* Performance Counters */ diff --git a/target/riscv/csr.c b/target/riscv/csr.c index da02f9f0b1..e07b5267be 100644 --- a/target/riscv/csr.c +++ b/target/riscv/csr.c @@ -948,7 +948,7 @@ static riscv_csr_operations csr_ops[CSR_TABLE_SIZE] = { [CSR_SATP] = { smode, read_satp, write_satp }, /* Physical Memory Protection */ - [CSR_PMPCFG0 ... CSR_PMPADDR9] = { pmp, read_pmpcfg, write_pmpcfg }, + [CSR_PMPCFG0 ... CSR_PMPCFG3] = { pmp, read_pmpcfg, write_pmpcfg },