All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/cmdline: Interpret 'vpmu' as a positive boolean
@ 2022-03-02 22:11 Andrew Cooper
  2022-03-03  7:44 ` Jan Beulich
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Cooper @ 2022-03-02 22:11 UTC (permalink / raw)
  To: Xen-devel; +Cc: Andrew Cooper, Jan Beulich, Roger Pau Monné, Wei Liu

This makes it behave slightly more like a regular boolean option.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>

Slightly RFC, because there is no easy way of making the opposite "normal
boolean" case work for no-vpmu.
---
 xen/arch/x86/cpu/vpmu.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/vpmu.c b/xen/arch/x86/cpu/vpmu.c
index 4fedc7c57012..501d4f0af94e 100644
--- a/xen/arch/x86/cpu/vpmu.c
+++ b/xen/arch/x86/cpu/vpmu.c
@@ -66,7 +66,9 @@ static int __init cf_check parse_vpmu_params(const char *s)
         if ( !ss )
             ss = strchr(s, '\0');
 
-        if ( (val = parse_bool(s, ss)) >= 0 )
+        if ( s == ss )
+            opt_vpmu_enabled = true;
+        else if ( (val = parse_bool(s, ss)) >= 0 )
         {
             opt_vpmu_enabled = val;
             if ( !val )
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-03-03 11:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-02 22:11 [PATCH] x86/cmdline: Interpret 'vpmu' as a positive boolean Andrew Cooper
2022-03-03  7:44 ` Jan Beulich
2022-03-03 10:48   ` Andrew Cooper
2022-03-03 11:04     ` Jan Beulich
2022-03-03 11:15       ` Andrew Cooper
2022-03-03 11:40         ` 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.