mirror of
https://github.com/opnsense/src.git
synced 2026-06-10 17:22:46 -04:00
Temporary band-aid to fix hang when a process exec's Altivec instructions.
trap_subr.S: declare a stub for the a-unavailable trap
that does an absolute jump to the vector-assist trap.
This is due to the fact that the vec-unavail trap
doesn't start at a 256-byte boundary, so the trick of
masking the bottom 8 bits of the link register to identify
the interrupt doesn't work, so let the vec-assist
case handle Altivec-disabled for the time being.
Note that this will be fixed in the future with a much
smaller vector code-stub (< 16 bytes) that will allow
use of strange vector offsets that are also present in
4xx processors, and also allow smaller differences in
vector codepaths on the G5.
trap.c: Treat altivec-unavailable/assist process traps as SIGILL.
Not quite correct, since altivec-assist should really be a panic,
but it is fine for the moment due to the above measure.
machdep.c Install the stub code for the altivec-unavailable trap, and
the standard trap code at the altivec-assist.
Reported by: Andreas Tobler <toa at pop agri ch>
MFC after: 3 days
This commit is contained in:
parent
3419317c32
commit
ebc2aa7496
6 changed files with 32 additions and 0 deletions
|
|
@ -247,6 +247,7 @@ extern void *dsitrap, *dsisize;
|
|||
extern void *decrint, *decrsize;
|
||||
extern void *extint, *extsize;
|
||||
extern void *dblow, *dbsize;
|
||||
extern void *vectrap, *vectrapsize;
|
||||
|
||||
void
|
||||
powerpc_init(u_int startkernel, u_int endkernel, u_int basekernel, void *mdp)
|
||||
|
|
@ -335,6 +336,8 @@ powerpc_init(u_int startkernel, u_int endkernel, u_int basekernel, void *mdp)
|
|||
bcopy(&trapcode, (void *)EXC_SC, (size_t)&trapsize);
|
||||
bcopy(&trapcode, (void *)EXC_TRC, (size_t)&trapsize);
|
||||
bcopy(&trapcode, (void *)EXC_FPA, (size_t)&trapsize);
|
||||
bcopy(&vectrap, (void *)EXC_VEC, (size_t)&vectrapsize);
|
||||
bcopy(&trapcode, (void *)EXC_VECAST, (size_t)&trapsize);
|
||||
bcopy(&trapcode, (void *)EXC_THRM, (size_t)&trapsize);
|
||||
bcopy(&trapcode, (void *)EXC_BPT, (size_t)&trapsize);
|
||||
#ifdef KDB
|
||||
|
|
|
|||
|
|
@ -199,6 +199,11 @@ trap(struct trapframe *frame)
|
|||
enable_vec(td);
|
||||
frame->srr1 |= PSL_VEC;
|
||||
break;
|
||||
#else
|
||||
case EXC_VEC:
|
||||
case EXC_VECAST:
|
||||
sig = SIGILL;
|
||||
break;
|
||||
#endif /* ALTIVEC */
|
||||
|
||||
case EXC_ALI:
|
||||
|
|
|
|||
|
|
@ -443,6 +443,14 @@ CNAME(trapexit):
|
|||
FRAME_LEAVE(PC_TEMPSAVE)
|
||||
rfi
|
||||
|
||||
/*
|
||||
* Temporary: vector-unavailable traps are directed to vector-assist traps
|
||||
*/
|
||||
.globl CNAME(vectrap),CNAME(vectrapsize)
|
||||
CNAME(vectrap):
|
||||
ba EXC_VECAST
|
||||
CNAME(vectrapsize) = .-CNAME(vectrap)
|
||||
|
||||
#if defined(KDB)
|
||||
/*
|
||||
* Deliberate entry to dbtrap
|
||||
|
|
|
|||
|
|
@ -247,6 +247,7 @@ extern void *dsitrap, *dsisize;
|
|||
extern void *decrint, *decrsize;
|
||||
extern void *extint, *extsize;
|
||||
extern void *dblow, *dbsize;
|
||||
extern void *vectrap, *vectrapsize;
|
||||
|
||||
void
|
||||
powerpc_init(u_int startkernel, u_int endkernel, u_int basekernel, void *mdp)
|
||||
|
|
@ -335,6 +336,8 @@ powerpc_init(u_int startkernel, u_int endkernel, u_int basekernel, void *mdp)
|
|||
bcopy(&trapcode, (void *)EXC_SC, (size_t)&trapsize);
|
||||
bcopy(&trapcode, (void *)EXC_TRC, (size_t)&trapsize);
|
||||
bcopy(&trapcode, (void *)EXC_FPA, (size_t)&trapsize);
|
||||
bcopy(&vectrap, (void *)EXC_VEC, (size_t)&vectrapsize);
|
||||
bcopy(&trapcode, (void *)EXC_VECAST, (size_t)&trapsize);
|
||||
bcopy(&trapcode, (void *)EXC_THRM, (size_t)&trapsize);
|
||||
bcopy(&trapcode, (void *)EXC_BPT, (size_t)&trapsize);
|
||||
#ifdef KDB
|
||||
|
|
|
|||
|
|
@ -199,6 +199,11 @@ trap(struct trapframe *frame)
|
|||
enable_vec(td);
|
||||
frame->srr1 |= PSL_VEC;
|
||||
break;
|
||||
#else
|
||||
case EXC_VEC:
|
||||
case EXC_VECAST:
|
||||
sig = SIGILL;
|
||||
break;
|
||||
#endif /* ALTIVEC */
|
||||
|
||||
case EXC_ALI:
|
||||
|
|
|
|||
|
|
@ -443,6 +443,14 @@ CNAME(trapexit):
|
|||
FRAME_LEAVE(PC_TEMPSAVE)
|
||||
rfi
|
||||
|
||||
/*
|
||||
* Temporary: vector-unavailable traps are directed to vector-assist traps
|
||||
*/
|
||||
.globl CNAME(vectrap),CNAME(vectrapsize)
|
||||
CNAME(vectrap):
|
||||
ba EXC_VECAST
|
||||
CNAME(vectrapsize) = .-CNAME(vectrap)
|
||||
|
||||
#if defined(KDB)
|
||||
/*
|
||||
* Deliberate entry to dbtrap
|
||||
|
|
|
|||
Loading…
Reference in a new issue