lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL_JsqKsZrsnn92XHL4QdFkAgFKqVTBZXDz9wVv-_7oywOOsBQ@mail.gmail.com>
Date:   Fri, 24 Apr 2020 12:47:23 -0500
From:   Rob Herring <robh+dt@...nel.org>
To:     Jiaxun Yang <jiaxun.yang@...goat.com>
Cc:     PCI <linux-pci@...r.kernel.org>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
        Huacai Chen <chenhc@...ote.com>,
        Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
        Andrew Murray <amurray@...goodpenguin.co.uk>,
        Paul Burton <paulburton@...nel.org>,
        devicetree@...r.kernel.org,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "open list:MIPS" <linux-mips@...r.kernel.org>
Subject: Re: [PATCH v5 1/6] PCI: OF: Don't remap iospace on unsupported platform

On Fri, Apr 24, 2020 at 8:09 AM Jiaxun Yang <jiaxun.yang@...goat.com> wrote:
>
> There are some platforms that don't support I/O space remapping
> like MIPS. However, our PCI code will try to remap iospace
> unconditionally and reject io resources on these platforms.
>
> So we should remove I/O space remapping check and use a range
> check instead on these platforms.
>
> Signed-off-by: Jiaxun Yang <jiaxun.yang@...goat.com>
> --
> v4: Fix a typo in commit message.
> v5: Commit message massage
> ---
>  drivers/pci/of.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/drivers/pci/of.c b/drivers/pci/of.c
> index 81ceeaa6f1d5..36e8761b66c6 100644
> --- a/drivers/pci/of.c
> +++ b/drivers/pci/of.c
> @@ -547,12 +547,21 @@ int pci_parse_request_of_pci_ranges(struct device *dev,
>
>                 switch (resource_type(res)) {
>                 case IORESOURCE_IO:
> +#if defined(PCI_IOBASE) && defined(CONFIG_MMU)

We already have the same condition in pci_remap_iospace(). All this
does is suppress a WARN. If a WARN is not desired, then change it.
Perhaps just a single line rather than backtrace would be okay.
Whether to WARN or not shouldn't be a decision for firmware code.

Though really, if I/O space can never be supported, then it's an error
in your DT to describe it.

>                         err = devm_pci_remap_iospace(dev, res, iobase);
>                         if (err) {
>                                 dev_warn(dev, "error %d: failed to map resource %pR\n",
>                                          err, res);
>                                 resource_list_destroy_entry(win);
>                         }
> +#else
> +                       /* Simply check if IO is inside the range */

Why do you care if it's never used?

> +                       if (res->end > IO_SPACE_LIMIT) {
> +                               dev_warn(dev, "resource %pR out of the I/O range\n",
> +                                       res);
> +                               resource_list_destroy_entry(win);
> +                       }
> +#endif
>                         break;
>                 case IORESOURCE_MEM:
>                         res_valid |= !(res->flags & IORESOURCE_PREFETCH);
> --
> 2.26.0.rc2
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ