All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger@xenproject.org>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: xen-devel@lists.xenproject.org, Jan Beulich <jbeulich@suse.com>,
	Teddy Astie <teddy.astie@vates.tech>
Subject: Re: [PATCH 1/2] x86/cpu: keep cached TSC_AUX state coherent with hardware
Date: Mon, 2 Nov 2026 14:59:38 +0100	[thread overview]
Message-ID: <auiXSv0I3mU8NjpV@Mac.lan> (raw)
In-Reply-To: <7a2732d9-8d3c-4e7e-b0b0-1d4ba96bf6ea@citrix.com>

On Mon, Nov 02, 2026 at 11:51:32AM +0000, Andrew Cooper wrote:
> On 30/10/2026 1:24 pm, Roger Pau Monne wrote:
> > On CPU bringup don't assume that TSC_AUX is 0, write 0 to it to ensure the
> > per-CPU cached state matches the hardware.  Also propagate the cached value
> > on resume from suspend, in case the register value has been reset during
> > suspension.
> >
> > Fixes: cc0e45db2779 ("x86/pv: Avoid leaking other guests' MSR_TSC_AUX values into PV context")
> > Signed-off-by: Roger Pau Monné <roger@xenproject.org>
> > ---
> >  xen/arch/x86/acpi/power.c | 3 +++
> >  xen/arch/x86/cpu/common.c | 5 +++++
> >  2 files changed, 8 insertions(+)
> >
> > diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c
> > index 3452650a61d5..464846e73727 100644
> > --- a/xen/arch/x86/acpi/power.c
> > +++ b/xen/arch/x86/acpi/power.c
> > @@ -279,6 +279,9 @@ static int enter_state(u32 state)
> >          ci->last_spec_ctrl = default_xen_spec_ctrl;
> >      }
> >  
> > +    if ( cpu_has_msr_tsc_aux )
> > +        wrmsrns(MSR_TSC_AUX, this_cpu(tsc_aux));
> > +
> 
> This wants to be later, with percpu_traps_init().   It is not critical
> state to restore this early.

I've adjust it.

Thanks, Roger.


  reply	other threads:[~2026-11-02 13:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-30 13:24 [PATCH 0/2] x86/cpu: TSC handling adjustments Roger Pau Monne
2026-10-30 13:24 ` [PATCH 1/2] x86/cpu: keep cached TSC_AUX state coherent with hardware Roger Pau Monne
2026-11-02  9:42   ` Teddy Astie
2026-11-02 11:51   ` Andrew Cooper
2026-11-02 13:59     ` Roger Pau Monné [this message]
2026-10-30 13:24 ` [PATCH 2/2] x86/hvm: sync APs TSC with the BSP at creation only Roger Pau Monne
2026-11-02  7:40   ` chunjie.zhu
2026-11-02  8:34     ` Roger Pau Monné
2026-11-02 10:03       ` chunjie.zhu
2026-11-02  9:35   ` Teddy Astie
2026-11-02 13:44   ` Andrew Cooper
2026-11-02 14:08     ` Roger Pau Monné

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=auiXSv0I3mU8NjpV@Mac.lan \
    --to=roger@xenproject.org \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=teddy.astie@vates.tech \
    --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.