From 0bc686305b36ccd81078acb082892858ee92e8fd Mon Sep 17 00:00:00 2001 From: marcel Date: Sat, 13 Aug 2005 21:08:32 +0000 Subject: Fix the problem with the IPI for the lazy context switching of the high FP registers. It was not that the IPI got lost due to the perceived unreliability of the IPI delivery, but rather that the IPI was not assigned a vector (ugh). Sending a 0 vector to a CPU results in a stray external interrupt. Add a KASSERT to ipi_send() to catch this. The initialization of the IPIs could be better, but it's not at all sure what the future of the code is. Avoid wasting a lot of time on something that is going to be rewritten anyway. --- sys/ia64/ia64/mp_machdep.c | 1 + sys/ia64/ia64/sal.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/ia64/ia64/mp_machdep.c b/sys/ia64/ia64/mp_machdep.c index 59a4b7d..a045ff5 100644 --- a/sys/ia64/ia64/mp_machdep.c +++ b/sys/ia64/ia64/mp_machdep.c @@ -372,6 +372,7 @@ ipi_send(struct pcpu *cpu, int ipi) pipi = __MEMIO_ADDR(ia64_lapic_address | ((cpu->pc_lid & LID_SAPIC_MASK) >> 12)); vector = (uint64_t)(ipi_vector[ipi] & 0xff); + KASSERT(vector != 0, ("IPI %d is not assigned a vector", ipi)); *pipi = vector; CTR3(KTR_SMP, "ipi_send(%p, %ld), cpuid=%d", pipi, vector, PCPU_GET(cpuid)); diff --git a/sys/ia64/ia64/sal.c b/sys/ia64/ia64/sal.c index c05f7be..251c1ee 100644 --- a/sys/ia64/ia64/sal.c +++ b/sys/ia64/ia64/sal.c @@ -72,13 +72,15 @@ setup_ipi_vectors(int ceil) int ipi; ipi_vector[IPI_MCA_RENDEZ] = ceil - 0x10; - ipi_vector[IPI_MCA_CMCV] = ceil - 0x30; - ipi_vector[IPI_TEST] = ceil - 0x30 + 1; ipi = IPI_AST; /* First generic IPI. */ ceil -= 0x20; /* First vector in group. */ while (ipi < IPI_COUNT) ipi_vector[ipi++] = ceil++; + + ipi_vector[IPI_HIGH_FP] = ceil - 0x30; + ipi_vector[IPI_MCA_CMCV] = ceil - 0x30 + 1; + ipi_vector[IPI_TEST] = ceil - 0x30 + 2; } void -- cgit v1.1