All of lore.kernel.org
 help / color / mirror / Atom feed
* About RISCV’s Performance Counters and QEMU
@ 2023-12-01 14:27 ELIO VINCIGUERRA
  2023-12-04  8:30 ` Atish Patra
  0 siblings, 1 reply; 5+ messages in thread
From: ELIO VINCIGUERRA @ 2023-12-01 14:27 UTC (permalink / raw)
  To: qemu-riscv@nongnu.org

[-- Attachment #1: Type: text/plain, Size: 774 bytes --]

Hi everybody, I recently started using RISCV architectures, I would need a way to access “hpmcounter[3-31]” registers using QEMU emulator.

The kernel used for simulations is a C program, not a heavy operating system, which is why I would need to access the registers mentioned before via assembly.

Trivially accessing any of those registers always returns zero.

The question is:
Are these registers enabled in QEMU? If not, is it possible to enable them or are they hardwired to zero? How?

Trying to access the registers “cycle”, “instret” and “time” the values come out to be non-zero, which is why I think it is also possible to enable “hpmcounter[3-31]”, but the mode of operation is unknown to me, can anyone help me?

Regards,
Elio

[-- Attachment #2: Type: text/html, Size: 2097 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-12-06  5:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-01 14:27 About RISCV’s Performance Counters and QEMU ELIO VINCIGUERRA
2023-12-04  8:30 ` Atish Patra
2023-12-05 12:56   ` Elio Vinciguerra
2023-12-06  1:21     ` Atish Patra
2023-12-06  5:47       ` ELIO VINCIGUERRA

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.