From: Alistair Francis <alistair23@gmail.com>
To: Alexei Filippov <alexei.filippov@syntacore.com>,
Atish Patra <atishp@rivosinc.com>
Cc: palmer@dabbelt.com, alistair.francis@wdc.com, bmeng.cn@gmail.com,
dbarboza@ventanamicro.com, zhiwei_liu@linux.alibaba.com,
liwei1518@gmail.com, qemu-devel@nongnu.org,
qemu-riscv@nongnu.org
Subject: Re: [RFC PATCH 0/2] target/riscv: Add support for machine specific pmu's events
Date: Tue, 8 Oct 2024 12:52:27 +1000 [thread overview]
Message-ID: <CAKmqyKPH33Lf5YdNrdHEQ9K0ZLrnJmvcGi9DjsP6gKNQZYAxaA@mail.gmail.com> (raw)
In-Reply-To: <20240910174747.148141-1-alexei.filippov@syntacore.com>
On Wed, Sep 11, 2024 at 3:49 AM Alexei Filippov
<alexei.filippov@syntacore.com> wrote:
>
> Following original patch [1] here's a patch with support of machine
> specific pmu events and PoC with initial support for sifive_u's HPM.
Thanks for the patch.
I'm hesitate to support these callback functions as I feel they
(callbacks in the CPU to the machine in general) are clunky.
I think the cover letter, code and commit messages need more details here.
First can you link to the exact spec you are trying to implement
(RISC-V has a habit of creating multiple "ratified" specs that are all
incompatible). It's really handy to point to the exact PDF in the
cover letter or commit message to just be really clear what you are
supporting.
Secondly, can you describe why this is useful? What is the point of
machine specific PMU events? Why do we want to support this in QEMU?
The callbacks should also have some documentation in the code base so
others can implement the functionality.
It might also be helpful to split this patch up a little bit more. A
quick read through and it seems like the patches could be a little
smaller, making it easier to review.
Finally, for the next version CC @Atish Patra who has ended up being
the PMU person :)
Alistair
>
> == Test scenarios ==
>
> So, I tested this patches on current Linux master with perf.
> something like `perf stat -e branch-misses perf bench mem memcpy` works
> just fine, also 'perf record -e branch-misses perf bench mem memcpy'
> collect samples just fine and `perf report` works.
>
> == ToDos / Limitations ==
>
> Second patch is only inital sifive_u's HPM support, without any
> filtering, events combining features or differrent counting
> algorithm for different events. There are also no tests, but if you
> have any suggestions about where I need to look to implement them, please
> point me to.
>
> == Changes since original patch ==
>
> - Rebased to current master
>
> [1] https://lore.kernel.org/all/20240625144643.34733-1-alexei.filippov@syntacore.com/
>
> Alexei Filippov (2):
> target/riscv: Add support for machine specific pmu's events
> hw/riscv/sifive_u.c: Add initial HPM support
>
> hw/misc/meson.build | 1 +
> hw/misc/sifive_u_pmu.c | 384 +++++++++++++++++++++++++++++++++
> hw/riscv/sifive_u.c | 14 ++
> include/hw/misc/sifive_u_pmu.h | 24 +++
> target/riscv/cpu.c | 20 +-
> target/riscv/cpu.h | 9 +
> target/riscv/csr.c | 93 +++++---
> target/riscv/pmu.c | 138 ++++++------
> target/riscv/pmu.h | 19 +-
> 9 files changed, 599 insertions(+), 103 deletions(-)
> create mode 100644 hw/misc/sifive_u_pmu.c
> create mode 100644 include/hw/misc/sifive_u_pmu.h
>
> --
> 2.34.1
>
>
next prev parent reply other threads:[~2024-10-08 2:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-10 17:47 [RFC PATCH 0/2] target/riscv: Add support for machine specific pmu's events Alexei Filippov
2024-09-10 17:47 ` [RFC PATCH 1/2] " Alexei Filippov
2024-09-10 17:47 ` [RFC PATCH 2/2] hw/riscv/sifive_u.c: Add initial HPM support Alexei Filippov
2024-10-08 2:55 ` Alistair Francis
2024-10-08 2:52 ` Alistair Francis [this message]
2024-10-09 3:51 ` [RFC PATCH 0/2] target/riscv: Add support for machine specific pmu's events Atish Kumar Patra
2024-10-10 11:49 ` Alexei Filippov
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=CAKmqyKPH33Lf5YdNrdHEQ9K0ZLrnJmvcGi9DjsP6gKNQZYAxaA@mail.gmail.com \
--to=alistair23@gmail.com \
--cc=alexei.filippov@syntacore.com \
--cc=alistair.francis@wdc.com \
--cc=atishp@rivosinc.com \
--cc=bmeng.cn@gmail.com \
--cc=dbarboza@ventanamicro.com \
--cc=liwei1518@gmail.com \
--cc=palmer@dabbelt.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=zhiwei_liu@linux.alibaba.com \
/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).