All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Julien Grall <julien.grall@arm.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>,
	Xen-devel <xen-devel@lists.xen.org>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [PATCH 2/2] xen/dom0: Add a dom0-iommu=none option
Date: Fri, 04 Jan 2019 02:11:06 -0700	[thread overview]
Message-ID: <5C2F232A020000780020A213@prv1-mh.provo.novell.com> (raw)
In-Reply-To: <49b54133-b731-2994-f074-cb7f885b38f4@citrix.com>

>>> On 21.12.18 at 13:55, <andrew.cooper3@citrix.com> wrote:
> On 21/12/2018 12:13, Jan Beulich wrote:
>>>>> On 21.12.18 at 00:40, <andrew.cooper3@citrix.com> wrote:
>>> @@ -271,6 +272,26 @@ int parse_boolean(const char *name, const char *s, const char *e)
>>>      return -1;
>>>  }
>>>  
>>> +int cmdline_strcmp(const char *frag, const char *name)
>> __init ?
> 
> I think there are some runtime parameters in need of some fixing as well.

Ideally we'd drop __init at the point such a change indeed goes in. As
a compromise you may want to mention the reason for the omission
in the description (preferably with a concrete example).

>>> +{
>>> +    while ( 1 )
>>> +    {
>>> +        int res = (*frag - *name);
>>> +
>>> +        if ( res || *name == '\0' )
>>> +        {
>>> +            /* NUL in 'name' matching punctuation in 'frag' implies success. */
>>> +            if ( *name == '\0' && ispunct(*frag) )
>>> +                res = 0;
>> Isn't ispunct() true for dashes and perhaps also underscores?
>> I don't think it can be this generic, the more that ...
>>
>>> --- a/xen/include/xen/lib.h
>>> +++ b/xen/include/xen/lib.h
>>> @@ -79,6 +79,13 @@ int parse_bool(const char *s, const char *e);
>>>   */
>>>  int parse_boolean(const char *name, const char *s, const char *e);
>>>  
>>> +/**
>>> + * Very similar to strcmp(), but will declare a match if the NUL in 'name'
>>> + * lines up with punctuationin 'frag'.  Designed for picking exact string
>>> + * matches out of a comma-separated command line fragment.
>>> + */
>>> +int cmdline_strcmp(const char *frag, const char *name);
>> ... you talk of commas only here.
> 
> I actually borrowed this function from my CPUID cmdline patch.  In 99%
> of cases, we only need to match = and , but we have some other
> parameters such as psr= which use : for delimiters, hence the use of
> ispunct().
> 
> As an alternative, I could revert back to explicitly checking the
> expected punctuation.  It is not as if this is a fastpath.

Imo this would be better than treating punctuation we don't want
to consider separators the same as intended-to-be-separators.

Jan



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

  reply	other threads:[~2019-01-04  9:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-20 23:40 [PATCH 0/2] Ease development with a PVH Xen and XTF PVH dom0 Andrew Cooper
2018-12-20 23:40 ` [PATCH 1/2] xen/dom0: Improve documentation for dom0= and dom0-iommu= Andrew Cooper
2018-12-21 12:08   ` Jan Beulich
2018-12-21 12:44     ` Andrew Cooper
2019-01-04  9:07       ` Jan Beulich
2018-12-21 12:08   ` Roger Pau Monné
2018-12-21 13:13     ` Andrew Cooper
2018-12-21 16:06       ` Roger Pau Monné
2018-12-24 12:46         ` Andrew Cooper
2019-01-04 12:04           ` Roger Pau Monné
2019-01-04 12:06             ` Andrew Cooper
2018-12-20 23:40 ` [PATCH 2/2] xen/dom0: Add a dom0-iommu=none option Andrew Cooper
2018-12-21 12:13   ` Jan Beulich
2018-12-21 12:55     ` Andrew Cooper
2019-01-04  9:11       ` Jan Beulich [this message]
2018-12-21 12:44   ` Roger Pau Monné
2018-12-21 13:01     ` Andrew Cooper
2018-12-21 15:55       ` 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=5C2F232A020000780020A213@prv1-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=julien.grall@arm.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.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.