On 14/01/2025 6:16 pm, Rob Herring wrote:
> On Mon, Jan 13, 2025 at 10:49 AM Marc Zyngier <maz(a)kernel.org> wrote:
>>
>> On Mon, 13 Jan 2025 15:43:39 +0000,
>> James Clark <james.clark(a)linaro.org> wrote:
>>>
>>>
>>>
>>> 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...
>>
>> The better option would be to add the comment *and* sort the file.
>> Leading by example has some value, it seems.
>
> IME, it's better if documentation just states what the tools enforce.
>
> Can't we add something like this to the header generation:
>
> $ grep '^Sysreg\s' arch/arm64/tools/sysreg | sort -n -k3 -k4 -k5 -k6 -k7 -c
> sort: -:22: disorder: Sysreg ID_MMFR4_EL1 3 0 0
> 2 6
>
> Rob
Actually I updated gen-sysreg.awk to fail the build if it's not sorted,
was just about to post it. I don't know if a build failure or a warning
is preferred but I can do either.
James
On Tue, Jan 14, 2025 at 11:35:44AM -0800, Charlie Jenkins wrote:
> The variables to make builds silent/verbose live inside
> tools/build/Makefile.build. Move those variables to the top-level
> Makefile.perf to be generally available.
>
> Committer testing:
Re-tested, now the lines below continue to appear, and also the 'make -C
tools/perf build-test' that was failiong on the first patch submission
is now ok as well, so I re issue my:
Tested-by: Arnaldo Carvalho de Melo <acme(a)redhat.com>
At this point this will go thru Namhyung, that will process patches
while I'm in vacation for perf-tools-next as well, thanks!
- Arnaldo
> See the SYSCALL lines, now they are consistent with the other
> operations in other lines:
> SYSTBL /tmp/build/perf-tools-next/arch/x86/include/generated/asm/syscalls_32.h
> SYSTBL /tmp/build/perf-tools-next/arch/x86/include/generated/asm/syscalls_64.h
> GEN /tmp/build/perf-tools-next/common-cmds.h
> GEN /tmp/build/perf-tools-next/arch/arm64/include/generated/asm/sysreg-defs.h
> PERF_VERSION = 6.13.rc2.g3d94bb6ed1d0
> GEN perf-archive
> MKDIR /tmp/build/perf-tools-next/jvmti/
> MKDIR /tmp/build/perf-tools-next/jvmti/
> MKDIR /tmp/build/perf-tools-next/jvmti/
> MKDIR /tmp/build/perf-tools-next/jvmti/
> GEN perf-iostat
> CC /tmp/build/perf-tools-next/jvmti/libjvmti.o
>
> Reported-by: Arnaldo Carvalho de Melo <acme(a)redhat.com>
> Signed-off-by: Charlie Jenkins <charlie(a)rivosinc.com>
> Tested-by: Arnaldo Carvalho de Melo <acme(a)redhat.com>
> ---
> tools/build/Makefile.build | 20 -----------------
> tools/perf/Makefile.perf | 37 ++++++++++++++++++++++++++++++-
> tools/perf/tests/shell/coresight/Makefile | 2 +-
> 3 files changed, 37 insertions(+), 22 deletions(-)
>
> diff --git a/tools/build/Makefile.build b/tools/build/Makefile.build
> index 5fb3fb3d97e0fd114e245805809e4fc926b4343e..e710ed67a1b49d9fda11db02821bbd8d36066b44 100644
> --- a/tools/build/Makefile.build
> +++ b/tools/build/Makefile.build
> @@ -12,26 +12,6 @@
> PHONY := __build
> __build:
>
> -ifeq ($(V),1)
> - quiet =
> - Q =
> -else
> - quiet=quiet_
> - Q=@
> -endif
> -
> -# If the user is running make -s (silent mode), suppress echoing of commands
> -# make-4.0 (and later) keep single letter options in the 1st word of MAKEFLAGS.
> -ifeq ($(filter 3.%,$(MAKE_VERSION)),)
> -short-opts := $(firstword -$(MAKEFLAGS))
> -else
> -short-opts := $(filter-out --%,$(MAKEFLAGS))
> -endif
> -
> -ifneq ($(findstring s,$(short-opts)),)
> - quiet=silent_
> -endif
> -
> build-dir := $(srctree)/tools/build
>
> # Define $(fixdep) for dep-cmd function
> diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
> index a449d0015536442273a9268b37be34e4757f577a..55d6ce9ea52fb2a57b8632cc6d0ddc501e29cbfc 100644
> --- a/tools/perf/Makefile.perf
> +++ b/tools/perf/Makefile.perf
> @@ -161,12 +161,47 @@ export VPATH
> SOURCE := $(shell ln -sf $(srctree)/tools/perf $(OUTPUT)/source)
> endif
>
> +# Beautify output
> +# ---------------------------------------------------------------------------
> +#
> +# Most of build commands in Kbuild start with "cmd_". You can optionally define
> +# "quiet_cmd_*". If defined, the short log is printed. Otherwise, no log from
> +# that command is printed by default.
> +#
> +# e.g.)
> +# quiet_cmd_depmod = DEPMOD $(MODLIB)
> +# cmd_depmod = $(srctree)/scripts/depmod.sh $(DEPMOD) $(KERNELRELEASE)
> +#
> +# A simple variant is to prefix commands with $(Q) - that's useful
> +# for commands that shall be hidden in non-verbose mode.
> +#
> +# $(Q)$(MAKE) $(build)=scripts/basic
> +#
> +# To put more focus on warnings, be less verbose as default
> +# Use 'make V=1' to see the full commands
> +
> ifeq ($(V),1)
> + quiet =
> Q =
> else
> - Q = @
> + quiet=quiet_
> + Q=@
> endif
>
> +# If the user is running make -s (silent mode), suppress echoing of commands
> +# make-4.0 (and later) keep single letter options in the 1st word of MAKEFLAGS.
> +ifeq ($(filter 3.%,$(MAKE_VERSION)),)
> +short-opts := $(firstword -$(MAKEFLAGS))
> +else
> +short-opts := $(filter-out --%,$(MAKEFLAGS))
> +endif
> +
> +ifneq ($(findstring s,$(short-opts)),)
> + quiet=silent_
> +endif
> +
> +export quiet Q
> +
> # Do not use make's built-in rules
> # (this improves performance and avoids hard-to-debug behaviour);
> MAKEFLAGS += -r
> diff --git a/tools/perf/tests/shell/coresight/Makefile b/tools/perf/tests/shell/coresight/Makefile
> index b070e779703e9fbd70f88c826172b2150ee3d302..fa08fd9a5991dd889583edc1afe8304e72278f64 100644
> --- a/tools/perf/tests/shell/coresight/Makefile
> +++ b/tools/perf/tests/shell/coresight/Makefile
> @@ -24,6 +24,6 @@ CLEANDIRS = $(SUBDIRS:%=clean-%)
>
> clean: $(CLEANDIRS)
> $(CLEANDIRS):
> - $(call QUIET_CLEAN, test-$(@:clean-%=%)) $(Q)$(MAKE) -C $(@:clean-%=%) clean >/dev/null
> + $(call QUIET_CLEAN, test-$(@:clean-%=%)) $(MAKE) -C $(@:clean-%=%) clean >/dev/null
>
> .PHONY: all clean $(SUBDIRS) $(CLEANDIRS) $(INSTALLDIRS)
>
> ---
> base-commit: e9cbc854d8b148e3491291fb615e94261970fb54
> change-id: 20250114-perf_make_test-1141d4ad8877
> --
> - Charlie
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>