* [PATCH v3] xen/common: add keyhandler to show Xen command line @ 2026-08-10 23:04 dmukhin 2026-08-11 8:05 ` Roger Pau Monné 0 siblings, 1 reply; 6+ messages in thread From: dmukhin @ 2026-08-10 23:04 UTC (permalink / raw) To: xen-devel Cc: andrew.cooper3, anthony.perard, jbeulich, julien, michal.orzel, roger, sstabellini, dmukhin From: Denis Mukhin <dmukhin@ford.com> Currently there's no way to print Xen command line on the emergency console for debugging purposes when 'xl' is not unavailable. Add new keyhander 'X' to do command line printout. Signed-off-by: Denis Mukhin <dmukhin@ford.com> --- Changes since v2: - account for CONFIG_CMDLINE_OVERRIDE case - use IS_ENABLED() v2: https://lore.kernel.org/xen-devel/20260803070047.3097846-3-dmukhin@ford.com/ CI: https://gitlab.com/xen-project/people/dmukhin/xen/-/pipelines/2748655201 --- xen/common/kernel.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/xen/common/kernel.c b/xen/common/kernel.c index d1bef9ac2b2b..54a7ee6f68e5 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,25 @@ 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); + + if ( IS_ENABLED(CONFIG_CMDLINE_OVERRIDE) ) + printk("Bootloader command line ignored (CONFIG_CMDLINE_OVERRIDE=y)\n"); + else + printk("Command line: %s\n", saved_cmdline); +} + +static int __init cf_check misc_init(void) +{ + register_keyhandler('X', show_hypervisor_info, + "show hypervisor information", 0); + + return 0; +} +__initcall(misc_init); + static long xenver_varbuf_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg) { struct xen_varbuf user_str; -- 2.54.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v3] xen/common: add keyhandler to show Xen command line 2026-08-10 23:04 [PATCH v3] xen/common: add keyhandler to show Xen command line dmukhin @ 2026-08-11 8:05 ` Roger Pau Monné 2026-08-11 20:56 ` dmukhin 0 siblings, 1 reply; 6+ messages in thread From: Roger Pau Monné @ 2026-08-11 8:05 UTC (permalink / raw) To: dmukhin Cc: xen-devel, andrew.cooper3, anthony.perard, jbeulich, julien, michal.orzel, sstabellini On Mon, Aug 10, 2026 at 04:04:01PM -0700, 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 when 'xl' is not unavailable. > > Add new keyhander 'X' to do command line printout. > > Signed-off-by: Denis Mukhin <dmukhin@ford.com> > --- > Changes since v2: > - account for CONFIG_CMDLINE_OVERRIDE case > - use IS_ENABLED() > > v2: https://lore.kernel.org/xen-devel/20260803070047.3097846-3-dmukhin@ford.com/ > CI: https://gitlab.com/xen-project/people/dmukhin/xen/-/pipelines/2748655201 > --- > xen/common/kernel.c | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > > diff --git a/xen/common/kernel.c b/xen/common/kernel.c > index d1bef9ac2b2b..54a7ee6f68e5 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,25 @@ 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); > + > + if ( IS_ENABLED(CONFIG_CMDLINE_OVERRIDE) ) > + printk("Bootloader command line ignored (CONFIG_CMDLINE_OVERRIDE=y)\n"); Since we are there already, why not print the builtin command line using CONFIG_CMDLINE? > + else > + printk("Command line: %s\n", saved_cmdline); > +} > + > +static int __init cf_check misc_init(void) > +{ > + register_keyhandler('X', show_hypervisor_info, > + "show hypervisor information", 0); "show hypervisor information" seems too generic to me, almost all debug keys could be defined by this sentence TBH. I think this needs to be more specific, but I'm not sure what's the plan regarding this key. Is there an intention to print more stuff here, or just the command line? Knowing the full set of information to be printed might help come up with a better name. Thanks, Roger. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3] xen/common: add keyhandler to show Xen command line 2026-08-11 8:05 ` Roger Pau Monné @ 2026-08-11 20:56 ` dmukhin 2026-08-12 7:28 ` Jan Beulich 0 siblings, 1 reply; 6+ messages in thread From: dmukhin @ 2026-08-11 20:56 UTC (permalink / raw) To: Roger Pau Monné Cc: dmukhin, xen-devel, andrew.cooper3, anthony.perard, jbeulich, julien, michal.orzel, sstabellini Thanks for taking a look! On Tue, Aug 11, 2026 at 10:05:17AM +0200, Roger Pau Monné wrote: > On Mon, Aug 10, 2026 at 04:04:01PM -0700, 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 when 'xl' is not unavailable. > > > > Add new keyhander 'X' to do command line printout. > > > > Signed-off-by: Denis Mukhin <dmukhin@ford.com> > > --- > > Changes since v2: > > - account for CONFIG_CMDLINE_OVERRIDE case > > - use IS_ENABLED() > > > > v2: https://lore.kernel.org/xen-devel/20260803070047.3097846-3-dmukhin@ford.com/ > > CI: https://gitlab.com/xen-project/people/dmukhin/xen/-/pipelines/2748655201 > > --- > > xen/common/kernel.c | 20 ++++++++++++++++++++ > > 1 file changed, 20 insertions(+) > > > > diff --git a/xen/common/kernel.c b/xen/common/kernel.c > > index d1bef9ac2b2b..54a7ee6f68e5 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,25 @@ 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); > > + > > + if ( IS_ENABLED(CONFIG_CMDLINE_OVERRIDE) ) > > + printk("Bootloader command line ignored (CONFIG_CMDLINE_OVERRIDE=y)\n"); > > Since we are there already, why not print the builtin command line > using CONFIG_CMDLINE? Will update. > > > + else > > + printk("Command line: %s\n", saved_cmdline); > > +} > > + > > +static int __init cf_check misc_init(void) > > +{ > > + register_keyhandler('X', show_hypervisor_info, > > + "show hypervisor information", 0); > > "show hypervisor information" seems too generic to me, almost all > debug keys could be defined by this sentence TBH. I think this needs > to be more specific, but I'm not sure what's the plan regarding this > key. Is there an intention to print more stuff here, or just the > command line? Knowing the full set of information to be printed might > help come up with a better name. I will update to "show_cmdline" since I originally planed to expose Xen command line only so it is possible to better debug a system when dom0 becomes almost unresponsive. > > Thanks, Roger. > -- Denis ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3] xen/common: add keyhandler to show Xen command line 2026-08-11 20:56 ` dmukhin @ 2026-08-12 7:28 ` Jan Beulich 2026-08-12 8:03 ` Roger Pau Monné 0 siblings, 1 reply; 6+ messages in thread From: Jan Beulich @ 2026-08-12 7:28 UTC (permalink / raw) To: dmukhin Cc: xen-devel, andrew.cooper3, anthony.perard, julien, michal.orzel, sstabellini, Roger Pau Monné On 11.08.2026 22:56, dmukhin@ford.com wrote: > On Tue, Aug 11, 2026 at 10:05:17AM +0200, Roger Pau Monné wrote: >> On Mon, Aug 10, 2026 at 04:04:01PM -0700, dmukhin@ford.com wrote: >>> +static int __init cf_check misc_init(void) >>> +{ >>> + register_keyhandler('X', show_hypervisor_info, >>> + "show hypervisor information", 0); >> >> "show hypervisor information" seems too generic to me, almost all >> debug keys could be defined by this sentence TBH. I think this needs >> to be more specific, but I'm not sure what's the plan regarding this >> key. Is there an intention to print more stuff here, or just the >> command line? Knowing the full set of information to be printed might >> help come up with a better name. > > I will update to "show_cmdline" since I originally planed to expose Xen > command line only so it is possible to better debug a system when dom0 > becomes almost unresponsive. Yet as indicated already on v1 (I think) - a precious debug key character for just the command line seems rather wasteful to me. If it's only the command line, and if that _really_ needs exposing via a debug key (i.e. if there are reasonable scenarios where "xl info" cannot be used), perhaps attach it to e.g. the 'h' key output? Jan ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3] xen/common: add keyhandler to show Xen command line 2026-08-12 7:28 ` Jan Beulich @ 2026-08-12 8:03 ` Roger Pau Monné 2026-08-12 8:19 ` Jan Beulich 0 siblings, 1 reply; 6+ messages in thread From: Roger Pau Monné @ 2026-08-12 8:03 UTC (permalink / raw) To: Jan Beulich Cc: dmukhin, xen-devel, andrew.cooper3, anthony.perard, julien, michal.orzel, sstabellini On Wed, Aug 12, 2026 at 09:28:46AM +0200, Jan Beulich wrote: > On 11.08.2026 22:56, dmukhin@ford.com wrote: > > On Tue, Aug 11, 2026 at 10:05:17AM +0200, Roger Pau Monné wrote: > >> On Mon, Aug 10, 2026 at 04:04:01PM -0700, dmukhin@ford.com wrote: > >>> +static int __init cf_check misc_init(void) > >>> +{ > >>> + register_keyhandler('X', show_hypervisor_info, > >>> + "show hypervisor information", 0); > >> > >> "show hypervisor information" seems too generic to me, almost all > >> debug keys could be defined by this sentence TBH. I think this needs > >> to be more specific, but I'm not sure what's the plan regarding this > >> key. Is there an intention to print more stuff here, or just the > >> command line? Knowing the full set of information to be printed might > >> help come up with a better name. > > > > I will update to "show_cmdline" since I originally planed to expose Xen > > command line only so it is possible to better debug a system when dom0 > > becomes almost unresponsive. > > Yet as indicated already on v1 (I think) - a precious debug key character > for just the command line seems rather wasteful to me. If it's only the > command line, and if that _really_ needs exposing via a debug key (i.e. > if there are reasonable scenarios where "xl info" cannot be used), perhaps > attach it to e.g. the 'h' key output? I was going to say that we should not overload the 'h' key with printing a possibly long string, but I see we already print a bunch of information there, like the buildid and the compiler banner. One option would be to introduce a new debug character, and move the printing of the buildid and the banner to that key, together with the command line. Then 'h' output will be cleaner and just print the list of installed handlers. That would give the new key more content, and help cleanup the output from the 'h' debug key at the same time. Thanks, Roger. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3] xen/common: add keyhandler to show Xen command line 2026-08-12 8:03 ` Roger Pau Monné @ 2026-08-12 8:19 ` Jan Beulich 0 siblings, 0 replies; 6+ messages in thread From: Jan Beulich @ 2026-08-12 8:19 UTC (permalink / raw) To: Roger Pau Monné Cc: dmukhin, xen-devel, andrew.cooper3, anthony.perard, julien, michal.orzel, sstabellini On 12.08.2026 10:03, Roger Pau Monné wrote: > On Wed, Aug 12, 2026 at 09:28:46AM +0200, Jan Beulich wrote: >> On 11.08.2026 22:56, dmukhin@ford.com wrote: >>> On Tue, Aug 11, 2026 at 10:05:17AM +0200, Roger Pau Monné wrote: >>>> On Mon, Aug 10, 2026 at 04:04:01PM -0700, dmukhin@ford.com wrote: >>>>> +static int __init cf_check misc_init(void) >>>>> +{ >>>>> + register_keyhandler('X', show_hypervisor_info, >>>>> + "show hypervisor information", 0); >>>> >>>> "show hypervisor information" seems too generic to me, almost all >>>> debug keys could be defined by this sentence TBH. I think this needs >>>> to be more specific, but I'm not sure what's the plan regarding this >>>> key. Is there an intention to print more stuff here, or just the >>>> command line? Knowing the full set of information to be printed might >>>> help come up with a better name. >>> >>> I will update to "show_cmdline" since I originally planed to expose Xen >>> command line only so it is possible to better debug a system when dom0 >>> becomes almost unresponsive. >> >> Yet as indicated already on v1 (I think) - a precious debug key character >> for just the command line seems rather wasteful to me. If it's only the >> command line, and if that _really_ needs exposing via a debug key (i.e. >> if there are reasonable scenarios where "xl info" cannot be used), perhaps >> attach it to e.g. the 'h' key output? > > I was going to say that we should not overload the 'h' key with > printing a possibly long string, but I see we already print a bunch of > information there, like the buildid and the compiler banner. > > One option would be to introduce a new debug character, and move the > printing of the buildid and the banner to that key, together with the > command line. Then 'h' output will be cleaner and just print the list > of installed handlers. That would give the new key more content, and > help cleanup the output from the 'h' debug key at the same time. Hmm, yes, that's definitely an option. May I then further suggest to use '?' as the key for this? (Or am I overlooking that key already being in use somewhere?) Jan ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-08-12 8:20 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-08-10 23:04 [PATCH v3] xen/common: add keyhandler to show Xen command line dmukhin 2026-08-11 8:05 ` Roger Pau Monné 2026-08-11 20:56 ` dmukhin 2026-08-12 7:28 ` Jan Beulich 2026-08-12 8:03 ` Roger Pau Monné 2026-08-12 8:19 ` Jan Beulich
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.