summaryrefslogtreecommitdiffstats
path: root/sys/amd64/vmm
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2015-02-09 21:00:56 +0000
committerkib <kib@FreeBSD.org>2015-02-09 21:00:56 +0000
commit0754f0eac9d97737274d7b77cb519abb250362b3 (patch)
treed2e88c87f150ce7e0dfe34e37fbc902c5f84fd8a /sys/amd64/vmm
parente83a0077986ede1b5481738b285a4612ca8636e1 (diff)
downloadFreeBSD-src-0754f0eac9d97737274d7b77cb519abb250362b3.zip
FreeBSD-src-0754f0eac9d97737274d7b77cb519abb250362b3.tar.gz
Add x2APIC support. Enable it by default if CPU is capable. The
hw.x2apic_enable tunable allows disabling it from the loader prompt. To closely repeat effects of the uncached memory ops when accessing registers in the xAPIC mode, the x2APIC writes to MSRs are preceeded by mfence, except for the EOI notifications. This is probably too strict, only ICR writes to send IPI require serialization to ensure that other CPUs see the previous actions when IPI is delivered. This may be changed later. In vmm justreturn IPI handler, call doreti_iret instead of doing iretd inline, to handle corner conditions. Note that the patch only switches LAPICs into x2APIC mode. It does not enables FreeBSD to support > 255 CPUs, which requires parsing x2APIC MADT entries and doing interrupts remapping, but is the required step on the way. Reviewed by: neel Tested by: pho (real hardware), neel (on bhyve) Discussed with: jhb, grehan Sponsored by: The FreeBSD Foundation MFC after: 2 months
Diffstat (limited to 'sys/amd64/vmm')
-rw-r--r--sys/amd64/vmm/vmm_support.S11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/amd64/vmm/vmm_support.S b/sys/amd64/vmm/vmm_support.S
index 2afc608..7919511 100644
--- a/sys/amd64/vmm/vmm_support.S
+++ b/sys/amd64/vmm/vmm_support.S
@@ -30,13 +30,14 @@
#include <machine/asmacros.h>
-#define LA_EOI 0xB0
-
.text
SUPERALIGN_TEXT
IDTVEC(justreturn)
+ pushq %rdx
pushq %rax
- movq lapic, %rax
- movl $0, LA_EOI(%rax)
+ pushq %rcx
+ call as_lapic_eoi
+ popq %rcx
popq %rax
- iretq
+ popq %rdx
+ jmp doreti_iret
OpenPOWER on IntegriCloud