NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-sparc/54734 (sparc panics running ATF tests)



The following reply was made to PR port-sparc/54734; it has been noted by GNATS.

From: Kamil Rytarowski <n54%gmx.com@localhost>
To: gnats-bugs%netbsd.org@localhost, Andrew Doran <ad%netbsd.org@localhost>
Cc: 
Subject: Re: port-sparc/54734 (sparc panics running ATF tests)
Date: Fri, 24 Jan 2020 22:58:58 +0100

 On 22.01.2020 22:55, Andrew Doran wrote:
 > The following reply was made to PR port-sparc/54734; it has been noted b=
 y GNATS.
 >
 > From: Andrew Doran <ad%netbsd.org@localhost>
 > To: gnats-bugs%netbsd.org@localhost
 > Cc:
 > Subject: Re: port-sparc/54734 (sparc panics running ATF tests)
 > Date: Wed, 22 Jan 2020 21:53:43 +0000
 >
 >  access_regs_set_unaligned_pc_0x1: [0.225264s] Passed.
 >  access_regs_set_unaligned_pc_0x3: qemu: fatal: Trap 0x07 while interrup=
 ts disabled, Error state
 >  pc: f00095b8  npc: f00095bc
 >  %g0-7: 00000000 00000d3e 30beb38e 30800000 007ace38 00028f74 00000000 e=
 de4ab58
 >  %o0-7: f0002000 f895ffb0 edd425d4 f045a8f0 f045a8e0 f14058c0 f895ff50 f=
 0008834
 >  %l0-7: 04400082 00028f77 00028f7b 00000fc1 00000008 00000002 f895e000 0=
 0000528
 >  %i0-7: 00000000 00000000 00000000 00000000 edd98b58 00000000 effff528 0=
 0028f6c
 >  %f00:  ffffffffffffffff ffffffffffffffff ffffffffffffffff fffffffffffff=
 fff
 >  %f08:  ffffffffffffffff ffffffffffffffff ffffffffffffffff fffffffffffff=
 fff
 >  %f16:  ffffffffffffffff ffffffffffffffff ffffffffffffffff fffffffffffff=
 fff
 >  %f24:  ffffffffffffffff ffffffffffffffff ffffffffffffffff fffffffffffff=
 fff
 >  psr: 04400082 (icc: -Z-- SPE: S--) wim: 00000010
 >  fsr: 0f800000 y: 0e66726b
 >
 >  [1]   Abort trap (core dumped) qemu-system-sparc -m 128 -drive file=3D/=
 ccd/spar...
 >
 >
 
 http://netbsd.org/~kamil/patch-00216-sparc-ptrace-panic.txt
 
 Taken from:
 
 commit 88c62ad10d352c3ab86db6f5332100eec863a0f5
 Author: miod <miod%openbsd.org@localhost>
 Date:   Tue Mar 2 23:45:27 2004 +0000
 
     In process_set_pc() and process_set_regs(), disallow unaligned pc
 and npc
     values. Workaround against PR #3663.
 
     ok deraadt@
 
 diff --git a/sys/arch/sparc/sparc/process_machdep.c
 b/sys/arch/sparc/sparc/process_machdep.c
 index a3b2e940c24..595aa4c7e83 100644
 =2D-- a/sys/arch/sparc/sparc/process_machdep.c
 +++ b/sys/arch/sparc/sparc/process_machdep.c
 @@ -1,4 +1,4 @@
 -/*	$OpenBSD: process_machdep.c,v 1.7 2004/02/08 00:04:21 deraadt Exp $	*/
 +/*	$OpenBSD: process_machdep.c,v 1.8 2004/03/02 23:45:27 miod Exp $	*/
  /*	$NetBSD: process_machdep.c,v 1.6 1996/03/14 21:09:26 christos Exp $ */
 
  /*
 @@ -103,6 +103,10 @@ process_write_regs(p, regs)
  	struct reg *regs;
  {
  	int	psr =3D p->p_md.md_tf->tf_psr & ~PSR_ICC;
 +
 +	if (((regs->r_pc | regs->r_npc) & 0x03) !=3D 0)
 +		return (EINVAL);
 +
  	bcopy((caddr_t)regs, p->p_md.md_tf, sizeof(struct reg));
  	p->p_md.md_tf->tf_psr =3D psr | (regs->r_psr & PSR_ICC);
  	return (0);
 @@ -123,6 +127,9 @@ process_set_pc(p, addr)
  	struct proc *p;
  	caddr_t addr;
  {
 +	if (((u_int)addr & 0x03) !=3D 0)
 +		return (EINVAL);
 +
  	p->p_md.md_tf->tf_pc =3D (u_int)addr;
  	p->p_md.md_tf->tf_npc =3D (u_int)addr + 4;
  	return (0);
 


Home | Main Index | Thread Index | Old Index