aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/asm-x86/hvm
diff options
context:
space:
mode:
authorKeir Fraser <keir@xensource.com>2007-06-15 15:30:49 +0100
committerKeir Fraser <keir@xensource.com>2007-06-15 15:30:49 +0100
commit34bef0e6d5f4db553c68bd482e5e0f9487dea300 (patch)
tree174d695b5c7d40e3bebb9a567aa7b301c91a5ebe /xen/include/asm-x86/hvm
parentb010d6c68edcd9a057310240a97de6186db12437 (diff)
downloadxen-34bef0e6d5f4db553c68bd482e5e0f9487dea300.tar.gz
xen-34bef0e6d5f4db553c68bd482e5e0f9487dea300.tar.bz2
xen-34bef0e6d5f4db553c68bd482e5e0f9487dea300.zip
hvm: Add locking to platform timers.
Handy for correctness. Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/include/asm-x86/hvm')
-rw-r--r--xen/include/asm-x86/hvm/vcpu.h3
-rw-r--r--xen/include/asm-x86/hvm/vpt.h6
2 files changed, 7 insertions, 2 deletions
diff --git a/xen/include/asm-x86/hvm/vcpu.h b/xen/include/asm-x86/hvm/vcpu.h
index 75aae07b1c..b0a6956120 100644
--- a/xen/include/asm-x86/hvm/vcpu.h
+++ b/xen/include/asm-x86/hvm/vcpu.h
@@ -35,6 +35,9 @@ struct hvm_vcpu {
struct vlapic vlapic;
s64 cache_tsc_offset;
u64 guest_time;
+
+ /* Lock and list for virtual platform timers. */
+ spinlock_t tm_lock;
struct list_head tm_list;
/* For AP startup */
diff --git a/xen/include/asm-x86/hvm/vpt.h b/xen/include/asm-x86/hvm/vpt.h
index e89e1d3c4b..acd245a93d 100644
--- a/xen/include/asm-x86/hvm/vpt.h
+++ b/xen/include/asm-x86/hvm/vpt.h
@@ -31,7 +31,6 @@
#include <asm/hvm/vpic.h>
#include <public/hvm/save.h>
-
struct HPETState;
struct HPET_timer_fn_info {
struct HPETState *hs;
@@ -45,6 +44,7 @@ typedef struct HPETState {
uint64_t mc_offset;
struct timer timers[HPET_TIMER_NUM];
struct HPET_timer_fn_info timer_fn_info[HPET_TIMER_NUM];
+ spinlock_t lock;
} HPETState;
@@ -80,6 +80,7 @@ typedef struct PITState {
int64_t count_load_time[3];
/* irq handling */
struct periodic_time pt[3];
+ spinlock_t lock;
} PITState;
typedef struct RTCState {
@@ -93,6 +94,7 @@ typedef struct RTCState {
struct timer second_timer2;
struct periodic_time pt;
int32_t time_offset_seconds;
+ spinlock_t lock;
} RTCState;
#define FREQUENCE_PMTIMER 3579545 /* Timer should run at 3.579545 MHz */
@@ -102,6 +104,7 @@ typedef struct PMTState {
uint64_t last_gtime; /* Last (guest) time we updated the timer */
uint64_t scale; /* Multiplier to get from tsc to timer ticks */
struct timer timer; /* To make sure we send SCIs */
+ spinlock_t lock;
} PMTState;
struct pl_time { /* platform time */
@@ -116,7 +119,6 @@ struct pl_time { /* platform time */
void pt_freeze_time(struct vcpu *v);
void pt_thaw_time(struct vcpu *v);
void pt_update_irq(struct vcpu *v);
-struct periodic_time *is_pt_irq(struct vcpu *v, int vector, int type);
void pt_intr_post(struct vcpu *v, int vector, int type);
void pt_reset(struct vcpu *v);
void pt_migrate(struct vcpu *v);