From: Aleksei Filippov <alexei.filippov@syntacore.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Richard Henderson" <richard.henderson@linaro.org>,
palmer@dabbelt.com
Cc: <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: [PATCH v2] target/riscv: Add support for machine specific pmu's events
Date: Wed, 11 Sep 2024 11:50:02 +0300 [thread overview]
Message-ID: <f968f7db-2b2c-4cb7-ac1c-504121745ab7@syntacore.com> (raw)
In-Reply-To: <b94c987e-835a-490f-a4d4-72f87db7f7b1@linaro.org>
On 08.07.2024 16:42, Philippe Mathieu-Daudé wrote:
> Hi Aleksei,
>
> On 8/7/24 11:46, Aleksei Filippov wrote:
>> On 25.06.2024 21:18, Richard Henderson wrote:
>>> On 6/25/24 07:46, Alexei Filippov wrote:
>>>> Was added call backs for machine specific pmu events.
>>>> Simplify monitor functions by adding new hash table, which going to map
>>>> counter number and event index.
>>>> Was added read/write callbacks which going to simplify support for events,
>>>> which expected to have different behavior.
>>>>
>>>> Signed-off-by: Alexei Filippov <alexei.filippov@syntacore.com>
>>>> ---
>>>> Changes since v2:
>>>> -rebased to latest master
>>>> target/riscv/cpu.h | 9 +++
>>>> target/riscv/csr.c | 43 +++++++++-----
>>>> target/riscv/pmu.c | 139 ++++++++++++++++++++++-----------------------
>>>> target/riscv/pmu.h | 11 ++--
>>>> 4 files changed, 115 insertions(+), 87 deletions(-)
>>>>
>>>> diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
>>>> index 6fe0d712b4..fbf82b050b 100644
>>>> --- a/target/riscv/cpu.h
>>>> +++ b/target/riscv/cpu.h
>>>> @@ -374,6 +374,13 @@ struct CPUArchState {
>>>> uint64_t (*rdtime_fn)(void *);
>>>> void *rdtime_fn_arg;
>>>> + /*machine specific pmu callback */
>>>> + void (*pmu_ctr_write)(PMUCTRState *counter, uint32_t event_idx,
>>>> + target_ulong val, bool high_half);
>>>> + target_ulong (*pmu_ctr_read)(PMUCTRState *counter, uint32_t event_idx,
>>>> + bool high_half);
>>>> + bool (*pmu_vendor_support)(uint32_t event_idx);
>>>
>>> Do these really belong in CPUArchState, rather than RISCVCPUClass?
>>>
>>> Surely there's more to this series, since these fields are never set...
>>>
>>>
>>> r~
>>
>> Initially this callbacks was added to CPUArchState just to be along with
>> similar implementation with rdtime_fn*.
>>
>> Yes, you're right, there are more series to this, but, it can't be separated
>> from syntacore specific parts, which is unfortunately not ready yet to be
>> published. So, I can prepare second patch to implement PMU subsystem for virt
>> device. What do you think about it? (I'll send it in the few days).
>
> How can we test your patch meanwhile?
Sorry for such late response, but anyway, I created an RFC with PoC and
description on how I tested this and resend patch with PoC all together.
https://lore.kernel.org/all/20240910174747.148141-1-alexei.filippov@syntacore.com/
>
> Thanks,
>
> Phil.
>
--
Sincerely,
Aleksei Filippov
prev parent reply other threads:[~2024-09-11 8:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-25 14:46 [PATCH v2] target/riscv: Add support for machine specific pmu's events Alexei Filippov
2024-06-25 18:18 ` Richard Henderson
2024-07-08 9:46 ` Aleksei Filippov
2024-07-08 13:42 ` Philippe Mathieu-Daudé
2024-09-11 8:50 ` Aleksei Filippov [this message]
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=f968f7db-2b2c-4cb7-ac1c-504121745ab7@syntacore.com \
--to=alexei.filippov@syntacore.com \
--cc=alistair.francis@wdc.com \
--cc=bmeng.cn@gmail.com \
--cc=dbarboza@ventanamicro.com \
--cc=liwei1518@gmail.com \
--cc=palmer@dabbelt.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=richard.henderson@linaro.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).