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: <86ttqe4n1h.fsf@scott-ph-mail.amperecomputing.com>
Date:   Wed, 25 Oct 2023 10:41:46 -0700
From:   D Scott Phillips <scott@...amperecomputing.com>
To:     Bjorn Helgaas <helgaas@...nel.org>
Cc:     linux-acpi@...r.kernel.org, linux-pci@...r.kernel.org,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        linux-kernel@...r.kernel.org, Len Brown <lenb@...nel.org>,
        Darren Hart <darren@...amperecomputing.com>,
        patches@...erecomputing.com
Subject: Re: [PATCH v2 2/2] PCI: hotplug: Add extension driver for Ampere
 Altra hotplug LED control

Bjorn Helgaas <helgaas@...nel.org> writes:

> On Fri, Sep 29, 2023 at 05:20:36PM -0700, D Scott Phillips wrote:
>> On Ampere Altra, PCIe hotplug is handled through ACPI. A side interface is
>> also present to request system firmware control of attention LEDs. Add an
>> ACPI PCI Hotplug companion driver to support attention LED control.
>> ...
>
>> +	arm_smccc_smc(REQUEST, LED_CMD, led_status(status), LED_ATTENTION,
>> +		      pci_domain_nr(bus) | (PCI_SLOT(root_port->devfn) << 4), 0, 0,
>
> pci_domain_nr() returns "int" (normally 32 bits), but since this is an
> ACPI system, the domain comes from _SEG, which is defined to be 16
> bits (ACPI r6.5, sec 6.5.6).
>
> So it looks like ORing in the "slot << 4" clobbers the upper 12 bits
> of _SEG.
>
> Is this code doing the right thing?

Hi Bjorn,

on these Altra platforms _SEG is limited within 0-11. I can add an `&
0xf` to pci_domain_nr() to make it clear that the segment number is
encoded down into 4 bits in the smc request.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ