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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 19 May 2020 19:25:02 +0530
From:   Vidya Sagar <vidyas@...dia.com>
To:     Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
        Bjorn Helgaas <helgaas@...nel.org>
CC:     <jingoohan1@...il.com>, <gustavo.pimentel@...opsys.com>,
        Andrew Murray <amurray@...goodpenguin.co.uk>,
        <bhelgaas@...gle.com>, <thierry.reding@...il.com>,
        <jonathanh@...dia.com>, <linux-pci@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <kthota@...dia.com>,
        <mmaddireddy@...dia.com>, <sagar.tv@...il.com>,
        "Alan Mikhak" <alan.mikhak@...ive.com>
Subject: Re: [PATCH] PCI: dwc: Warn only for non-prefetchable memory resource
 size >4GB



On 18-May-20 9:24 PM, Lorenzo Pieralisi wrote:
> External email: Use caution opening links or attachments
> 
> 
> On Wed, May 13, 2020 at 05:35:08PM -0500, Bjorn Helgaas wrote:
>> [+cc Alan; please cc authors of relevant commits,
>> updated Andrew's email address]
>>
>> On Thu, May 14, 2020 at 12:38:55AM +0530, Vidya Sagar wrote:
>>> commit 9e73fa02aa009 ("PCI: dwc: Warn if MEM resource size exceeds max for
>>> 32-bits") enables warning for MEM resources of size >4GB but prefetchable
>>>   memory resources also come under this category where sizes can go beyond
>>> 4GB. Avoid logging a warning for prefetchable memory resources.
>>>
>>> Signed-off-by: Vidya Sagar <vidyas@...dia.com>
>>> ---
>>>   drivers/pci/controller/dwc/pcie-designware-host.c | 3 ++-
>>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
>>> index 42fbfe2a1b8f..a29396529ea4 100644
>>> --- a/drivers/pci/controller/dwc/pcie-designware-host.c
>>> +++ b/drivers/pci/controller/dwc/pcie-designware-host.c
>>> @@ -366,7 +366,8 @@ int dw_pcie_host_init(struct pcie_port *pp)
>>>                      pp->mem = win->res;
>>>                      pp->mem->name = "MEM";
>>>                      mem_size = resource_size(pp->mem);
>>> -                   if (upper_32_bits(mem_size))
>>> +                   if (upper_32_bits(mem_size) &&
>>> +                       !(win->res->flags & IORESOURCE_PREFETCH))
>>>                              dev_warn(dev, "MEM resource size exceeds max for 32 bits\n");
>>>                      pp->mem_size = mem_size;
>>>                      pp->mem_bus_addr = pp->mem->start - win->offset;
> 
> That warning was added for a reason - why should not we log legitimate
> warnings ? AFAIU having resources larger than 4GB can lead to undefined
> behaviour given the current ATU programming API.
Yeah. I'm all for a warning if the size is larger than 4GB in case of
non-prefetchable window as one of the ATU outbound translation channels 
is being used, but, we are not employing any ATU outbound translation 
channel for prefetchable window and they can be greater than 4GB in size 
for all right reasons. So, logging a warning for prefetchable region 
doesn't seem correct to me. Please let me know if my understanding is wrong.

- Vidya Sagar
> 
> Alan ? I want to understand what's the best course of action before
> merging these patches.
> 
> Lorenzo
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ