From patchwork Tue Jul 21 12:40:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zong Li X-Patchwork-Id: 1333007 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=none (p=none dis=none) header.from=sifive.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sifive.com header.i=@sifive.com header.a=rsa-sha256 header.s=google header.b=gHhdKItl; 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 4B9ysb2sCnz9sR4 for ; Tue, 21 Jul 2020 22:42:10 +1000 (AEST) Received: from localhost ([::1]:46018 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jxray-0002VB-Lo for incoming@patchwork.ozlabs.org; Tue, 21 Jul 2020 08:42:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34978) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jxraB-0002C3-GH for qemu-devel@nongnu.org; Tue, 21 Jul 2020 08:41:19 -0400 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:33491) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jxra5-0004vw-RG for qemu-devel@nongnu.org; Tue, 21 Jul 2020 08:41:19 -0400 Received: by mail-pg1-x542.google.com with SMTP id o13so11904309pgf.0 for ; Tue, 21 Jul 2020 05:41:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=W9alUim2NScoKewf8vVRphcseP9RDIaK8xQN1I3tCFA=; b=gHhdKItlqETPHEa9IlqbXOlkddHLNotQU59wayLuMJvdSoEOuLop4AhwLuSo4RcXVx cDr4IhvynheMWFGRZOVNVofvEw0xy6drY72+lIpKc5N4ank8VZ0rh2iIrE2R0dTWqNcy 7S+i9JQu3uUSpQokrzXg5IQXPMwild/IubTLK+nvyzBc5hQYZorBdBnt40d4VqH33riv DsrnlwwC3wI18y5i+95o7EpGh3IqxoeQcZHZ4bmLvYktpof5tjRnwL/uB4L3D8k+h7ht qW4xny9ydvnoyFn7n1WlsvBtRe/3vLdoCK3JvRbFtueKlXHCH9D6VH6L964Hs8NsxaEA t5Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=W9alUim2NScoKewf8vVRphcseP9RDIaK8xQN1I3tCFA=; b=l3M/kQrve8fA7qgZdvTXCkh8pCsHsIV1jeyWPnFzYDkh4KQNBFTXxLcxJZ5KqMvaqp NxuCwCZ0QuzslZrWi593HelnKVwuICf9I9YmpFXXK+PMFsGvzFENVJYDistgEcq3Xvnv xV7dYNrQYVunykHEGKKiuBP1bqtQR3wZ/B/UxVC29UB81nHFNmBT7mKHQStuMqQb8Erv U49tDe0kIGhuDhHyGktRmYnU/SHYcueLF7eL20R+6kTbPjDUuuP963a8GJZHo0HghwvP LQrdwsMf7jTqyk/lNGteAz071VAL2RTKEDwxvryx59UmeGgVMbxW4QgcumIsDWA9H4XS zSOg== X-Gm-Message-State: AOAM531aEByn8Rip9AipDXhgbF97TjJ1DfEcVxZH4JakJ6vXg1AA7cHn DXHxrSzz2BSZ4gPHoa7lW39fBQ== X-Google-Smtp-Source: ABdhPJx/Qo/bcEqDMsf0Vlwr6ThIhFcZ4ugvB6RyoJCFwn3nWdHvrPiYBL8FQXPim+6oMFAo8X8rjA== X-Received: by 2002:a63:1059:: with SMTP id 25mr19989645pgq.302.1595335272379; Tue, 21 Jul 2020 05:41:12 -0700 (PDT) Received: from hsinchu02.internal.sifive.com (114-34-229-221.HINET-IP.hinet.net. [114.34.229.221]) by smtp.gmail.com with ESMTPSA id y20sm19819991pfo.170.2020.07.21.05.41.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2020 05:41:12 -0700 (PDT) From: Zong Li To: palmer@dabbelt.com, Alistair.Francis@wdc.com, bmeng.cn@gmail.com, sagark@eecs.berkeley.edu, kbastian@mail.uni-paderborn.de, qemu-riscv@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH v3 1/3] target/riscv: Fix the range of pmpcfg of CSR funcion table Date: Tue, 21 Jul 2020 20:40:50 +0800 Message-Id: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::542; envelope-from=zong.li@sifive.com; helo=mail-pg1-x542.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, URIBL_BLOCKED=0.001 autolearn=unavailable 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: , Cc: Bin Meng , Alistair Francis , Zong Li Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The range of Physical Memory Protection should be from CSR_PMPCFG0 to CSR_PMPCFG3, not to CSR_PMPADDR9. Signed-off-by: Zong Li Reviewed-by: Alistair Francis Reviewed-by: Bin Meng --- 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 ac01c835e1..6a96a01b1c 100644 --- a/target/riscv/csr.c +++ b/target/riscv/csr.c @@ -1353,7 +1353,7 @@ static riscv_csr_operations csr_ops[CSR_TABLE_SIZE] = { [CSR_MTINST] = { hmode, read_mtinst, write_mtinst }, /* Physical Memory Protection */ - [CSR_PMPCFG0 ... CSR_PMPADDR9] = { pmp, read_pmpcfg, write_pmpcfg }, + [CSR_PMPCFG0 ... CSR_PMPCFG3] = { pmp, read_pmpcfg, write_pmpcfg }, [CSR_PMPADDR0 ... CSR_PMPADDR15] = { pmp, read_pmpaddr, write_pmpaddr }, /* Performance Counters */