Subject: Re: Continued problems with SMP on NetBSD/alpha
To: NetBSD/Alpha Discussion List <port-alpha@NetBSD.org>
From: Greg A. Woods <woods@weird.com>
List: port-alpha
Date: 12/20/2006 14:34:08
--pgp-sign-Multipart_Wed_Dec_20_14:34:03_2006-1
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

At Wed, 20 Dec 2006 11:17:11 -0700 (MST),
Michael L. Hitch wrote:
>=20
>    I had some problems with my CS20 getting into a deadlock with interrup=
ts
> disabled, so I couldn't break into DDB from the console, and the only=20
> recourse I had was to cycle power.  Later, I finally located the halt=20
> switch, and using that was able to halt ot the SRM, which also displayed =

> the program counter of one of the CPUs.  From the SRM, I could use the=20
> 'continue' command to get back into the kernel and DDB and poke around=20
> from there.

Interesting!

So dropping to the SRM with a system halt effectively re-enables
interrupts?

Speaking of SRM and DDB and stuff, it sure would be nice if one could
halt to the SRM from DDB, and then get back to DDB again (and if this
was just an exploratory halt then also get back to a running system).
(Just as one can do something similar on a Sun or perhaps any open
firmware system)

Is something like this even possible on the Alpha with SRM though?  I
would think so, given that the SRM can continue execution again just as
you've described, but with my limited poling around I haven't found a
way to call the SRM without generating a halt and thus a panic().  I did
manage to hack the DDB code though to at least provide "machine halt"
and "machine prom" commands, but currently they're just calls to
cpu_halt() and prom_halt() respectively and specifically for the latter
I have the following commented out code and explanation.

void
db_prom_cmd(addr, have_addr, count, modif)
	db_expr_t addr;
	int have_addr;
	db_expr_t count;
	char *modif;
{
#if 0			/* prom_halt() always clears PCS_RC regardless */
	struct pcs *p;

	/* check the restart-capable flag */
	p =3D LOCATE_PCS(hwrpb, hwrpb->rpb_primary_cpu_id);
	if (p->pcs_flags & PCS_RC)
		db_printf("Halting system (type 'cont' to return to DDB)\n");
	else
#endif
		db_printf("Returning to SRM (no restart possible).\n");

	prom_halt(TRUE);
}


The former ("machine halt") is just:

void
db_halt_cmd(addr, have_addr, count, modif)
	db_expr_t addr;
	int have_addr;
	db_expr_t count;
	char *modif;
{
	cpu_halt();
}



--=20
						Greg A. Woods

H:+1 416 218-0098 W:+1 416 489-5852 x122 VE3TCP RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>       Secrets of the Weird <woods@weird.com>

--pgp-sign-Multipart_Wed_Dec_20_14:34:03_2006-1
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
MessageID: hgkABWSAShzpnYdX95Ysci91q0VmCuJp

iQA/AwUBRYmQMGJ7XxTCWceFEQL/3QCgjRguN7cyrJl1jOX2CNZgwYO/9VsAnAyw
j5ZiAzPj0ppHg44lGE+5gNe1
=FNqi
-----END PGP SIGNATURE-----

--pgp-sign-Multipart_Wed_Dec_20_14:34:03_2006-1--