aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/hpet.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2011-07-19 14:10:53 +0100
committerJan Beulich <jbeulich@novell.com>2011-07-19 14:10:53 +0100
commit876895c30294a8caead2386dcb7d17af88ed7cfd (patch)
tree4b6d42f576de3c67bdecb94276f718387badb0de /xen/arch/x86/hpet.c
parente4c3755d4dd746511a87b9f7da7199fcd3ee0333 (diff)
downloadxen-876895c30294a8caead2386dcb7d17af88ed7cfd.tar.gz
xen-876895c30294a8caead2386dcb7d17af88ed7cfd.tar.bz2
xen-876895c30294a8caead2386dcb7d17af88ed7cfd.zip
x86: consistently serialize CMOS/RTC accesses on rtc_lock
Since RTC/CMOS accesses aren't atomic, there are possible races between code paths setting the index register and subsequently reading/writing the data register. This is supposed to be dealt with by acquiring rtc_lock, but two places up to now lacked respective synchronization: Accesses to the EFI time functions and smpboot_{setup,restore}_warm_reset_vector(). This in turn requires no longer directly passing through guest writes to the index register, but instead using a machanism similar to that for PCI config space method 1 accesses. Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'xen/arch/x86/hpet.c')
-rw-r--r--xen/arch/x86/hpet.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 2f8c957d75..f3a298fefc 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -502,18 +502,10 @@ static void hpet_detach_channel(unsigned int cpu,
#include <asm/mc146818rtc.h>
-void (*__read_mostly pv_rtc_handler)(unsigned int port, uint8_t value);
+void (*__read_mostly pv_rtc_handler)(uint8_t index, uint8_t value);
-static void handle_rtc_once(unsigned int port, uint8_t value)
+static void handle_rtc_once(uint8_t index, uint8_t value)
{
- static int index;
-
- if ( port == 0x70 )
- {
- index = value;
- return;
- }
-
if ( index != RTC_REG_B )
return;