All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xen.org>
Cc: "Juergen Gross" <jgross@suse.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Wei Liu" <wei.liu2@citrix.com>,
	"Jan Beulich" <JBeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: [PATCH v3 3/7] docs: Improve documentation and parsing for pci=
Date: Wed, 16 Jan 2019 09:00:46 +0000	[thread overview]
Message-ID: <1547629250-1405-4-git-send-email-andrew.cooper3@citrix.com> (raw)
In-Reply-To: <1547629250-1405-1-git-send-email-andrew.cooper3@citrix.com>

Alter parse_pci_param() to use parse_boolean(), so the sub options
behave like other Xen booleans.

Update the command line documentation for consistency.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Wei Liu <wei.liu2@citrix.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Juergen Gross <jgross@suse.com>

v3:
 * New
---
 docs/misc/xen-command-line.pandoc |  9 ++++-----
 xen/drivers/passthrough/pci.c     | 20 ++++----------------
 2 files changed, 8 insertions(+), 21 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index ab486e0..41dec5b 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -1502,13 +1502,12 @@ This option is ignored in **pv-shim** mode.
 > Default: `on`
 
 ### pci
-> `= {no-}serr | {no-}perr`
+    = List of [ serr=<bool>, perr=<bool> ]
 
-> Default: Signaling left as set by firmware.
-
-Disable signaling of SERR (system errors) and/or PERR (parity errors)
-on all PCI devices.
+    Default: Signaling left as set by firmware.
 
+Override the firmware settings, and explicitly enable or disable the
+signalling of PCI System and Parity errors.
 
 ### pci-phantom
 > `=[<seg>:]<bus>:<device>,<stride>`
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 93c20b9..8108ed5 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -188,37 +188,25 @@ custom_param("pci-phantom", parse_phantom_dev);
 static u16 __read_mostly command_mask;
 static u16 __read_mostly bridge_ctl_mask;
 
-/*
- * The 'pci' parameter controls certain PCI device aspects.
- * Optional comma separated value may contain:
- *
- *   serr                       don't suppress system errors (default)
- *   no-serr                    suppress system errors
- *   perr                       don't suppress parity errors (default)
- *   no-perr                    suppress parity errors
- */
 static int __init parse_pci_param(const char *s)
 {
     const char *ss;
     int rc = 0;
 
     do {
-        bool_t on = !!strncmp(s, "no-", 3);
+        int val;
         u16 cmd_mask = 0, brctl_mask = 0;
 
-        if ( !on )
-            s += 3;
-
         ss = strchr(s, ',');
         if ( !ss )
             ss = strchr(s, '\0');
 
-        if ( !cmdline_strcmp(s, "serr") )
+        if ( (val = parse_boolean("serr", s, ss)) >= 0 )
         {
             cmd_mask = PCI_COMMAND_SERR;
             brctl_mask = PCI_BRIDGE_CTL_SERR | PCI_BRIDGE_CTL_DTMR_SERR;
         }
-        else if ( !cmdline_strcmp(s, "perr") )
+        else if ( (val = parse_boolean("perr", s, ss)) >= 0 )
         {
             cmd_mask = PCI_COMMAND_PARITY;
             brctl_mask = PCI_BRIDGE_CTL_PARITY;
@@ -226,7 +214,7 @@ static int __init parse_pci_param(const char *s)
         else
             rc = -EINVAL;
 
-        if ( on )
+        if ( val )
         {
             command_mask &= ~cmd_mask;
             bridge_ctl_mask &= ~brctl_mask;
-- 
2.1.4


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

  parent reply	other threads:[~2019-01-16  9:00 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-16  9:00 [PATCH v3 for-4.12 0/7] Docs improvements, and dom0 construction fixes Andrew Cooper
2019-01-16  9:00 ` [PATCH v3 1/7] docs: Improve documentation for dom0= and dom0-iommu= Andrew Cooper
2019-01-16 10:53   ` Roger Pau Monné
2019-01-16 19:54     ` Andrew Cooper
2019-01-16 11:52   ` Jan Beulich
2019-01-16 19:51     ` Andrew Cooper
2019-01-17  8:43       ` Roger Pau Monné
2019-01-17  9:08         ` Andrew Cooper
2019-01-17  9:14           ` Juergen Gross
2019-01-17 11:59             ` Jan Beulich
2019-01-17 12:11             ` Andrew Cooper
2019-01-17 11:20       ` Jan Beulich
2019-01-17 12:15         ` Andrew Cooper
2019-01-17 12:26           ` Jan Beulich
2019-01-21 17:24             ` Andrew Cooper
2019-01-16  9:00 ` [PATCH v3 2/7] docs: Improve documentation and parsing for iommu= Andrew Cooper
2019-01-16 11:06   ` Roger Pau Monné
2019-01-21 17:30     ` Andrew Cooper
2019-01-16 13:47   ` Jan Beulich
2019-01-16  9:00 ` Andrew Cooper [this message]
2019-01-16 11:08   ` [PATCH v3 3/7] docs: Improve documentation and parsing for pci= Roger Pau Monné
2019-01-16 13:52   ` Jan Beulich
2019-01-16  9:00 ` [PATCH v3 4/7] docs: Improve documentation and parsing for efi= Andrew Cooper
2019-01-16 14:00   ` Jan Beulich
2019-01-16  9:00 ` [PATCH v3 5/7] x86/dom0: Improve dom0= useability Andrew Cooper
2019-01-16 11:13   ` Roger Pau Monné
2019-01-16 14:08   ` Jan Beulich
2019-01-16 19:58     ` Andrew Cooper
2019-01-17 11:21       ` Jan Beulich
2019-01-16  9:00 ` [PATCH v3 6/7] xen/dom0: Drop iommu_hwdom_inclusive entirely Andrew Cooper
2019-01-16 11:24   ` Roger Pau Monné
2019-01-17 13:32   ` Jan Beulich
2019-01-17 14:51     ` Roger Pau Monné
2019-01-16  9:00 ` [PATCH v3 7/7] xen/dom0: Add a dom0-iommu=none option Andrew Cooper
2019-01-16 11:32   ` Roger Pau Monné
2019-01-17 10:55   ` Wei Liu
2019-01-17 13:35   ` Jan Beulich
2019-01-21 18:08     ` Andrew Cooper
2019-01-22  8:06       ` Jan Beulich
2019-01-22 13:42         ` Andrew Cooper
2019-01-16 11:38 ` [PATCH v3 for-4.12 0/7] Docs improvements, and dom0 construction fixes 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=1547629250-1405-4-git-send-email-andrew.cooper3@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=roger.pau@citrix.com \
    --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.