On 10/01/2025 21:32, Ilkka Koskinen wrote:
>
> Hi Suzuko,
>
> On Fri, 10 Jan 2025, Suzuki K Poulose wrote:
>> On 09/01/2025 21:53, Ilkka Koskinen wrote:
>>> Trying to record a trace on kernel with 64k pages resulted in -ENOMEM.
>>> This happens due to a bug in calculating the number of table pages,
>>> which
>>> returns zero. Fix the issue by rounding up.
>>>
>>> $ perf record --kcore -e cs_etm/@tmc_etr55,cycacc,branch_broadcast/k
>>> --per-thread taskset --cpu-list 1 dd if=/dev/zero of=/dev/null
>>> failed to mmap with 12 (Cannot allocate memory)
>>>
>>
>> Needs a Fixes tag.
>>
>> Fixes : 8ed536b1e283 ("coresight: catu: Add support for scatter gather
>> tables")
>
> That's a good point
>
>>
>>> Signed-off-by: Ilkka Koskinen <ilkka(a)os.amperecomputing.com>
>>> ---
>>> drivers/hwtracing/coresight/coresight-catu.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/hwtracing/coresight/coresight-catu.c b/drivers/
>>> hwtracing/coresight/coresight-catu.c
>>> index 275cc0d9f505..3378bb77e6b4 100644
>>> --- a/drivers/hwtracing/coresight/coresight-catu.c
>>> +++ b/drivers/hwtracing/coresight/coresight-catu.c
>>> @@ -269,7 +269,7 @@ catu_init_sg_table(struct device *catu_dev, int
>>> node,
>>> * Each table can address upto 1MB and we can have
>>> * CATU_PAGES_PER_SYSPAGE tables in a system page.
>>> */
>>> - nr_tpages = DIV_ROUND_UP(size, SZ_1M) / CATU_PAGES_PER_SYSPAGE;
>>> + nr_tpages = DIV_ROUND_UP(size, CATU_PAGES_PER_SYSPAGE * SZ_1M);
>>> catu_table = tmc_alloc_sg_table(catu_dev, node, nr_tpages,
>>> size >> PAGE_SHIFT, pages);
>>> if (IS_ERR(catu_table))
>>
>> Looks good to me, I will queue this later for v6.15.
>>
>> Suzuki
>
> Sounds great. Just to confirm, are you ok to add the fixes line or would
> you prefer me to submit v2 with it?
No, not required. I have picked this up for v6.15, and will push it out
once v6.14-rc is out.
Suzuki
>
> Cheers, Ilkka
On 13/01/2025 3:28 pm, Marc Zyngier wrote:
> On Mon, 13 Jan 2025 15:07:21 +0000,
> Mark Brown <broonie(a)kernel.org> wrote:
>>
>> [1 <text/plain; us-ascii (quoted-printable)>]
>> On Mon, Jan 06, 2025 at 02:24:37PM +0000, James Clark wrote:
>>> From: James Clark <james.clark(a)arm.com>
>>>
>>> Created with the following:
>>>
>>> cp include/linux/kasan-tags.h tools/include/linux/
>>> cp arch/arm64/include/asm/sysreg.h tools/arch/arm64/include/asm/
>>>
>>> Update the tools copy of sysreg.h so that the next commit to add a new
>>> register doesn't have unrelated changes in it. Because the new version
>>> of sysreg.h includes kasan-tags.h, that file also now needs to be copied
>>> into tools.
>>
>> This breaks the build of the KVM selftests:
>>
>> aarch64/aarch32_id_regs.c:150:16: error: use of undeclared identifier 'ID_AA64PFR0_EL1_ELx_64BIT_ONLY'
>> 150 | return el0 == ID_AA64PFR0_EL1_ELx_64BIT_ONLY;
>> | ^
>> 1 warning and 1 error generated.
>>
>> since it's pulled over the changes in 056600ff7330 ("arm64/cpufeature:
>> Replace custom macros with fields from ID_AA64PFR0_EL1") but not updated
>> the test to reflect this.
>
> Thanks for the heads up. I've stashed a fix on top, which hopefully
> will be in next tomorrow.
>
> M.
>
Oops sorry about that. I only tested the Perf build and hadn't done the
self tests for a few versions.
Thanks for making the fix.
On 12/01/2025 12:49 pm, Marc Zyngier wrote:
> On Tue, 07 Jan 2025 11:32:41 +0000,
> James Clark <james.clark(a)linaro.org> wrote:
>>
>> From: James Clark <james.clark(a)arm.com>
>>
>> There are a few entries particularly at the end of the file that aren't
>> in order. To avoid confusion, add a comment that might help new entries
>> to be added in the right place.
>>
>> Reviewed-by: Mark Brown <broonie(a)kernel.org>
>> Signed-off-by: James Clark <james.clark(a)arm.com>
>> Signed-off-by: James Clark <james.clark(a)linaro.org>
>> ---
>> arch/arm64/tools/sysreg | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/arch/arm64/tools/sysreg b/arch/arm64/tools/sysreg
>> index b081b54d6d22..4ba167089e2a 100644
>> --- a/arch/arm64/tools/sysreg
>> +++ b/arch/arm64/tools/sysreg
>> @@ -48,6 +48,8 @@
>> # feature that introduces them (eg, FEAT_LS64_ACCDATA introduces enumeration
>> # item ACCDATA) though it may be more taseful to do something else.
>>
>> +# Please try to keep entries in this file sorted by sysreg encoding.
>> +
>> Sysreg OSDTRRX_EL1 2 0 0 0 2
>> Res0 63:32
>> Field 31:0 DTRRX
>
> "Do as I say, don't do as I do".
>
> I don't think this makes any sense if we don't actually sort the file
> the first place.
>
> M.
>
I think it's ok if it avoids review comments that new entries should be
sorted. Or maybe we do the opposite and the comment should say this file
is allowed to be unsorted...
On 26/12/2024 1:10 am, Jie Gan wrote:
> Add support for new APB clock-name. If the function fails
> to obtain the clock with the name "apb_pclk", it will
> attempt to acquire the clock with the name "apb".
>
> Signed-off-by: Jie Gan <quic_jiegan(a)quicinc.com>
> ---
> include/linux/coresight.h | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/coresight.h b/include/linux/coresight.h
> index 17276965ff1d..157c4bd009a1 100644
> --- a/include/linux/coresight.h
> +++ b/include/linux/coresight.h
> @@ -459,8 +459,11 @@ static inline struct clk *coresight_get_enable_apb_pclk(struct device *dev)
> int ret;
>
> pclk = clk_get(dev, "apb_pclk");
> - if (IS_ERR(pclk))
> - return NULL;
> + if (IS_ERR(pclk)) {
> + pclk = clk_get(dev, "apb");
> + if (IS_ERR(pclk))
> + return NULL;
> + }
>
> ret = clk_prepare_enable(pclk);
> if (ret) {
Reviewed-by: James Clark <james.clark(a)linaro.org>
On 09/01/2025 21:53, Ilkka Koskinen wrote:
> Trying to record a trace on kernel with 64k pages resulted in -ENOMEM.
> This happens due to a bug in calculating the number of table pages, which
> returns zero. Fix the issue by rounding up.
>
> $ perf record --kcore -e cs_etm/@tmc_etr55,cycacc,branch_broadcast/k --per-thread taskset --cpu-list 1 dd if=/dev/zero of=/dev/null
> failed to mmap with 12 (Cannot allocate memory)
>
Needs a Fixes tag.
Fixes : 8ed536b1e283 ("coresight: catu: Add support for scatter gather
tables")
> Signed-off-by: Ilkka Koskinen <ilkka(a)os.amperecomputing.com>
> ---
> drivers/hwtracing/coresight/coresight-catu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-catu.c b/drivers/hwtracing/coresight/coresight-catu.c
> index 275cc0d9f505..3378bb77e6b4 100644
> --- a/drivers/hwtracing/coresight/coresight-catu.c
> +++ b/drivers/hwtracing/coresight/coresight-catu.c
> @@ -269,7 +269,7 @@ catu_init_sg_table(struct device *catu_dev, int node,
> * Each table can address upto 1MB and we can have
> * CATU_PAGES_PER_SYSPAGE tables in a system page.
> */
> - nr_tpages = DIV_ROUND_UP(size, SZ_1M) / CATU_PAGES_PER_SYSPAGE;
> + nr_tpages = DIV_ROUND_UP(size, CATU_PAGES_PER_SYSPAGE * SZ_1M);
> catu_table = tmc_alloc_sg_table(catu_dev, node, nr_tpages,
> size >> PAGE_SHIFT, pages);
> if (IS_ERR(catu_table))
Looks good to me, I will queue this later for v6.15.
Suzuki
Greg,
Please find the changes targeting v6.14 for the CoreSight self hosted tracing
subsystem.
Kindly pull
Suzuki
The following changes since commit fac04efc5c793dccbd07e2d59af9f90b7fc0dca4:
Linux 6.13-rc2 (2024-12-08 14:03:39 -0800)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/coresight/linux.git tags/coresight-next-v6.14
for you to fetch changes up to 56e14a21cee4ea6074b956a9ff2e406de5ad6548:
coresight-tpda: Optimize the function of reading element size (2024-12-13 10:25:15 +0000)
----------------------------------------------------------------
coresight: Updates for Linux v6.14
Coresight self-hosted tracing subsystem updates for v6.14 includes:
- Support for static traceid allocation for devices
- Support for impdef, static trace filtering in Qualcomm replicators
- Miscellaneous fixes
Signed-off-by: Suzuki K Poulose <suzuki.poulose(a)arm.com>
----------------------------------------------------------------
James Clark (1):
coresight: Drop atomics in connection refcounts
Mao Jinlong (3):
dt-bindings: arm: Add arm,static-trace-id for coresight dummy source
coresight: Add support to get static id for system trace sources
coresight: dummy: Add static trace id support for dummy source
Pei Xiao (1):
coresight: Fix dsb_mode_store() unsigned val is never less than zero
Songwei Chai (1):
Coresight: Narrow down the matching range of tpdm
Tao Zhang (4):
dt-bindings: arm: qcom,coresight-static-replicator: Add property for source filtering
coresight: Add a helper to check if a device is source
coresight: Add support for trace filtering by source
coresight-tpda: Optimize the function of reading element size
.../sysfs-bus-coresight-devices-dummy-source | 15 +++
.../bindings/arm/arm,coresight-dummy-source.yaml | 6 ++
.../arm/arm,coresight-static-replicator.yaml | 19 +++-
drivers/hwtracing/coresight/coresight-core.c | 113 +++++++++++++++++----
drivers/hwtracing/coresight/coresight-dummy.c | 81 +++++++++++++--
drivers/hwtracing/coresight/coresight-funnel.c | 6 +-
drivers/hwtracing/coresight/coresight-platform.c | 27 +++++
drivers/hwtracing/coresight/coresight-replicator.c | 6 +-
drivers/hwtracing/coresight/coresight-tpda.c | 19 +++-
drivers/hwtracing/coresight/coresight-tpdm.c | 7 +-
drivers/hwtracing/coresight/coresight-trace-id.c | 43 +++++---
drivers/hwtracing/coresight/coresight-trace-id.h | 9 ++
include/linux/coresight.h | 17 +++-
13 files changed, 309 insertions(+), 59 deletions(-)
create mode 100644 Documentation/ABI/testing/sysfs-bus-coresight-devices-dummy-source