linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anshuman Khandual <anshuman.khandual@arm.com>
To: Yang Shen <shenyang39@huawei.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, will@kernel.org,
	catalin.marinas@arm.com, mark.rutland@arm.com
Cc: Mark Brown <broonie@kernel.org>,
	James Clark <james.clark@arm.com>, Rob Herring <robh@kernel.org>,
	Marc Zyngier <maz@kernel.org>,
	Suzuki Poulose <suzuki.poulose@arm.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	linux-perf-users@vger.kernel.org
Subject: Re: [PATCH V9 02/10] arm64/perf: Add BRBE registers and fields
Date: Mon, 15 May 2023 11:52:08 +0530	[thread overview]
Message-ID: <168e26b3-e995-88ad-b0a0-d917313956c8@arm.com> (raw)
In-Reply-To: <3a8ae180-5a0f-7996-58de-edb0e370e4f5@huawei.com>



On 4/12/23 14:02, Yang Shen wrote:
> 
> 
> 在 2023/3/15 13:14, Anshuman Khandual 写道:
>> This adds BRBE related register definitions and various other related field
>> macros there in. These will be used subsequently in a BRBE driver which is
>> being added later on.
>>
>> Cc: Catalin Marinas <catalin.marinas@arm.com>
>> Cc: Will Deacon <will@kernel.org>
>> Cc: Marc Zyngier <maz@kernel.org>
>> Cc: Mark Rutland <mark.rutland@arm.com>
>> Cc: linux-arm-kernel@lists.infradead.org
>> Cc: linux-kernel@vger.kernel.org
>> Reviewed-by: Mark Brown <broonie@kernel.org>
>> Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
>> ---
>>   arch/arm64/include/asm/sysreg.h | 103 +++++++++++++++++++++
>>   arch/arm64/tools/sysreg         | 159 ++++++++++++++++++++++++++++++++
>>   2 files changed, 262 insertions(+)
>>
>> diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h
>> index 9e3ecba3c4e6..b3bc03ee22bd 100644
>> --- a/arch/arm64/include/asm/sysreg.h
>> +++ b/arch/arm64/include/asm/sysreg.h
>> @@ -165,6 +165,109 @@
>>   #define SYS_DBGDTRTX_EL0        sys_reg(2, 3, 0, 5, 0)
>>   #define SYS_DBGVCR32_EL2        sys_reg(2, 4, 0, 7, 0)
>>   +#define __SYS_BRBINFO(n)        sys_reg(2, 1, 8, ((n) & 0xf), ((((n) & 0x10)) >> 2 + 0))
>> +#define __SYS_BRBSRC(n)            sys_reg(2, 1, 8, ((n) & 0xf), ((((n) & 0x10)) >> 2 + 1))
>> +#define __SYS_BRBTGT(n)            sys_reg(2, 1, 8, ((n) & 0xf), ((((n) & 0x10)) >> 2 + 2))
>> +
>> +#define SYS_BRBINF0_EL1            __SYS_BRBINFO(0)
>> +#define SYS_BRBINF1_EL1            __SYS_BRBINFO(1)
>> +#define SYS_BRBINF2_EL1            __SYS_BRBINFO(2)
>> +#define SYS_BRBINF3_EL1            __SYS_BRBINFO(3)
>> +#define SYS_BRBINF4_EL1            __SYS_BRBINFO(4)
>> +#define SYS_BRBINF5_EL1            __SYS_BRBINFO(5)
>> +#define SYS_BRBINF6_EL1            __SYS_BRBINFO(6)
>> +#define SYS_BRBINF7_EL1            __SYS_BRBINFO(7)
>> +#define SYS_BRBINF8_EL1            __SYS_BRBINFO(8)
>> +#define SYS_BRBINF9_EL1            __SYS_BRBINFO(9)
>> +#define SYS_BRBINF10_EL1        __SYS_BRBINFO(10)
>> +#define SYS_BRBINF11_EL1        __SYS_BRBINFO(11)
>> +#define SYS_BRBINF12_EL1        __SYS_BRBINFO(12)
>> +#define SYS_BRBINF13_EL1        __SYS_BRBINFO(13)
>> +#define SYS_BRBINF14_EL1        __SYS_BRBINFO(14)
>> +#define SYS_BRBINF15_EL1        __SYS_BRBINFO(15)
>> +#define SYS_BRBINF16_EL1        __SYS_BRBINFO(16)
>> +#define SYS_BRBINF17_EL1        __SYS_BRBINFO(17)
>> +#define SYS_BRBINF18_EL1        __SYS_BRBINFO(18)
>> +#define SYS_BRBINF19_EL1        __SYS_BRBINFO(19)
>> +#define SYS_BRBINF20_EL1        __SYS_BRBINFO(20)
>> +#define SYS_BRBINF21_EL1        __SYS_BRBINFO(21)
>> +#define SYS_BRBINF22_EL1        __SYS_BRBINFO(22)
>> +#define SYS_BRBINF23_EL1        __SYS_BRBINFO(23)
>> +#define SYS_BRBINF24_EL1        __SYS_BRBINFO(24)
>> +#define SYS_BRBINF25_EL1        __SYS_BRBINFO(25)
>> +#define SYS_BRBINF26_EL1        __SYS_BRBINFO(26)
>> +#define SYS_BRBINF27_EL1        __SYS_BRBINFO(27)
>> +#define SYS_BRBINF28_EL1        __SYS_BRBINFO(28)
>> +#define SYS_BRBINF29_EL1        __SYS_BRBINFO(29)
>> +#define SYS_BRBINF30_EL1        __SYS_BRBINFO(30)
>> +#define SYS_BRBINF31_EL1        __SYS_BRBINFO(31)
>> +
>> +#define SYS_BRBSRC0_EL1            __SYS_BRBSRC(0)
>> +#define SYS_BRBSRC1_EL1            __SYS_BRBSRC(1)
>> +#define SYS_BRBSRC2_EL1            __SYS_BRBSRC(2)
>> +#define SYS_BRBSRC3_EL1            __SYS_BRBSRC(3)
>> +#define SYS_BRBSRC4_EL1            __SYS_BRBSRC(4)
>> +#define SYS_BRBSRC5_EL1            __SYS_BRBSRC(5)
>> +#define SYS_BRBSRC6_EL1            __SYS_BRBSRC(6)
>> +#define SYS_BRBSRC7_EL1            __SYS_BRBSRC(7)
>> +#define SYS_BRBSRC8_EL1            __SYS_BRBSRC(8)
>> +#define SYS_BRBSRC9_EL1            __SYS_BRBSRC(9)
>> +#define SYS_BRBSRC10_EL1        __SYS_BRBSRC(10)
>> +#define SYS_BRBSRC11_EL1        __SYS_BRBSRC(11)
>> +#define SYS_BRBSRC12_EL1        __SYS_BRBSRC(12)
>> +#define SYS_BRBSRC13_EL1        __SYS_BRBSRC(13)
>> +#define SYS_BRBSRC14_EL1        __SYS_BRBSRC(14)
>> +#define SYS_BRBSRC15_EL1        __SYS_BRBSRC(15)
>> +#define SYS_BRBSRC16_EL1        __SYS_BRBSRC(16)
>> +#define SYS_BRBSRC17_EL1        __SYS_BRBSRC(17)
>> +#define SYS_BRBSRC18_EL1        __SYS_BRBSRC(18)
>> +#define SYS_BRBSRC19_EL1        __SYS_BRBSRC(19)
>> +#define SYS_BRBSRC20_EL1        __SYS_BRBSRC(20)
>> +#define SYS_BRBSRC21_EL1        __SYS_BRBSRC(21)
>> +#define SYS_BRBSRC22_EL1        __SYS_BRBSRC(22)
>> +#define SYS_BRBSRC23_EL1        __SYS_BRBSRC(23)
>> +#define SYS_BRBSRC24_EL1        __SYS_BRBSRC(24)
>> +#define SYS_BRBSRC25_EL1        __SYS_BRBSRC(25)
>> +#define SYS_BRBSRC26_EL1        __SYS_BRBSRC(26)
>> +#define SYS_BRBSRC27_EL1        __SYS_BRBSRC(27)
>> +#define SYS_BRBSRC28_EL1        __SYS_BRBSRC(28)
>> +#define SYS_BRBSRC29_EL1        __SYS_BRBSRC(29)
>> +#define SYS_BRBSRC30_EL1        __SYS_BRBSRC(30)
>> +#define SYS_BRBSRC31_EL1        __SYS_BRBSRC(31)
>> +
>> +#define SYS_BRBTGT0_EL1            __SYS_BRBTGT(0)
>> +#define SYS_BRBTGT1_EL1            __SYS_BRBTGT(1)
>> +#define SYS_BRBTGT2_EL1            __SYS_BRBTGT(2)
>> +#define SYS_BRBTGT3_EL1            __SYS_BRBTGT(3)
>> +#define SYS_BRBTGT4_EL1            __SYS_BRBTGT(4)
>> +#define SYS_BRBTGT5_EL1            __SYS_BRBTGT(5)
>> +#define SYS_BRBTGT6_EL1            __SYS_BRBTGT(6)
>> +#define SYS_BRBTGT7_EL1            __SYS_BRBTGT(7)
>> +#define SYS_BRBTGT8_EL1            __SYS_BRBTGT(8)
>> +#define SYS_BRBTGT9_EL1            __SYS_BRBTGT(9)
>> +#define SYS_BRBTGT10_EL1        __SYS_BRBTGT(10)
>> +#define SYS_BRBTGT11_EL1        __SYS_BRBTGT(11)
>> +#define SYS_BRBTGT12_EL1        __SYS_BRBTGT(12)
>> +#define SYS_BRBTGT13_EL1        __SYS_BRBTGT(13)
>> +#define SYS_BRBTGT14_EL1        __SYS_BRBTGT(14)
>> +#define SYS_BRBTGT15_EL1        __SYS_BRBTGT(15)
>> +#define SYS_BRBTGT16_EL1        __SYS_BRBTGT(16)
>> +#define SYS_BRBTGT17_EL1        __SYS_BRBTGT(17)
>> +#define SYS_BRBTGT18_EL1        __SYS_BRBTGT(18)
>> +#define SYS_BRBTGT19_EL1        __SYS_BRBTGT(19)
>> +#define SYS_BRBTGT20_EL1        __SYS_BRBTGT(20)
>> +#define SYS_BRBTGT21_EL1        __SYS_BRBTGT(21)
>> +#define SYS_BRBTGT22_EL1        __SYS_BRBTGT(22)
>> +#define SYS_BRBTGT23_EL1        __SYS_BRBTGT(23)
>> +#define SYS_BRBTGT24_EL1        __SYS_BRBTGT(24)
>> +#define SYS_BRBTGT25_EL1        __SYS_BRBTGT(25)
>> +#define SYS_BRBTGT26_EL1        __SYS_BRBTGT(26)
>> +#define SYS_BRBTGT27_EL1        __SYS_BRBTGT(27)
>> +#define SYS_BRBTGT28_EL1        __SYS_BRBTGT(28)
>> +#define SYS_BRBTGT29_EL1        __SYS_BRBTGT(29)
>> +#define SYS_BRBTGT30_EL1        __SYS_BRBTGT(30)
>> +#define SYS_BRBTGT31_EL1        __SYS_BRBTGT(31)
>> +
>>   #define SYS_MIDR_EL1            sys_reg(3, 0, 0, 0, 0)
>>   #define SYS_MPIDR_EL1            sys_reg(3, 0, 0, 0, 5)
>>   #define SYS_REVIDR_EL1            sys_reg(3, 0, 0, 0, 6)
>> diff --git a/arch/arm64/tools/sysreg b/arch/arm64/tools/sysreg
>> index dd5a9c7e310f..d74d9dbe18a7 100644
>> --- a/arch/arm64/tools/sysreg
>> +++ b/arch/arm64/tools/sysreg
>> @@ -924,6 +924,165 @@ UnsignedEnum    3:0    BT
>>   EndEnum
>>   EndSysreg
>>   +
>> +SysregFields BRBINFx_EL1
>> +Res0    63:47
>> +Field    46    CCU
>> +Field    45:32    CC
>> +Res0    31:18
>> +Field    17    LASTFAILED
>> +Field    16    T
>> +Res0    15:14
>> +Enum    13:8        TYPE
> 
> Hi Anshuman,
> 
> I met a problem when built kernel which was based on 6.3-rc1. Here is the error log:
>     GEN     Makefile
>     GEN     arch/arm64/include/generated/asm/sysreg-defs.h
> Error at 936: unexpected Enum (inside SysregFields)
> 
> I think this is because the 'SysregFields' doesn't support the 'Enum' type region.
> And this problem can be fixed when I roll back this part to v7.
> 
> Do I need to apply some patches or do some other configures?

Yes, the following patch was required, but it's now merged mainline.

https://lore.kernel.org/all/20230306114836.2575432-1-mark.rutland@arm.com/

  reply	other threads:[~2023-05-15  6:22 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-15  5:14 [PATCH V9 00/10] arm64/perf: Enable branch stack sampling Anshuman Khandual
2023-03-15  5:14 ` [PATCH V9 01/10] drivers: perf: arm_pmu: Add new sched_task() callback Anshuman Khandual
2023-03-15  5:14 ` [PATCH V9 02/10] arm64/perf: Add BRBE registers and fields Anshuman Khandual
2023-04-12  8:32   ` Yang Shen
2023-05-15  6:22     ` Anshuman Khandual [this message]
2023-03-15  5:14 ` [PATCH V9 03/10] arm64/perf: Add branch stack support in struct arm_pmu Anshuman Khandual
2023-03-15  5:14 ` [PATCH V9 04/10] arm64/perf: Add branch stack support in struct pmu_hw_events Anshuman Khandual
2023-03-15  5:14 ` [PATCH V9 05/10] arm64/perf: Add branch stack support in ARMV8 PMU Anshuman Khandual
2023-03-15  5:14 ` [PATCH V9 06/10] arm64/perf: Enable branch stack events via FEAT_BRBE Anshuman Khandual
2023-03-15  5:14 ` [PATCH V9 07/10] arm64/perf: Add PERF_ATTACH_TASK_DATA to events with has_branch_stack() Anshuman Khandual
2023-03-15  5:14 ` [PATCH V9 08/10] arm64/perf: Add struct brbe_regset helper functions Anshuman Khandual
2023-03-15  5:14 ` [PATCH V9 09/10] arm64/perf: Implement branch records save on task sched out Anshuman Khandual
2023-03-15  5:14 ` [PATCH V9 10/10] arm64/perf: Implement branch records save on PMU IRQ Anshuman Khandual
2023-05-23 14:39   ` James Clark
2023-05-23 14:51     ` James Clark
2023-05-24  3:10     ` Anshuman Khandual
2023-03-21 19:02 ` [PATCH V9 00/10] arm64/perf: Enable branch stack sampling Mark Brown
2023-03-23  4:25   ` Anshuman Khandual
2023-03-23 12:54     ` Mark Brown
2023-03-24  3:20       ` Anshuman Khandual
2023-03-24 11:40         ` Mark Brown
2023-04-11 13:03 ` Will Deacon
2023-05-15  6:24   ` Anshuman Khandual

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=168e26b3-e995-88ad-b0a0-d917313956c8@arm.com \
    --to=anshuman.khandual@arm.com \
    --cc=acme@kernel.org \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=james.clark@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=robh@kernel.org \
    --cc=shenyang39@huawei.com \
    --cc=suzuki.poulose@arm.com \
    --cc=will@kernel.org \
    /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).