From: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: xen-devel@lists.xenproject.org, "Jan Beulich" <jbeulich@suse.com>,
"Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>
Subject: Re: [PATCH] x86/xstate: reset cached register values on resume
Date: Thu, 19 Aug 2021 13:41:04 +0200 [thread overview]
Message-ID: <YR5DUPS+2oFCqcWW@mail-itl> (raw)
In-Reply-To: <45de5185-b514-8c52-6922-4c587818c698@citrix.com>
[-- Attachment #1: Type: text/plain, Size: 1499 bytes --]
On Wed, Aug 18, 2021 at 01:44:31PM +0100, Andrew Cooper wrote:
> On 18/08/2021 12:30, Marek Marczykowski-Górecki wrote:
> > set_xcr0() and set_msr_xss() use cached value to avoid setting the
> > register to the same value over and over. But suspend/resume implicitly
> > reset the registers and since percpu areas are not deallocated on
> > suspend anymore, the cache gets stale.
> > Reset the cache on resume, to ensure the next write will really hit the
> > hardware. Choose value 0, as it will never be a legitimate write to
> > those registers - and so, will force write (and cache update).
> >
> > Note the cache is used io get_xcr0() and get_msr_xss() too, but:
> > - set_xcr0() is called few lines below in xstate_init(), so it will
> > update the cache with appropriate value
> > - get_msr_xss() is not used anywhere - and thus not before any
> > set_msr_xss() that will fill the cache
> >
> > Fixes: aca2a985a55a "xen: don't free percpu areas during suspend"
> > Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
>
> I'd prefer to do this differently. As I said in the thread, there are
> other registers such as MSR_TSC_AUX which fall into the same category,
> and I'd like to make something which works systematically.
I'm not sure if I understand your message: do you want me to do things
differently, or are you working on an alternative fix yourself?
--
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2021-08-19 11:41 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-18 11:30 [PATCH] x86/xstate: reset cached register values on resume Marek Marczykowski-Górecki
2021-08-18 12:05 ` Jan Beulich
2021-08-18 12:07 ` Marek Marczykowski-Górecki
2021-08-18 12:44 ` Andrew Cooper
2021-08-19 11:41 ` Marek Marczykowski-Górecki [this message]
2021-08-24 21:11 ` Andrew Cooper
2021-08-25 15:02 ` Jan Beulich
2021-08-25 16:49 ` Andrew Cooper
2021-08-26 7:40 ` Jan Beulich
2021-08-26 8:50 ` Andrew Cooper
2021-10-18 8:21 ` Ping: " Jan Beulich
2021-10-21 13:44 ` Roger Pau Monné
2021-11-01 13:40 ` Marek Marczykowski-Górecki
2021-11-03 11:31 ` Jan Beulich
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=YR5DUPS+2oFCqcWW@mail-itl \
--to=marmarek@invisiblethingslab.com \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=roger.pau@citrix.com \
--cc=wl@xen.org \
--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 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.