From: Michael Clark <mjc@sifive.com>
To: qemu-trivial@nongnu.org, qemu-devel@nongnu.org
Cc: patches@groups.riscv.org, Richard Henderson <rth@twiddle.net>,
Michael Clark <mjc@sifive.com>
Subject: [Qemu-devel] [PATCH] RISC-V: Correct typo in RV32 perf counters
Date: Fri, 25 May 2018 18:24:48 +1200 [thread overview]
Message-ID: <1527229488-49822-1-git-send-email-mjc@sifive.com> (raw)
This patch enables mhpmcounter3h through mhpmcounter31h on RV32.
Previously the RV32 h versions (high 32-bits of 64-bit counters)
of these counters would trap with an illegal instruction instead
of returning 0 as intended.
Reported-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Michael Clark <mjc@sifive.com>
---
target/riscv/op_helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/riscv/op_helper.c b/target/riscv/op_helper.c
index 3abf52453cfc..1f6dc9a85852 100644
--- a/target/riscv/op_helper.c
+++ b/target/riscv/op_helper.c
@@ -406,7 +406,7 @@ target_ulong csr_read_helper(CPURISCVState *env, target_ulong csrno)
return 0;
}
#if defined(TARGET_RISCV32)
- if (csrno >= CSR_MHPMCOUNTER3 && csrno <= CSR_MHPMCOUNTER31) {
+ if (csrno >= CSR_MHPMCOUNTER3H && csrno <= CSR_MHPMCOUNTER31H) {
return 0;
}
#endif
--
2.7.0
next reply other threads:[~2018-05-25 6:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-25 6:24 Michael Clark [this message]
2018-05-25 13:17 ` [Qemu-devel] [PATCH] RISC-V: Correct typo in RV32 perf counters Richard Henderson
2018-07-30 10:45 ` Peter Maydell
2018-07-30 11:42 ` Michael Clark
2018-07-30 12:00 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1527229488-49822-1-git-send-email-mjc@sifive.com \
--to=mjc@sifive.com \
--cc=patches@groups.riscv.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).