0e9e131edf
25242-x86_64-hotplug-compat-m2p.patch 25247-SVM-no-rdtsc-intercept.patch 25267-x86-text-unlikely.patch 25269-x86-vMCE-addr-misc-write.patch 25271-x86_64-IST-index.patch 25327-pvdrv-no-asm-system-h.patch - Upstream patches from Jan 25168-x86-memset-size.patch 25191-x86-tdt-delta-calculation.patch 25195-x86-cpuidle-C2-no-flush-or-bm-check.patch 25196-x86-HAP-PAT-sr.patch 25200-x86_64-trap-bounce-flags.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=189
40 lines
1.4 KiB
Diff
40 lines
1.4 KiB
Diff
# HG changeset patch
|
|
# User Boris Ostrovsky <boris.ostrovsky@amd.com>
|
|
# Date 1335358394 -3600
|
|
# Node ID ed9c557f8a35a6deb7e6df0679f24a2121fd1172
|
|
# Parent 7ba11d9b1d23633b5c42fadddad17b6dcb686141
|
|
svm: Do not intercept RDTSC(P) when TSC scaling is supported by hardware
|
|
|
|
When running in TSC_MODE_ALWAYS_EMULATE mode on processors that
|
|
support TSC scaling we don't need to intercept RDTSC/RDTSCP
|
|
instructions.
|
|
|
|
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com>
|
|
Acked-by: Wei Huang <wei.huang2@amd.com>
|
|
Tested-by: Wei Huang <wei.huang2@amd.com>
|
|
Committed-by: Keir Fraser <keir@xen.org>
|
|
|
|
--- a/xen/arch/x86/hvm/svm/svm.c
|
|
+++ b/xen/arch/x86/hvm/svm/svm.c
|
|
@@ -633,12 +633,19 @@ static void svm_set_rdtsc_exiting(struct
|
|
{
|
|
struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
|
|
u32 general1_intercepts = vmcb_get_general1_intercepts(vmcb);
|
|
+ u32 general2_intercepts = vmcb_get_general2_intercepts(vmcb);
|
|
|
|
general1_intercepts &= ~GENERAL1_INTERCEPT_RDTSC;
|
|
- if ( enable )
|
|
+ general2_intercepts &= ~GENERAL2_INTERCEPT_RDTSCP;
|
|
+
|
|
+ if ( enable && !cpu_has_tsc_ratio )
|
|
+ {
|
|
general1_intercepts |= GENERAL1_INTERCEPT_RDTSC;
|
|
+ general2_intercepts |= GENERAL2_INTERCEPT_RDTSCP;
|
|
+ }
|
|
|
|
vmcb_set_general1_intercepts(vmcb, general1_intercepts);
|
|
+ vmcb_set_general2_intercepts(vmcb, general2_intercepts);
|
|
}
|
|
|
|
static unsigned int svm_get_insn_bytes(struct vcpu *v, uint8_t *buf)
|