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
| ||
|
Date: Mon, 1 Jun 2020 21:00:17 +0000 From: "Agarwal, Anchal" <anchalag@...zon.com> To: Boris Ostrovsky <boris.ostrovsky@...cle.com>, "tglx@...utronix.de" <tglx@...utronix.de>, "mingo@...hat.com" <mingo@...hat.com>, "bp@...en8.de" <bp@...en8.de>, "hpa@...or.com" <hpa@...or.com>, "x86@...nel.org" <x86@...nel.org>, "jgross@...e.com" <jgross@...e.com>, "linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>, "linux-mm@...ck.org" <linux-mm@...ck.org>, "Kamata, Munehisa" <kamatam@...zon.com>, "sstabellini@...nel.org" <sstabellini@...nel.org>, "konrad.wilk@...cle.com" <konrad.wilk@...cle.com>, "roger.pau@...rix.com" <roger.pau@...rix.com>, "axboe@...nel.dk" <axboe@...nel.dk>, "davem@...emloft.net" <davem@...emloft.net>, "rjw@...ysocki.net" <rjw@...ysocki.net>, "len.brown@...el.com" <len.brown@...el.com>, "pavel@....cz" <pavel@....cz>, "peterz@...radead.org" <peterz@...radead.org>, "Valentin, Eduardo" <eduval@...zon.com>, "Singh, Balbir" <sblbir@...zon.com>, "xen-devel@...ts.xenproject.org" <xen-devel@...ts.xenproject.org>, "vkuznets@...hat.com" <vkuznets@...hat.com>, "netdev@...r.kernel.org" <netdev@...r.kernel.org>, "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, "Woodhouse, David" <dwmw@...zon.co.uk>, "benh@...nel.crashing.org" <benh@...nel.crashing.org>, "Agarwal, Anchal" <anchalag@...zon.com> Subject: Re: [PATCH 01/12] xen/manage: keep track of the on-going suspend mode CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe. On 5/19/20 7:24 PM, Anchal Agarwal wrote: > > +enum suspend_modes { > + NO_SUSPEND = 0, > + XEN_SUSPEND, > + PM_SUSPEND, > + PM_HIBERNATION, > +}; > + > +/* Protected by pm_mutex */ > +static enum suspend_modes suspend_mode = NO_SUSPEND; > + > +bool xen_suspend_mode_is_xen_suspend(void) > +{ > + return suspend_mode == XEN_SUSPEND; > +} > + > +bool xen_suspend_mode_is_pm_suspend(void) > +{ > + return suspend_mode == PM_SUSPEND; > +} > + > +bool xen_suspend_mode_is_pm_hibernation(void) > +{ > + return suspend_mode == PM_HIBERNATION; > +} > + I don't see these last two used anywhere. Are you, in fact, distinguishing between PM suspend and hibernation? Yes, I am. Unless there is a better way to distinguish at runtime which I haven't figured out yet. The initial design was to have separate states for separate modes. Currently, PM_HIBERNATION is handled by !xen_suspend . However, if any case arises where we need to set the suspend_mode, its available via this interface. This is basically to support PM* ops via ACPI path. Since, PM_SUSPEND is not handled by the series the code piece can be removed and added later. Any comments? (I would also probably shorten the name a bit, perhaps xen_is_pv/pm_suspend()?) Sure. Will fix in my next round of post. -boris Thanks, Anchal
Powered by blists - more mailing lists