NetBSD-Bugs archive

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

Re: port-macppc/58283: NetBSD/macppc 10.0 reproducible kernel PGM trap panic



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

From: Izumi Tsutsui <tsutsui%ceres.dti.ne.jp@localhost>
To: mrg%eterna23.net@localhost
Cc: gnats-bugs%netbsd.org@localhost, tsutsui%ceres.dti.ne.jp@localhost
Subject: Re: port-macppc/58283: NetBSD/macppc 10.0 reproducible kernel PGM trap
	 panic
Date: Tue, 11 Jun 2024 03:06:27 +0900

 > >  0x12cbc8 is 'dssall' in vec_state_release:
 > 
 > i think the bug here is that vec_restore_from_mcontext() is missing
 > this check that is in vec_save_to_mcontext():
 > 
 > 	/* Save AltiVec context, if any. */
 > 	if (!vec_used_p(l))
 > 		return false;
 > 
 > can you try adding this near the top of vec_restore_from_mcontext()?
 > (with just return; void function.)
 
 Hmm, indeed the panic no longer happens with the following patch.
 (I'm not sure why netbsd-9 worked though)
 
 ---
 Index: altivec.c
 ===================================================================
 RCS file: /cvsroot/src/sys/arch/powerpc/oea/altivec.c,v
 retrieving revision 1.34
 diff -u -p -d -r1.34 altivec.c
 --- altivec.c	30 Oct 2021 19:44:56 -0000	1.34
 +++ altivec.c	10 Jun 2024 18:01:52 -0000
 @@ -163,6 +163,10 @@ vec_restore_from_mcontext(struct lwp *l,
  
  	KASSERT(l == curlwp);
  
 +	/* Nothing to do if no AltiVec context. */
 +	if (!vec_used_p(l))
 +		return;
 +
  	/* we don't need to save the state, just drop it */
  	pcu_discard(&vec_ops, l, true);
  
 ---
 
 Thanks,
 ---
 Izumi Tsutsui
 


Home | Main Index | Thread Index | Old Index