All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: dmukhin@ford.com
Cc: xen-devel@lists.xenproject.org, andrew.cooper3@citrix.com,
	anthony.perard@vates.tech, jbeulich@suse.com, julien@xen.org,
	michal.orzel@amd.com, roger@xenproject.org,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH v2 2/2] xen/common: add keyhandler to show Xen command line
Date: Mon, 10 Aug 2026 13:50:20 +0200	[thread overview]
Message-ID: <1282e93e-df55-4d22-9327-8454ef181588@gmail.com> (raw)
In-Reply-To: <anaWpO/zu5sI4A9u@kraken>



On 8/8/26 4:38 AM, dmukhin@ford.com wrote:
> On Fri, Aug 07, 2026 at 05:44:41PM -0700, Stefano Stabellini wrote:
>> On Mon, 3 Aug 2026, dmukhin@ford.com wrote:
>>> From: Denis Mukhin <dmukhin@ford.com>
>>>
>>> Currently there's no way to print Xen command line on the emergency
>>> console for debugging purposes (e.g. 'xl' is not available in dom0).
>>>
>>> Add new keyhander 'X' to do command line printout.
>>>
>>> Signed-off-by: Denis Mukhin <dmukhin@ford.com>
>>> ---
>>> v1: https://lore.kernel.org/xen-devel/20260730061459.2702672-2-dmukhin@ford.com/
>>>
>>> Changes since v1:
>>> - moved implementation into kernel.c
>>> ---
>>>   xen/common/kernel.c | 16 ++++++++++++++++
>>>   1 file changed, 16 insertions(+)
>>>
>>> diff --git a/xen/common/kernel.c b/xen/common/kernel.c
>>> index d1bef9ac2b2b..9f334c92e3ab 100644
>>> --- a/xen/common/kernel.c
>>> +++ b/xen/common/kernel.c
>>> @@ -5,6 +5,7 @@
>>>    */
>>>   
>>>   #include <xen/init.h>
>>> +#include <xen/keyhandler.h>
>>>   #include <xen/lib.h>
>>>   #include <xen/errno.h>
>>>   #include <xen/param.h>
>>> @@ -505,6 +506,21 @@ static int __init cf_check param_init(void)
>>>   __initcall(param_init);
>>>   #endif
>>>   
>>> +static void cf_check show_hypervisor_info(unsigned char key)
>>> +{
>>> +    printk("'%c' pressed -> showing hypervisor information\n", key);
>>> +    printk("Command line: %s\n", saved_cmdline);
>>
>> if CONFIG_CMDLINE_OVERRIDE is defined, saved_cmdline is empty. We could
>> at least do this:
>>
>> #ifdef CONFIG_CMDLINE_OVERRIDE
>>      printk("Bootloader command line ignored (CONFIG_CMDLINE_OVERRIDE=y)\n");
>> #else
>>      printk("Command line: %s\n", saved_cmdline);
>> #endif
> 
> Actually, CONFIG_CMDLINE can set the built-in command line which can be
> non-empty.
> 
> Perhaps, something like this:
> 
>      printk("Command line (built-in): %s\n", opt_builtin_cmdline);
> #ifndef CONFIG_CMDLINE_OVERRIDE
>      printk("Command line: %s\n", saved_cmdline);
> #endif
> 
> What do you think?

Considering that opt_builtin_cmdline is declared as __initconst won't it 
be an issue to print it in non-init function (show_hypervisor_info())? 
In other words, I expected that __init section should be freed at some 
point and I expect that it should be data abort here.

~ Oleksii


  reply	other threads:[~2026-08-10 11:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-03  7:00 [PATCH v2 0/2] keyhandler to show Xen command line dmukhin
2026-08-03  7:00 ` [PATCH v2 1/2] xen/common: annotate saved_cmdline with __ro_after_init dmukhin
2026-08-03  7:03   ` Jan Beulich
2026-08-03  7:00 ` [PATCH v2 2/2] xen/common: add keyhandler to show Xen command line dmukhin
2026-08-08  0:44   ` Stefano Stabellini
2026-08-08  2:38     ` dmukhin
2026-08-10 11:50       ` Oleksii Kurochko [this message]
2026-08-10 13:28       ` Roger Pau Monné

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=1282e93e-df55-4d22-9327-8454ef181588@gmail.com \
    --to=oleksii.kurochko@gmail.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=dmukhin@ford.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=roger@xenproject.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.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 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.