All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel@lists.xenproject.org
Cc: Kevin Tian <kevin.tian@intel.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Tim Deegan <tim@xen.org>, Ian Jackson <ian.jackson@eu.citrix.com>,
	Julien Grall <julien.grall@arm.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH v4 01/53] xen: add an optional string end parameter to parse_bool()
Date: Fri, 25 Aug 2017 10:31:22 +0200	[thread overview]
Message-ID: <99f33e70-c8ed-4d58-36ae-b9b61343208c@suse.com> (raw)
In-Reply-To: <5d77f822-14c1-dede-ca08-9f15a4b3964b@citrix.com>

On 24/08/17 17:43, Andrew Cooper wrote:
> On 23/08/17 18:33, Juergen Gross wrote:
>> Add a parameter to parse_bool() to specify the end of the to be
>> parsed string. Specifying it as NULL will preserve the current
>> behavior to parse until the end of the input string, while passing
>> a non-NULL pointer will specify the first character after the input
>> string.
>>
>> This will allow to parse boolean sub-strings without having to
>> write a NUL byte into the input string.
>>
>> Modify all users of parse_bool() to pass NULL for the new parameter.
> 
> So I already had plans for parse_bool() during the XSA-226 embaro
> period, but couldn't discuss any of them, and this series appeared in
> the meantime.
> 
> One rather confusing problem we have is that top level booleans behave
> differently to sub-booleans.
> 
> Top-level booleans support all kinds of ={0,true,yes, ...} qualifiers,
> as well as no- prefixes.  sub-booleans may or may not support the
> qualifiers, and where they do support the no- prefixes, the same prefix
> gets silently eaten for non-boolean suboptions.

This is the "iommu=" case, right? And in fact the same statement is true
for all top-level parameters: you can easily specify "no-dma_bits=..."
which will be accepted. Only top-level custom parameters are handled in
a sane way with the "no-" prefix (they are accepted only with no option
value), and boolean parameters, of course.

> I had planned to modify parse_bool() to be
> 
> int parse_bool(const char *field, const char *s)
> {
>     ...
> }
> 
> which cases care of considering the "no-" prefix, optionally skips the
> field name if it matches exactly, and then performs the current logic on
> the remainder of the string.  This way, boolean options should work
> consistently wherever they are.
> 
> It also means that a lot of custom_params() need simplifying to always
> pass intended boolean options to parse_bool().

I believe they do so in most cases.

> Could we see about merging this work together, rather than having two
> series going and modifying how the parsing works?

Hmm, I'm not sure it is worth the effort. Doing a quick search I found
only the iommu case where this would be relevant. All other cases are
handled correctly by _cmdline_parse(): a custom parameter prefixed with
"no-" is accepted only without a value specification.

I'd rather add one further patch to my series to correct the iommu case
and another one to fix _cmdline_parse() for the other cases where the
"no-" prefix is accepted for non-boolean parameters.


Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-08-25  8:31 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-23 17:33 [PATCH v4 00/53] Support for modifying parameters at runtime Juergen Gross
2017-08-23 17:33 ` [PATCH v4 01/53] xen: add an optional string end parameter to parse_bool() Juergen Gross
2017-08-24  6:04   ` Tian, Kevin
2017-08-24 11:47   ` Wei Liu
2017-08-24 15:33   ` Jan Beulich
2017-08-24 15:43   ` Andrew Cooper
2017-08-25  8:31     ` Juergen Gross [this message]
2017-08-25  8:50       ` Jan Beulich
     [not found]   ` <599F0DFB020000780017365B@suse.com>
2017-08-24 16:28     ` Juergen Gross
2017-08-23 17:33 ` [PATCH v4 02/53] xen/arch/arm/acpi/boot.c: let custom parameter parsing routines return errno Juergen Gross
2017-08-23 17:33 ` [PATCH v4 03/53] xen/arch/arm/domain_build.c: " Juergen Gross
2017-08-23 17:33 ` [PATCH v4 04/53] xen/arch/arm/traps.c: " Juergen Gross
2017-08-23 17:33 ` [PATCH v4 05/53] xen/arch/x86/apic.c: " Juergen Gross
2017-08-23 17:33 ` [PATCH v4 06/53] xen/arch/x86/cpu/mcheck/mce.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 07/53] xen/arch/x86/cpu/vpmu.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 08/53] xen/arch/x86/dom0_build.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 09/53] xen/arch/x86/genapic/probe.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 10/53] xen/arch/x86/hvm/viridian.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 11/53] xen/arch/x86/hvm/vmx/vmcs.c: " Juergen Gross
2017-08-24  6:07   ` Tian, Kevin
2017-08-23 17:34 ` [PATCH v4 12/53] xen/arch/x86/io_apic.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 13/53] xen/arch/x86/irq.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 14/53] xen/arch/x86/microcode.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 15/53] xen/arch/x86/mm.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 16/53] xen/arch/x86/nmi.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 17/53] xen/arch/x86/numa.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 18/53] xen/arch/x86/oprofile/nmi_int.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 19/53] xen/arch/x86/psr.c: " Juergen Gross
2017-08-24 15:35   ` Jan Beulich
     [not found]   ` <599F0E57020000780017365E@suse.com>
2017-08-24 16:27     ` Juergen Gross
2017-08-25  8:17       ` Jan Beulich
     [not found]       ` <599FF92102000078001738F2@suse.com>
2017-08-25  8:33         ` Juergen Gross
2017-08-23 17:34 ` [PATCH v4 20/53] xen/arch/x86/setup.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 21/53] xen/arch/x86/shutdown.c: " Juergen Gross
2017-08-25  8:40   ` Jan Beulich
2017-08-23 17:34 ` [PATCH v4 22/53] xen/arch/x86/time.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 23/53] xen/arch/x86/x86_64/mmconfig-shared.c: " Juergen Gross
2017-08-25  8:41   ` Jan Beulich
2017-08-23 17:34 ` [PATCH v4 24/53] xen/common/core_parking.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 25/53] xen/common/domain.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 26/53] xen/common/efi/boot.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 27/53] xen/common/kexec.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 28/53] xen/common/memory.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 29/53] xen/common/sched_credit2.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 30/53] xen/drivers/acpi/tables.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 31/53] xen/drivers/char/console.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 32/53] xen/drivers/cpufreq/cpufreq.c: " Juergen Gross
2017-08-25  8:42   ` Jan Beulich
2017-08-23 17:34 ` [PATCH v4 33/53] xen/drivers/passthrough/amd/iommu_acpi.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 34/53] xen/drivers/passthrough/iommu.c: " Juergen Gross
2017-08-25  8:43   ` Jan Beulich
2017-08-23 17:34 ` [PATCH v4 35/53] xen/drivers/passthrough/pci.c: " Juergen Gross
2017-08-25  8:44   ` Jan Beulich
2017-08-23 17:34 ` [PATCH v4 36/53] xen/drivers/passthrough/vtd/dmar.c: " Juergen Gross
2017-08-24  6:09   ` Tian, Kevin
2017-08-23 17:34 ` [PATCH v4 37/53] xen/drivers/passthrough/vtd/quirks.c: " Juergen Gross
2017-08-24  6:10   ` Tian, Kevin
2017-08-23 17:34 ` [PATCH v4 38/53] xen/drivers/video/vesa.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 39/53] xen/xsm/flask/flask_op.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 40/53] xen: check parameter validity when parsing command line Juergen Gross
2017-08-24 14:27   ` Wei Liu
2017-08-23 17:34 ` [PATCH v4 41/53] xen/arch/x86/apic.c: remove custom_param() error messages Juergen Gross
2017-08-23 17:34 ` [PATCH v4 42/53] xen/arch/x86/cpu/mcheck/mce.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 43/53] xen/arch/x86/hvm/viridian.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 44/53] xen/arch/x86/io_apic.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 45/53] xen/common/kexec.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 46/53] xen/common/sched_credit2.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 47/53] xen: carve out a generic parsing function from _cmdline_parse() Juergen Gross
2017-08-23 17:34 ` [PATCH v4 48/53] xen: add basic support for runtime parameter changing Juergen Gross
2017-08-23 17:34 ` [PATCH v4 49/53] xen: add hypercall for setting parameters at runtime Juergen Gross
2017-08-24 14:28   ` Wei Liu
2017-08-23 17:34 ` [PATCH v4 50/53] libxc: add function to set hypervisor parameters Juergen Gross
2017-08-23 17:34 ` [PATCH v4 51/53] libxl: add libxl_set_parameters() function Juergen Gross
2017-08-23 17:34 ` [PATCH v4 52/53] xl: add new xl command set-parameters Juergen Gross
2017-08-23 17:34 ` [PATCH v4 53/53] xen: make some console related parameters settable at runtime Juergen Gross

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=99f33e70-c8ed-4d58-36ae-b9b61343208c@suse.com \
    --to=jgross@suse.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien.grall@arm.com \
    --cc=kevin.tian@intel.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --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.