aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/hvm/vpt.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-05-30 19:31:18 +0100
committerKeir Fraser <keir.fraser@citrix.com>2008-05-30 19:31:18 +0100
commit5024576315ef4c1629510efe73ef777ef0868ec7 (patch)
treefd614f2a83ca1b18b8d61467bca99a3d08e9a8a2 /xen/arch/x86/hvm/vpt.c
parent8d4e5d626a533220ecf66b6fe88e2179a42d6b48 (diff)
downloadxen-5024576315ef4c1629510efe73ef777ef0868ec7.tar.gz
xen-5024576315ef4c1629510efe73ef777ef0868ec7.tar.bz2
xen-5024576315ef4c1629510efe73ef777ef0868ec7.zip
x86: i8254 device model is shared between PV and HVM guests, so must
take care not to run hvm_get_guest_time() on a PV VCPU. The spinlock is not initialised and spin_lock() can thus spin forever. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'xen/arch/x86/hvm/vpt.c')
-rw-r--r--xen/arch/x86/hvm/vpt.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c
index cb62e5e083..1b4b4f5840 100644
--- a/xen/arch/x86/hvm/vpt.c
+++ b/xen/arch/x86/hvm/vpt.c
@@ -39,6 +39,9 @@ u64 hvm_get_guest_time(struct vcpu *v)
struct pl_time *pl = &v->domain->arch.hvm_domain.pl_time;
u64 now;
+ /* Called from device models shared with PV guests. Be careful. */
+ ASSERT(is_hvm_vcpu(v));
+
spin_lock(&pl->pl_time_lock);
now = get_s_time() + pl->stime_offset;
if ( (int64_t)(now - pl->last_guest_time) >= 0 )