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: <23c353e0-078f-91e4-26fe-bf552319eaad@amd.com>
Date:   Tue, 1 Nov 2022 14:58:41 -0500
From:   "Limonciello, Mario" <mario.limonciello@....com>
To:     Sven van Ashbrook <svenva@...omium.org>
Cc:     Rafael J Wysocki <rafael@...nel.org>, Pavel Machek <pavel@....cz>,
        Len Brown <len.brown@...el.com>,
        Rajneesh Bhardwaj <irenic.rajneesh@...il.com>,
        S-k Shyam-sundar <Shyam-sundar.S-k@....com>,
        rrangel@...omium.org, platform-driver-x86@...r.kernel.org,
        Rajat Jain <rajatja@...gle.com>,
        David E Box <david.e.box@...el.com>,
        Hans de Goede <hdegoede@...hat.com>,
        linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org
Subject: Re: [RFC 1/3] PM: Add a sysfs file to represent whether hardware
 reached the deepest state

On 11/1/2022 12:37, Sven van Ashbrook wrote:
> On Mon, Oct 31, 2022 at 4:43 PM Mario Limonciello
> <mario.limonciello@....com> wrote:
>>
>> +void pm_set_hw_deepest_state(u64 duration)
>> +{
>> +       suspend_stats.last_hw_deepest_state = duration;
> 
> I'm wondering if we could add a userspace notification here. Then
> userspace wouldn't have to synchronize with the suspend/resume state
> of the system when reading this entry.
> 
> What about sysfs_notify() ? Or via udev?

The question I would have is what kobj would you notify?  power_kobj? 
Lots of other things write to suspend stats, but nothing else sends 
notifications.  So why is this one going to be special?

To me I don't think it's much different for userspace to "always" read 
the file after resume vs wait for the notification and then read it.

To make userspace flexible to multiple kernel versions it seems to me 
that userspace could check if that file exists before suspend and if it 
does then check the value after suspend.

> 
>> +}
>> +EXPORT_SYMBOL_GPL(pm_set_hw_deepest_state);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ