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: <a2bbdfed-fb17-51dc-8ae4-55d924c13211@kernel.org>
Date:   Mon, 28 Sep 2020 07:17:24 -0400
From:   Sinan Kaya <okaya@...nel.org>
To:     "Kuppuswamy, Sathyanarayanan" 
        <sathyanarayanan.kuppuswamy@...ux.intel.com>,
        Bjorn Helgaas <helgaas@...nel.org>
Cc:     bhelgaas@...gle.com, linux-pci@...r.kernel.org,
        linux-kernel@...r.kernel.org, ashok.raj@...el.com,
        Jay Vosburgh <jay.vosburgh@...onical.com>
Subject: Re: [PATCH v3 1/1] PCI/ERR: Fix reset logic in pcie_do_recovery()
 call

On 9/27/2020 10:43 PM, Kuppuswamy, Sathyanarayanan wrote:
> FATAL + no-hotplug - In this case, link will still be reseted. But
> currently driver state is not properly restored. So I attempted
> to restore it using pci_reset_bus().
> 
>          status = reset_link(dev);
> -        if (status != PCI_ERS_RESULT_RECOVERED) {
> +        if (status == PCI_ERS_RESULT_RECOVERED) {
> +            status = PCI_ERS_RESULT_NEED_RESET;
> 
> ...
> 
>      if (status == PCI_ERS_RESULT_NEED_RESET) {
>          /*
> -         * TODO: Should call platform-specific
> -         * functions to reset slot before calling
> -         * drivers' slot_reset callbacks?
> +         * TODO: Optimize the call to pci_reset_bus()
> +         *
> +         * There are two components to pci_reset_bus().
> +         *
> +         * 1. Do platform specific slot/bus reset.
> +         * 2. Save/Restore all devices in the bus.
> +         *
> +         * For hotplug capable devices and fatal errors,
> +         * device is already in reset state due to link
> +         * reset. So repeating platform specific slot/bus
> +         * reset via pci_reset_bus() call is redundant. So
> +         * can optimize this logic and conditionally call
> +         * pci_reset_bus().
>           */
> +        pci_reset_bus(dev);

I think we have to go to remove/rescan for this case as you also
mentioned above. There is no state to save. All BAR assignments
are gone. Entire device programming is also lost.

I don't think pci_reset_bus() can recover from this situation safely.
It will make things worse by saving/restoring the hardware default
state.

This should remove/rescan logic should be inside DPC's slot_reset()
function BTW. Not here.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ