diff mbox

[QEMU-KVM,26/34] test: Use xapic_write() to enable xapic()

Message ID 1253093169-1423-27-git-send-email-avi@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Avi Kivity Sept. 16, 2009, 9:26 a.m. UTC
apic_write() depends on apic_ops, which is shared among cpus and
can be modified if another cpu enabled x2apic.  Use xapic_write()
which is race-proof.

Signed-off-by: Avi Kivity <avi@redhat.com>
---
 kvm/user/test/lib/x86/apic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/kvm/user/test/lib/x86/apic.c b/kvm/user/test/lib/x86/apic.c
index 16e51bc..1fc3888 100644
--- a/kvm/user/test/lib/x86/apic.c
+++ b/kvm/user/test/lib/x86/apic.c
@@ -139,7 +139,7 @@  void ioapic_write_redir(unsigned line, ioapic_redir_entry_t e)
 void enable_apic(void)
 {
     printf("enabling apic\n");
-    apic_write(0xf0, 0x1ff); /* spurious vector register */
+    xapic_write(0xf0, 0x1ff); /* spurious vector register */
 }
 
 void mask_pic_interrupts(void)