From owner-freebsd-smp Wed Jul 16 14:42:18 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id OAA10761 for smp-outgoing; Wed, 16 Jul 1997 14:42:18 -0700 (PDT) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.50]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id OAA10741; Wed, 16 Jul 1997 14:42:11 -0700 (PDT) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id OAA01599; Wed, 16 Jul 1997 14:41:26 -0700 From: Terry Lambert Message-Id: <199707162141.OAA01599@phaeton.artisoft.com> Subject: Re: self modifying kernel code To: smp@csn.net (Steve Passe) Date: Wed, 16 Jul 1997 14:41:26 -0700 (MST) Cc: smp@FreeBSD.ORG, current@FreeBSD.ORG In-Reply-To: <199707162042.OAA09705@Ilsa.StevesCafe.com> from "Steve Passe" at Jul 16, 97 02:42:55 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-smp@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > I see the possible usefullness for "self-modifying-code" in several places in > the SMP kernel. [ ... discussion of patch vectors vs. indirected jump tables ... ] > So what is the policy/reality of self-modifying code in the -current source? > The 1st example above can be handled during boot, so I suspect that the > modifications should be easy enough. The second involves modification of the > kernel code space after going multi-user (probaly dozens of times b4 its > finished), I'm not so sure about modifying kernel code-space at that point... > > Comments? Are we assuming that the processors will be Pentium only? The icache is not written back prior to the P5. This takes a significant number of NOP's to flush the pipeline (as discussed in Van Guilluwe's "The Undocumented PC" in the section where he investigates instruction cache depth using self-modifying code). Note that these patches would have to be done for 386/486 in the UP case. Regards, Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.