All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Petr Tesařík" <petr@tesarici.cz>
To: Sourabh Jain <sourabhjain@linux.ibm.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Eric Biederman <ebiederm@xmission.com>,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	Petr Tesarik <ptesarik@suse.com>
Subject: Re: [PATCH] sysfs/cpu: Make crash_hotplug attribute world-readable
Date: Fri, 12 Jul 2024 08:21:24 +0200	[thread overview]
Message-ID: <20240712082124.272e079f@meshulam.tesarici.cz> (raw)
In-Reply-To: <59d88de7-369a-44e8-a965-109c8690869e@linux.ibm.com>

On Fri, 12 Jul 2024 10:00:09 +0530
Sourabh Jain <sourabhjain@linux.ibm.com> wrote:

> Hello Petr,
> 
> Just want to mentioned few points about the commit message. No strong
> opinion on changing the commit message.
> 
> On 11/07/24 16:04, Petr Tesarik wrote:
> > From: Petr Tesarik <ptesarik@suse.com>
> >
> > There is no reason to restrict access to this attribute, as it merely
> > reports whether crash elfcorehdr is automatically updated on CPU hot
> > plug/unplug and/or online/offline events.  
> 
> Now, it is not just elfcorehdr; there could be multiple kexec segments 
> based on the architecture's needs.
> For example, on PowerPC, it is elfcorehdr and FDT.

Right. I am even working with a PowerVM LPAR on an L922 system now. ;-)

OTOH I was just too lazy to invent my own description, so I took it
from Documentation/ABI/testing/sysfs-devices-system-cpu. That one
could be improved. And a couple of other places... Expect a patch.

> >
> > Note that since commit 79365026f8694 ("crash: add a new kexec flag
> > for hotplug support"), this maps to the same flag which is
> > world-accessible through /sys/devices/system/memory/crash_hotplug.  
> 
> The previous comment is more relevant for the kexec_load system call.
> 
> For the kexec_file_load system call, the kexec flag introduced in the 
> commit message
> mentioned above is irrelevant. Building kernel with
> CONFIG_CRASH_HOTPLUG is enough.

Yes, but then this sysfs attribute always reads "1".

> > Signedoff-by: Petr Tesarik <ptesarik@suse.com>
> > ---
> >   drivers/base/cpu.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
> > index c61ecb0c2ae2..73d69791d0d3 100644
> > --- a/drivers/base/cpu.c
> > +++ b/drivers/base/cpu.c
> > @@ -308,7 +308,7 @@ static ssize_t crash_hotplug_show(struct device
> > *dev, {
> >   	return sysfs_emit(buf, "%d\n",
> > crash_check_hotplug_support()); }
> > -static DEVICE_ATTR_ADMIN_RO(crash_hotplug);
> > +static DEVICE_ATTR_RO(crash_hotplug);  
> 
> I agree, it doesn't have to be readable by admin only.
> 
> Acked-by: Sourabh Jain <sourabhjain@linux.ibm.com>

Thank you!

Petr T

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

WARNING: multiple messages have this Message-ID (diff)
From: "Petr Tesařík" <petr@tesarici.cz>
To: Sourabh Jain <sourabhjain@linux.ibm.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Eric Biederman <ebiederm@xmission.com>,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	Petr Tesarik <ptesarik@suse.com>
Subject: Re: [PATCH] sysfs/cpu: Make crash_hotplug attribute world-readable
Date: Fri, 12 Jul 2024 08:21:24 +0200	[thread overview]
Message-ID: <20240712082124.272e079f@meshulam.tesarici.cz> (raw)
In-Reply-To: <59d88de7-369a-44e8-a965-109c8690869e@linux.ibm.com>

On Fri, 12 Jul 2024 10:00:09 +0530
Sourabh Jain <sourabhjain@linux.ibm.com> wrote:

> Hello Petr,
> 
> Just want to mentioned few points about the commit message. No strong
> opinion on changing the commit message.
> 
> On 11/07/24 16:04, Petr Tesarik wrote:
> > From: Petr Tesarik <ptesarik@suse.com>
> >
> > There is no reason to restrict access to this attribute, as it merely
> > reports whether crash elfcorehdr is automatically updated on CPU hot
> > plug/unplug and/or online/offline events.  
> 
> Now, it is not just elfcorehdr; there could be multiple kexec segments 
> based on the architecture's needs.
> For example, on PowerPC, it is elfcorehdr and FDT.

Right. I am even working with a PowerVM LPAR on an L922 system now. ;-)

OTOH I was just too lazy to invent my own description, so I took it
from Documentation/ABI/testing/sysfs-devices-system-cpu. That one
could be improved. And a couple of other places... Expect a patch.

> >
> > Note that since commit 79365026f8694 ("crash: add a new kexec flag
> > for hotplug support"), this maps to the same flag which is
> > world-accessible through /sys/devices/system/memory/crash_hotplug.  
> 
> The previous comment is more relevant for the kexec_load system call.
> 
> For the kexec_file_load system call, the kexec flag introduced in the 
> commit message
> mentioned above is irrelevant. Building kernel with
> CONFIG_CRASH_HOTPLUG is enough.

Yes, but then this sysfs attribute always reads "1".

> > Signedoff-by: Petr Tesarik <ptesarik@suse.com>
> > ---
> >   drivers/base/cpu.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
> > index c61ecb0c2ae2..73d69791d0d3 100644
> > --- a/drivers/base/cpu.c
> > +++ b/drivers/base/cpu.c
> > @@ -308,7 +308,7 @@ static ssize_t crash_hotplug_show(struct device
> > *dev, {
> >   	return sysfs_emit(buf, "%d\n",
> > crash_check_hotplug_support()); }
> > -static DEVICE_ATTR_ADMIN_RO(crash_hotplug);
> > +static DEVICE_ATTR_RO(crash_hotplug);  
> 
> I agree, it doesn't have to be readable by admin only.
> 
> Acked-by: Sourabh Jain <sourabhjain@linux.ibm.com>

Thank you!

Petr T

  reply	other threads:[~2024-07-12  6:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-11 10:34 [PATCH] sysfs/cpu: Make crash_hotplug attribute world-readable Petr Tesarik
2024-07-11 10:34 ` Petr Tesarik
2024-07-11 17:25 ` Petr Tesařík
2024-07-11 17:25   ` Petr Tesařík
2024-07-12  3:35 ` Baoquan He
2024-07-12  3:35   ` Baoquan He
2024-07-12  4:30 ` Sourabh Jain
2024-07-12  4:30   ` Sourabh Jain
2024-07-12  6:21   ` Petr Tesařík [this message]
2024-07-12  6:21     ` Petr Tesařík
2024-07-12  6:31     ` Sourabh Jain
2024-07-12  6:31       ` Sourabh Jain
2024-07-12  6:48       ` Petr Tesarik
2024-07-12  6:48         ` Petr Tesarik
2024-07-12  6:54         ` Sourabh Jain
2024-07-12  6:54           ` Sourabh Jain

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=20240712082124.272e079f@meshulam.tesarici.cz \
    --to=petr@tesarici.cz \
    --cc=ebiederm@xmission.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ptesarik@suse.com \
    --cc=rafael@kernel.org \
    --cc=sourabhjain@linux.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.