From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 27 19:21:52 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 18C1116A4CE for ; Thu, 27 Jan 2005 19:21:52 +0000 (GMT) Received: from VARK.MIT.EDU (VARK.MIT.EDU [18.95.3.179]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9F1A543D49 for ; Thu, 27 Jan 2005 19:21:51 +0000 (GMT) (envelope-from das@FreeBSD.ORG) Received: from VARK.MIT.EDU (localhost [127.0.0.1]) by VARK.MIT.EDU (8.13.1/8.13.1) with ESMTP id j0RJM2Jn073476; Thu, 27 Jan 2005 14:22:02 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.MIT.EDU (8.13.1/8.13.1/Submit) id j0RJM14F073475; Thu, 27 Jan 2005 14:22:01 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Thu, 27 Jan 2005 14:22:01 -0500 From: David Schultz To: Jacques Fourie Message-ID: <20050127192201.GA73427@VARK.MIT.EDU> Mail-Followup-To: Jacques Fourie , Jacques Fourie , freebsd-hackers@FreeBSD.ORG References: <41F90140.3020705@trispen.com> <20050127160914.GA72454@VARK.MIT.EDU> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: cc: freebsd-hackers@FreeBSD.ORG Subject: Re: kernel vm question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2005 19:21:52 -0000 On Thu, Jan 27, 2005, Jacques Fourie wrote: > Hi, > > Yes, I am trying to patch a piece of code in the kernel. The strange > thing is that this code works without a problem on FreeBSD 4.8 - has > the VM system changed to such an extent between 4.8 and 4.9 that the > pages in the kernel code segment are not writeable anymore? > > Thanks for the bit about the compiler optimization - at least I > understand that part now :) The idea that the compiler is responsible for the different behavior between 4.8 and 4.9 is just a theory, but it really doesn't matter; it's not so easy to dynamically change the code for a function. In addition to the protection bits, you also have to worry about synchronization with calls to that function, and about the possibility that a processor may have the old code in its instruction cache.