mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sudeep Holla <sudeep.holla@arm.com>
To: Xiongfeng Wang <wangxiongfeng2@huawei.com>
Cc: gregkh@linuxfoundation.org, rafael@kernel.org,
	Sudeep Holla <sudeep.holla@arm.com>,
	linux-kernel@vger.kernel.org, james.morse@arm.com
Subject: Re: [PATCH] cacheinfo: clear cache_leaves(cpu) in free_cache_attributes()
Date: Tue, 13 Jul 2021 14:26:12 +0100	[thread overview]
Message-ID: <20210713132612.gvx7xpdp3tjcmxxu@bogus> (raw)
In-Reply-To: <303cd2bf-7142-6ec9-548a-afe7f6e5ca8f@huawei.com>

On Tue, Jul 13, 2021 at 08:46:19PM +0800, Xiongfeng Wang wrote:
> Hi Sudeep,
>
> On 2021/7/13 19:33, Sudeep Holla wrote:
> > On Tue, Jul 13, 2021 at 11:47:38AM +0800, Xiongfeng Wang wrote:
> >> On ARM64, when PPTT(Processor Properties Topology Table) is not
> >> implemented in ACPI boot, we will goto 'free_ci' with the following
> >> print:
> >>   Unable to detect cache hierarchy for CPU 0
> >>
> >
> > The change itself looks good and I am fine with that. However,...
> >
> >> But some other codes may still use 'num_leaves' to iterate through the
> >
> > Can you point me exactly where it is used to make sure there are no
> > other issues associated with that.
> >
> >> 'info_list', such as get_cpu_cacheinfo_id(). If 'info_list' is NULL , it
> >> would crash. So clear 'num_leaves' in free_cache_attributes().
> >>
> >
> > And can you provide the crash dump please ? If we are not hitting any
> > issue and you just figured this with code inspection, that is fine. It
> > helps to determine if this needs to be backport or just good to have
> > clean up.
>
> There is no issue in the mainline kernel. get_cpu_cacheinfo_id() is only called
> on x86. I didn't hit any issue using the mainline kernel.
>

Thanks for confirming.

> Actually, it's our own code that crashed. My colleague Shaobo(CCed) tried to add
> MPAM support on ARM64. His code called get_cpu_cacheinfo_id() and crashed when
> PPTT is not implemented. Maybe he should check whether PPTT is implemented
> before calling get_cpu_cacheinfo_id(), but we think it is also better to clear
> cache_leaves(cpu) in free_cache_attributes().
> Sorry for not clearly expressed.
>

Thanks for detailed explanation. In this case I would drop the Fixes: tag
as it is not fixing anything in the commit mentioned in the tag.

Also not sure if we can tag this as fixes
709c4362725a ("cacheinfo: Move resctrl's get_cache_id() to the cacheinfo header file")
as that is introducing the possible access that could crash. @James ?

Anyways, irrespective of whether you add above tag, feel free to add
once to drop the original fixes tag in the patch.

Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>

--
Regards,
Sudeep

  reply	other threads:[~2021-07-13 13:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-13  3:47 Xiongfeng Wang
2021-07-13 11:33 ` Sudeep Holla
2021-07-13 12:46   ` Xiongfeng Wang
2021-07-13 13:26     ` Sudeep Holla [this message]
2021-07-13 17:38       ` James Morse
2021-07-13 17:48         ` Sudeep Holla
2021-07-13 17:50           ` Sudeep Holla
2021-07-14 11:01           ` Xiongfeng Wang
2021-07-14  2:10         ` Xiongfeng Wang
2021-07-14 17:13           ` James Morse

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=20210713132612.gvx7xpdp3tjcmxxu@bogus \
    --to=sudeep.holla@arm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=james.morse@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=wangxiongfeng2@huawei.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

all inboxes | Powered by JetHome®