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] [day] [month] [year] [list]
Date:   Sat, 22 Jan 2022 19:09:09 +0000
From:   Vikash Bansal <bvikas@...are.com>
To:     Greg KH <gregkh@...uxfoundation.org>
CC:     "bhelgaas@...gle.com" <bhelgaas@...gle.com>,
        "linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Srivatsa Bhat <srivatsab@...are.com>,
        "srivatsa@...il.mit.edu" <srivatsa@...il.mit.edu>,
        Alexey Makhalov <amakhalov@...are.com>,
        Srinidhi Rao <srinidhir@...are.com>,
        Anish Swaminathan <anishs@...are.com>,
        Vasavi Sirnapalli <vsirnapalli@...are.com>,
        Ajay Kaher <akaher@...are.com>
Subject: Re: [PATCH] PCI: Speed up device init by parsing capabilities all at
 once

        In my earlier response, I agreed to few changes suggested by Greg.
        I observed some issue while implementing 2 of those changes. 

        On 20/01/22, 11:01 PM, "Vikash Bansal" <bvikas@...are.com> wrote:
        >>> +		pci_bus_read_config_word(dev->bus, dev->devfn, pos, &ent);
        >>> +		id = ent & 0xff;
        >>> +		if (id == 0xff)
        >>> +			break;
        >>> +
        >>> +		/* Read first instance of capability */
        >>> +		if (!(dev->cap_off[id]))
        >>> +			dev->cap_off[id] = pos;
        >>
        >>Shouldn't you have checked this before you read the value?
        >>
        >
        >Yes, will move this code
        >

        Cannot be moved before read, because "id" used in this "if" conditions is
        returned by last read.
        
        >>> @@ -1128,6 +1129,7 @@ void pci_sort_breadthfirst(void);
        >>>  
        >>>  u8 pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap);
        >>>  u8 pci_find_capability(struct pci_dev *dev, int cap);
        >>> +void pci_find_all_capabilities(struct pci_dev *dev);
        >>
        >>Why is this now a global function and not one just local to the pci
        >>core?  Who else would ever need to call it?
        >
        >Will make pci_find_all_capabilitie local and move it to probe.c
        >

        pci_find_all_capabilities function is called only once in probe.c file,
        but this function is calling __pci_bus_find_cap_start which is defined in pci.c,
        so need to implement this function in pci.c and make it global.

        Thanks
        Vikash
        




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ