summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2007-07-29 20:15:56 +0000
committerkettenis <kettenis@openbsd.org>2007-07-29 20:15:56 +0000
commit03794a4ca2b7dbfd84f80b45ccd69e4fa5dfc280 (patch)
tree6b9a8f9113f340d9164fe7da09b779d46d557023
parentsync the command usage with its synopsis (diff)
downloadwireguard-openbsd-03794a4ca2b7dbfd84f80b45ccd69e4fa5dfc280.tar.xz
wireguard-openbsd-03794a4ca2b7dbfd84f80b45ccd69e4fa5dfc280.zip
Seperate members of "struct pcb" that are accessed using physical addresses
from thos that are exclusively accessed using virtual addresses and add padding between them to make sure they don't share a cache line. Fixes random crashes on at least PA-8700 and PA-7200 based machines. Without this, the PA-7200 based C110 wouldn't stay up long enough to do an install. ok miod@
-rw-r--r--sys/arch/hppa/include/pcb.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/sys/arch/hppa/include/pcb.h b/sys/arch/hppa/include/pcb.h
index 612c4231586..68d7a0ba384 100644
--- a/sys/arch/hppa/include/pcb.h
+++ b/sys/arch/hppa/include/pcb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcb.h,v 1.10 2005/03/26 20:04:37 mickey Exp $ */
+/* $OpenBSD: pcb.h,v 1.11 2007/07/29 20:15:56 kettenis Exp $ */
/*
* Copyright (c) 1999-2004 Michael Shalayeff
@@ -34,10 +34,22 @@
struct pcb {
u_int64_t pcb_fpregs[HPPA_NFPREGS+1]; /* not in the trapframe */
- u_int pcb_onfault; /* SW copy fault handler */
- pa_space_t pcb_space; /* copy pmap_space, for asm's sake */
vaddr_t pcb_uva; /* KVA for U-area */
+
+ /*
+ * The members above are primarily accessed by there physical
+ * address, wheras the members below are accessed exclusively
+ * by there virtual address. Unfortunately this structure
+ * ends up being non-equivalently mapped, which will cause
+ * data corruption if those members share a cache line. Since
+ * the maximum cache line size is 64 bytes, adding 64 bytes of
+ * padding makes sure that will never happen.
+ */
+ u_char pcb_pad[64];
+
u_int pcb_ksp; /* kernel sp for ctxsw */
+ u_int pcb_onfault; /* SW copy fault handler */
+ pa_space_t pcb_space; /* copy pmap_space, for asm's sake */
/* things used for hpux emulation */
void *pcb_sigreturn;