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: <CAJZ5v0j2mbKOqDaL_31fL9ftTZRhUiURx3nubLmLUo3-R_w3gw@mail.gmail.com>
Date:   Tue, 24 Oct 2023 20:51:57 +0200
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Tony Luck <tony.luck@...el.com>, Jeshua Smith <jeshuas@...dia.com>
Cc:     keescook@...omium.org, gpiccoli@...lia.com, rafael@...nel.org,
        lenb@...nel.org, james.morse@....com, bp@...en8.de,
        linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-hardening@...r.kernel.org, linux-tegra@...r.kernel.org,
        treding@...dia.com, jonathanh@...dia.com
Subject: Re: [PATCH V2] ACPI: APEI: Use ERST timeout for slow devices

On Tue, Oct 24, 2023 at 5:27 PM Tony Luck <tony.luck@...el.com> wrote:
>
> On Wed, Jul 12, 2023 at 10:34:48PM +0000, Jeshua Smith wrote:
> > Slow devices such as flash may not meet the default 1ms timeout value,
> > so use the ERST max execution time value that they provide as the
> > timeout if it is larger.
> >
> > Signed-off-by: Jeshua Smith <jeshuas@...dia.com>
>
> > +/* ERST Exec max timings */
> > +#define ERST_EXEC_TIMING_MAX_MASK      0xFFFFFFFF00000000
> > +#define ERST_EXEC_TIMING_MAX_SHIFT     32
>
> I've recently become a fan of <linux/bitfield.h> I think this would
> be easier on the eyes as:
>
> #define ERST_EXEC_TIMING_MAX    GENMASK_ULL(63, 32)
>
> > +static inline u64 erst_get_timeout(void)
> > +{
> > +     u64 timeout = FIRMWARE_TIMEOUT;
> > +
> > +     if (erst_erange.attr & ERST_RANGE_SLOW) {
> > +             timeout = ((erst_erange.timings & ERST_EXEC_TIMING_MAX_MASK) >>
> > +                     ERST_EXEC_TIMING_MAX_SHIFT) * NSEC_PER_MSEC;
>
> then this becomes:
>
>                 timeout = FIELD_GET(ERST_EXEC_TIMING_MAX, erst_erange.timings) *
>                           NSEC_PER_MSEC;
>
> > +             if (timeout < FIRMWARE_TIMEOUT)
> > +                     timeout = FIRMWARE_TIMEOUT;
>
> But that's just a matter of style.  Otherwise the patch looks fine.
>
> Reviewed-by: Tony Luck <tony.luck@...el.com>

Applied as 6.7 material, thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ