summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorneel <neel@FreeBSD.org>2013-01-06 05:37:26 +0000
committerneel <neel@FreeBSD.org>2013-01-06 05:37:26 +0000
commitd184bb1077cf7d96f98f7b5b1fb24951ff6a80e7 (patch)
tree6896ed7fdd35b83340105a22522d3839c1a83bcf /sys/amd64
parenteda0d7f2563ff44f103201dbb5a841351f0c024a (diff)
downloadFreeBSD-src-d184bb1077cf7d96f98f7b5b1fb24951ff6a80e7.zip
FreeBSD-src-d184bb1077cf7d96f98f7b5b1fb24951ff6a80e7.tar.gz
Revert changes for x2apic support from projects/bhyve.
During the early days of bhyve it did not support instruction emulation which necessitated the use of x2apic to access the local apic. This is no longer the case and the dependency on x2apic has gone away. The x2apic patches can be considered independently of bhyve and will be merged into head via projects/x2apic. Discussed with: grehan
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/apic_vector.S55
-rw-r--r--sys/amd64/amd64/mp_machdep.c2
-rw-r--r--sys/amd64/include/apicvar.h1
3 files changed, 18 insertions, 40 deletions
diff --git a/sys/amd64/amd64/apic_vector.S b/sys/amd64/amd64/apic_vector.S
index 8004153..6465247 100644
--- a/sys/amd64/amd64/apic_vector.S
+++ b/sys/amd64/amd64/apic_vector.S
@@ -57,15 +57,8 @@ IDTVEC(vec_name) ; \
PUSH_FRAME ; \
FAKE_MCOUNT(TF_RIP(%rsp)) ; \
movq lapic, %rdx ; /* pointer to local APIC */ \
- testq %rdx, %rdx; \
- jnz 3f; \
- movl $MSR_APIC_ISR ## index, %ecx; \
- rdmsr; \
- jmp 4f; \
-3: ; \
movl LA_ISR + 16 * (index)(%rdx), %eax ; /* load ISR */ \
-4: ; \
- bsrl %eax, %eax ; /* index of highset set bit in ISR */ \
+ bsrl %eax, %eax ; /* index of highest set bit in ISR */ \
jz 1f ; \
addl $(32 * index),%eax ; \
movq %rsp, %rsi ; \
@@ -136,26 +129,6 @@ IDTVEC(errorint)
jmp doreti
#ifdef SMP
-
-/*
- * We assume that %rax is being saved/restored outside of this macro
- */
-#define DO_EOI \
- movq lapic, %rax; \
- testq %rax, %rax; \
- jz 8f; \
- movl $0, LA_EOI(%rax); \
- jmp 9f; \
-8:; \
- pushq %rcx; \
- pushq %rdx; \
- xorl %edx, %edx; /* eax is already zero */ \
- movl $MSR_APIC_EOI, %ecx; \
- wrmsr; \
- popq %rdx; \
- popq %rcx; \
-9:
-
/*
* Global address space TLB shootdown.
*/
@@ -180,7 +153,8 @@ IDTVEC(invltlb)
movq %cr3, %rax /* invalidate the TLB */
movq %rax, %cr3
- DO_EOI
+ movq lapic, %rax
+ movl $0, LA_EOI(%rax) /* End Of Interrupt to APIC */
lock
incl smp_tlb_wait
@@ -212,7 +186,8 @@ IDTVEC(invlpg)
movq smp_tlb_addr1, %rax
invlpg (%rax) /* invalidate single page */
- DO_EOI
+ movq lapic, %rax
+ movl $0, LA_EOI(%rax) /* End Of Interrupt to APIC */
lock
incl smp_tlb_wait
@@ -249,7 +224,8 @@ IDTVEC(invlrng)
cmpq %rax, %rdx
jb 1b
- DO_EOI
+ movq lapic, %rax
+ movl $0, LA_EOI(%rax) /* End Of Interrupt to APIC */
lock
incl smp_tlb_wait
@@ -276,7 +252,8 @@ IDTVEC(invlcache)
wbinvd
- DO_EOI
+ movq lapic, %rax
+ movl $0, LA_EOI(%rax) /* End Of Interrupt to APIC */
lock
incl smp_tlb_wait
@@ -292,8 +269,9 @@ IDTVEC(invlcache)
IDTVEC(ipi_intr_bitmap_handler)
PUSH_FRAME
- DO_EOI
-
+ movq lapic, %rdx
+ movl $0, LA_EOI(%rdx) /* End Of Interrupt to APIC */
+
FAKE_MCOUNT(TF_RIP(%rsp))
call ipi_bitmap_handler
@@ -308,7 +286,8 @@ IDTVEC(ipi_intr_bitmap_handler)
IDTVEC(cpustop)
PUSH_FRAME
- DO_EOI
+ movq lapic, %rax
+ movl $0, LA_EOI(%rax) /* End Of Interrupt to APIC */
call cpustop_handler
jmp doreti
@@ -322,7 +301,8 @@ IDTVEC(cpususpend)
PUSH_FRAME
call cpususpend_handler
- DO_EOI
+ movq lapic, %rax
+ movl $0, LA_EOI(%rax) /* End Of Interrupt to APIC */
jmp doreti
/*
@@ -340,6 +320,7 @@ IDTVEC(rendezvous)
incq (%rax)
#endif
call smp_rendezvous_action
- DO_EOI
+ movq lapic, %rax
+ movl $0, LA_EOI(%rax) /* End Of Interrupt to APIC */
jmp doreti
#endif /* SMP */
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c
index 33e0814..d2e4aad 100644
--- a/sys/amd64/amd64/mp_machdep.c
+++ b/sys/amd64/amd64/mp_machdep.c
@@ -688,8 +688,6 @@ init_secondary(void)
wrmsr(MSR_STAR, msr);
wrmsr(MSR_SF_MASK, PSL_NT|PSL_T|PSL_I|PSL_C|PSL_D);
- lapic_init_ap();
-
/* Disable local APIC just to be sure. */
lapic_disable();
diff --git a/sys/amd64/include/apicvar.h b/sys/amd64/include/apicvar.h
index dee5900..ae2f5b9 100644
--- a/sys/amd64/include/apicvar.h
+++ b/sys/amd64/include/apicvar.h
@@ -209,7 +209,6 @@ int lapic_enable_pmc(void);
void lapic_eoi(void);
int lapic_id(void);
void lapic_init(vm_paddr_t addr);
-void lapic_init_ap(void);
int lapic_intr_pending(u_int vector);
void lapic_ipi_raw(register_t icrlo, u_int dest);
void lapic_ipi_vectored(u_int vector, int dest);
OpenPOWER on IntegriCloud