From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
Xen-devel <xen-devel@lists.xen.org>
Cc: "Kevin Tian" <kevin.tian@intel.com>,
"Wei Liu" <wei.liu2@citrix.com>,
"Jun Nakajima" <jun.nakajima@intel.com>,
"Jan Beulich" <JBeulich@suse.com>,
"Suravee Suthikulpanit" <suravee.suthikulpanit@amd.com>,
"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH 2/5] x86/pv: Avoid leaking other guests' MSR_TSC_AUX values into PV context
Date: Mon, 26 Feb 2018 14:52:08 -0500 [thread overview]
Message-ID: <1bb81ac5-7ec2-c71f-0922-aa3f04204d9d@oracle.com> (raw)
In-Reply-To: <1519127923-23539-3-git-send-email-andrew.cooper3@citrix.com>
On 02/20/2018 06:58 AM, Andrew Cooper wrote:
> If the CPU pipeline supports RDTSCP or RDPID, a guest can observe the value in
> MSR_TSC_AUX, irrespective of whether the relevant CPUID features are
> advertised/hidden.
>
> At the moment, paravirt_ctxt_switch_to() only writes to MSR_TSC_AUX if
> TSC_MODE_PVRDTSCP mode is enabled, but this is not the default mode.
> Therefore, default PV guests can read the value from a previously scheduled
> HVM vcpu, or TSC_MODE_PVRDTSCP-enabled PV guest.
>
> Alter the PV path to always write to MSR_TSC_AUX, using 0 in the common case.
>
> To amortise overhead cost, introduce wrmsr_tsc_aux() which performs a lazy
> update of the MSR, and use this function consistently across the codebase.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Jun Nakajima <jun.nakajima@intel.com>
> CC: Kevin Tian <kevin.tian@intel.com>
> CC: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> CC: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> CC: Wei Liu <wei.liu2@citrix.com>
> CC: Roger Pau Monné <roger.pau@citrix.com>
> CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
(Apologies for the delay. I am quite behind with my emails)
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2018-02-26 19:52 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-20 11:58 [RFC PATCH 0/5] x86: Multiple fixes to MSR_TSC_AUX and RDTSCP handling for guests Andrew Cooper
2018-02-20 11:58 ` [PATCH 1/5] x86/hvm: Don't shadow the domain parameter in hvm_save_cpu_msrs() Andrew Cooper
2018-02-20 14:54 ` Roger Pau Monné
2018-02-20 15:12 ` Wei Liu
2018-02-23 13:53 ` Jan Beulich
2018-02-20 11:58 ` [PATCH 2/5] x86/pv: Avoid leaking other guests' MSR_TSC_AUX values into PV context Andrew Cooper
2018-02-20 15:22 ` Wei Liu
2018-02-20 15:26 ` Andrew Cooper
2018-02-20 15:32 ` Wei Liu
2018-02-20 15:49 ` Roger Pau Monné
2018-02-23 14:04 ` Jan Beulich
2018-02-23 14:22 ` Andrew Cooper
2018-02-23 15:09 ` Jan Beulich
2018-02-26 11:25 ` Jan Beulich
2018-02-26 19:11 ` [ping] " Andrew Cooper
2018-02-27 5:38 ` Tian, Kevin
2018-02-26 19:52 ` Boris Ostrovsky [this message]
2018-02-20 11:58 ` [PATCH 3/5] x86/time: Rework pv_soft_rdtsc() to aid further cleanup Andrew Cooper
2018-02-20 15:32 ` Wei Liu
2018-02-20 16:04 ` Roger Pau Monné
2018-02-20 16:07 ` Andrew Cooper
2018-02-23 14:38 ` Jan Beulich
2018-02-20 11:58 ` [PATCH 4/5] x86/pv: Remove deferred RDTSC{, P} handling in pv_emulate_privileged_op() Andrew Cooper
2018-02-20 16:08 ` Wei Liu
2018-02-20 16:28 ` Roger Pau Monné
2018-02-20 16:37 ` Andrew Cooper
2018-02-20 17:40 ` Roger Pau Monné
2018-02-23 14:40 ` Jan Beulich
2018-02-20 11:58 ` [PATCH 5/5] x86: Rework MSR_TSC_AUX handling from scratch Andrew Cooper
2018-02-20 17:03 ` Wei Liu
2018-02-20 17:42 ` Andrew Cooper
2018-02-21 11:08 ` Wei Liu
2018-02-20 17:35 ` Roger Pau Monné
2018-02-20 18:28 ` Andrew Cooper
2018-02-21 10:13 ` Roger Pau Monné
2018-02-21 11:36 ` [PATCH v2 " Andrew Cooper
2018-02-21 12:06 ` Wei Liu
2018-02-21 13:04 ` Roger Pau Monné
2018-02-23 15:05 ` Jan Beulich
2018-02-23 15:51 ` Andrew Cooper
2018-02-26 11:30 ` Jan Beulich
2018-02-26 19:12 ` [RFC PATCH 0/5] x86: Multiple fixes to MSR_TSC_AUX and RDTSCP handling for guests Andrew Cooper
2018-02-26 19:44 ` Boris Ostrovsky
2018-02-26 23:30 ` Andrew Cooper
2018-03-09 18:05 ` Boris Ostrovsky
2018-03-09 18:41 ` Andrew Cooper
2018-03-09 19:10 ` Boris Ostrovsky
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=1bb81ac5-7ec2-c71f-0922-aa3f04204d9d@oracle.com \
--to=boris.ostrovsky@oracle.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=jun.nakajima@intel.com \
--cc=kevin.tian@intel.com \
--cc=roger.pau@citrix.com \
--cc=suravee.suthikulpanit@amd.com \
--cc=wei.liu2@citrix.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 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).