WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] x86 hvm: Change default setting of guest

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86 hvm: Change default setting of guest CPUID RDTSCP bit
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 13 Jan 2010 00:40:33 -0800
Delivery-date: Wed, 13 Jan 2010 00:40:51 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1263371614 0
# Node ID 13d4e78ede977ee92c4a4adf78a92b31ec52c00e
# Parent  6512068aa0db7747df4f180b03d269afb7da5bb0
x86 hvm: Change default setting of guest CPUID RDTSCP bit

Expose RDTSCP CPUID to guest only when tsc_mode == TSC_MODE_DEFAULT
and host_tsc_is_safe() returns 1.

Signed-off-by: Dongxiao Xu <dongxiao.xu@xxxxxxxxx>
---
 xen/arch/x86/hvm/hvm.c     |    6 ++++--
 xen/arch/x86/time.c        |    2 +-
 xen/include/asm-x86/time.h |    1 +
 3 files changed, 6 insertions(+), 3 deletions(-)

diff -r 6512068aa0db -r 13d4e78ede97 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c    Wed Jan 13 08:18:38 2010 +0000
+++ b/xen/arch/x86/hvm/hvm.c    Wed Jan 13 08:33:34 2010 +0000
@@ -1955,8 +1955,10 @@ void hvm_cpuid(unsigned int input, unsig
         }
         break;
     case 0x80000001:
-        /* Don't expose RDTSCP feature when in PVRDTSCP mode. */
-        if ( v->domain->arch.tsc_mode == TSC_MODE_PVRDTSCP )
+        /* We expose RDTSCP feature to guest only when
+           tsc_mode == TSC_MODE_DEFAULT and host_tsc_is_safe() returns 1 */
+        if ( v->domain->arch.tsc_mode != TSC_MODE_DEFAULT ||
+             !host_tsc_is_safe() )
             *edx &= ~bitmaskof(X86_FEATURE_RDTSCP);
         break;
     }
diff -r 6512068aa0db -r 13d4e78ede97 xen/arch/x86/time.c
--- a/xen/arch/x86/time.c       Wed Jan 13 08:18:38 2010 +0000
+++ b/xen/arch/x86/time.c       Wed Jan 13 08:33:34 2010 +0000
@@ -1628,7 +1628,7 @@ void pv_soft_rdtsc(struct vcpu *v, struc
              (d->arch.tsc_mode == TSC_MODE_PVRDTSCP) ? d->arch.incarnation : 0;
 }
 
-static int host_tsc_is_safe(void)
+int host_tsc_is_safe(void)
 {
     if ( boot_cpu_has(X86_FEATURE_TSC_RELIABLE) )
         return 1;
diff -r 6512068aa0db -r 13d4e78ede97 xen/include/asm-x86/time.h
--- a/xen/include/asm-x86/time.h        Wed Jan 13 08:18:38 2010 +0000
+++ b/xen/include/asm-x86/time.h        Wed Jan 13 08:33:34 2010 +0000
@@ -70,6 +70,7 @@ void tsc_get_info(struct domain *d, uint
 
 void force_update_vcpu_system_time(struct vcpu *v);
 
+int host_tsc_is_safe(void);
 void cpuid_time_leaf(uint32_t sub_idx, unsigned int *eax, unsigned int *ebx,
                       unsigned int *ecx, unsigned int *edx);
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] x86 hvm: Change default setting of guest CPUID RDTSCP bit, Xen patchbot-unstable <=