From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>,
xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] x86/xsave: also save/restore XCR0 across suspend (ACPI S3)
Date: Mon, 21 Oct 2013 15:07:51 +0100 [thread overview]
Message-ID: <CE8AF3C7.61112%keir.xen@gmail.com> (raw)
In-Reply-To: <5264FDDC02000078000FC4BD@nat28.tlf.novell.com>
On 21/10/2013 09:11, "Jan Beulich" <JBeulich@suse.com> wrote:
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
> --- a/xen/arch/x86/acpi/suspend.c
> +++ b/xen/arch/x86/acpi/suspend.c
> @@ -13,12 +13,14 @@
> #include <asm/hvm/hvm.h>
> #include <asm/hvm/support.h>
> #include <asm/i387.h>
> +#include <asm/xstate.h>
> #include <xen/hypercall.h>
>
> static unsigned long saved_lstar, saved_cstar;
> static unsigned long saved_sysenter_esp, saved_sysenter_eip;
> static unsigned long saved_fs_base, saved_gs_base, saved_kernel_gs_base;
> static uint16_t saved_segs[4];
> +static uint64_t saved_xcr0;
>
> void save_rest_processor_state(void)
> {
> @@ -38,6 +40,8 @@ void save_rest_processor_state(void)
> rdmsrl(MSR_IA32_SYSENTER_ESP, saved_sysenter_esp);
> rdmsrl(MSR_IA32_SYSENTER_EIP, saved_sysenter_eip);
> }
> + if ( cpu_has_xsave )
> + saved_xcr0 = get_xcr0();
> }
>
>
> @@ -77,6 +81,9 @@ void restore_rest_processor_state(void)
> do_set_segment_base(SEGBASE_GS_USER_SEL, saved_segs[3]);
> }
>
> + if ( cpu_has_xsave && !set_xcr0(saved_xcr0) )
> + BUG();
> +
> /* Maybe load the debug registers. */
> BUG_ON(is_hvm_vcpu(curr));
> if ( !is_idle_vcpu(curr) && curr->arch.debugreg[7] )
>
>
>
prev parent reply other threads:[~2013-10-21 14:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-21 8:11 [PATCH] x86/xsave: also save/restore XCR0 across suspend (ACPI S3) Jan Beulich
2013-10-21 9:30 ` Andrew Cooper
2013-10-21 14:07 ` Keir Fraser [this message]
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=CE8AF3C7.61112%keir.xen@gmail.com \
--to=keir.xen@gmail.com \
--cc=JBeulich@suse.com \
--cc=xen-devel@lists.xenproject.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).