All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Ben Guthro <Benjamin.Guthro@citrix.com>
Cc: "Moore, Robert" <robert.moore@intel.com>,
	"Zheng, Lv" <lv.zheng@intel.com>, Jan Beulich <jbeulich@suse.com>,
	"Rafael J . Wysocki" <rjw@sisk.pl>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH v3 1/3] acpi: Call acpi_os_prepare_sleep hook in reduced hardware sleep path
Date: Wed, 24 Jul 2013 12:32:14 -0400	[thread overview]
Message-ID: <20130724163214.GB6308@phenom.dumpdata.com> (raw)
In-Reply-To: <51EFEF3E.8020001@citrix.com>

On Wed, Jul 24, 2013 at 11:14:06AM -0400, Ben Guthro wrote:
> 
> 
> On 07/24/2013 10:38 AM, Moore, Robert wrote:
> > I haven't found a high-level description of "acpi_os_prepare_sleep", perhaps I missed it.
> > 
> > Can someone point me to the overall description of this change and why it is being considered?
> 
> Hi Bob,
> 
> For this series, the v6 of this series does a decent job of what it is
> trying to accomplish:
> https://lkml.org/lkml/2013/7/1/205
> 
> However, I recognize that this does not really describe *why*
> acpi_os_prepare_sleep is necessary to begin with. For that, we need to
> go back a little more.
> 
> The summary for the series that introduced it is a good description, of
> the reasons it is necessary:
> http://lkml.indiana.edu/hypermail/linux/kernel/1112.2/00450.html
> 
> In summary though - in the case of Xen (and I believe this is also true
> in tboot) a value inappropriate for a VM (which dom0 is a special case
> of) was being written to cr3, and the physical machine would never come
> out of S3.
> 
> This mechanism gives an os specific hook to do something else down at
> the lower levels, while still being able to take advantage of the large
> amount of OS independent code in ACPICA.

It might be also prudent to look at original 'hook' that was added by
Intel in the Linux code to support TXT:


commit 86886e55b273f565935491816c7c96b82469d4f8
Author: Joseph Cihula <joseph.cihula@intel.com>
Date:   Tue Jun 30 19:31:07 2009 -0700

    x86, intel_txt: Intel TXT Sx shutdown support
    
    Support for graceful handling of sleep states (S3/S4/S5) after an Intel(R) TXT launch.
    
    Without this patch, attempting to place the system in one of the ACPI sleep
    states (S3/S4/S5) will cause the TXT hardware to treat this as an attack and
    will cause a system reset, with memory locked.  Not only may the subsequent
    memory scrub take some time, but the platform will be unable to enter the
    requested power state.
    
    This patch calls back into the tboot so that it may properly and securely clean
    up system state and clear the secrets-in-memory flag, after which it will place
    the system into the requested sleep state using ACPI information passed by the kernel.
    
     arch/x86/kernel/smpboot.c     |    2 ++
     drivers/acpi/acpica/hwsleep.c |    3 +++
     kernel/cpu.c                  |    7 ++++++-
     3 files changed, 11 insertions(+), 1 deletion(-)
    
    Signed-off-by: Joseph Cihula <joseph.cihula@intel.com>
    Signed-off-by: Shane Wang <shane.wang@intel.com>
    Signed-off-by: H. Peter Anvin <hpa@zytor.com>

I suspect that if tboot was used with a different OS (Solaris?) it would hit
the same case and a similar hook would be needed.

Said 'hook' (which was a call to tboot_sleep) was converted to be a more neutral
'acpi_os_prepare_sleep' which tboot can use (and incidently Xen too).

I think what Bob is saying that if said hook is neccessary (and I believe 
it is - and Intel TXT maintainer thinks so too since he added it in the first place),
then the right way of adding it is via the ACPICA tree.

Should the discussion for this be moved there ? (https://acpica.org/community)
and an generic 'os_prepare_sleep' patch added in git://github.com/acpica/acpica.git?


  reply	other threads:[~2013-07-24 16:32 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-26 14:06 [PATCH v3 0/3] Xen/ACPI: support sleep state entering on hardware reduced systems Ben Guthro
2013-06-26 14:06 ` Ben Guthro
2013-06-26 14:06 ` [PATCH v3 1/3] acpi: Call acpi_os_prepare_sleep hook in reduced hardware sleep path Ben Guthro
2013-06-26 14:06   ` Ben Guthro
2013-06-26 14:41   ` Jan Beulich
2013-06-26 14:41   ` Jan Beulich
2013-06-26 14:41     ` Jan Beulich
2013-06-26 15:03     ` Ben Guthro
2013-06-26 15:45       ` Jan Beulich
2013-06-26 15:45         ` Jan Beulich
2013-06-26 18:59         ` Rafael J. Wysocki
2013-06-26 18:59         ` Rafael J. Wysocki
2013-06-26 15:45       ` Jan Beulich
2013-06-26 15:03     ` Ben Guthro
2013-07-02  6:19   ` Zheng, Lv
2013-07-02 11:42     ` Ben Guthro
2013-07-24  6:24       ` Zheng, Lv
2013-07-24  6:24       ` Zheng, Lv
2013-07-24 12:01         ` Ben Guthro
2013-07-24 13:18           ` Moore, Robert
2013-07-24 13:18           ` Moore, Robert
2013-07-24 13:23             ` Ben Guthro
2013-07-24 13:23             ` Ben Guthro
2013-07-24 14:38               ` Moore, Robert
2013-07-24 14:38               ` Moore, Robert
2013-07-24 15:14                 ` Ben Guthro
2013-07-24 15:14                 ` Ben Guthro
2013-07-24 16:32                   ` Konrad Rzeszutek Wilk [this message]
2013-07-25  1:28                     ` Zheng, Lv
2013-07-25  1:28                     ` Zheng, Lv
2013-07-25  1:37                       ` Ben Guthro
2013-07-25  1:54                         ` Zheng, Lv
2013-07-25  1:54                         ` Zheng, Lv
2013-07-25  1:54                           ` Zheng, Lv
2013-07-25 12:04                           ` Konrad Rzeszutek Wilk
2013-07-25 12:04                             ` Konrad Rzeszutek Wilk
2013-07-26  2:51                             ` Zheng, Lv
2013-07-26  2:51                               ` Zheng, Lv
2013-07-26 18:03                               ` konrad wilk
2013-07-26 18:03                               ` konrad wilk
2013-07-29  2:22                                 ` Zheng, Lv
2013-07-29  2:22                                 ` Zheng, Lv
2013-07-26  2:51                             ` Zheng, Lv
2013-07-25 12:04                           ` Konrad Rzeszutek Wilk
2013-07-24 16:32                   ` Konrad Rzeszutek Wilk
2013-07-25  1:01                 ` Zheng, Lv
2013-07-25  1:19                   ` Ben Guthro
2013-07-25  1:19                   ` Ben Guthro
2013-07-25  1:01                 ` Zheng, Lv
2013-07-24 12:01         ` Ben Guthro
2013-07-02 11:42     ` Ben Guthro
2013-07-02  6:19   ` Zheng, Lv
2013-06-26 14:06 ` Ben Guthro
2013-06-26 14:06 ` [PATCH v3 2/3] x86/tboot: Fail extended mode reduced hardware sleep Ben Guthro
2013-06-26 14:06   ` Ben Guthro
2013-06-26 14:44   ` Jan Beulich
2013-06-26 14:44     ` Jan Beulich
2013-06-26 14:55     ` Ben Guthro
2013-06-26 14:55     ` Ben Guthro
2013-06-26 15:47       ` Jan Beulich
2013-06-26 15:47         ` Jan Beulich
2013-06-26 15:47       ` Jan Beulich
2013-06-26 14:44   ` Jan Beulich
2013-06-26 14:06 ` Ben Guthro
2013-06-26 14:06 ` [PATCH v3 3/3] xen/acpi: notify xen when reduced hardware sleep is available Ben Guthro
2013-06-26 14:06 ` Ben Guthro
2013-06-26 14:06   ` Ben Guthro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130724163214.GB6308@phenom.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=Benjamin.Guthro@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lv.zheng@intel.com \
    --cc=rjw@sisk.pl \
    --cc=robert.moore@intel.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.