From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23927 invoked by alias); 15 Feb 2007 19:12:32 -0000 Received: (qmail 23920 invoked by uid 22791); 15 Feb 2007 19:12:31 -0000 X-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,FORGED_RCVD_HELO X-Spam-Check-By: sourceware.org Received: from tomts16.bellnexxia.net (HELO tomts16-srv.bellnexxia.net) (209.226.175.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 15 Feb 2007 19:12:26 +0000 Received: from krystal.dyndns.org ([65.95.37.140]) by tomts16-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20070215191223.VPWM1673.tomts16-srv.bellnexxia.net@krystal.dyndns.org> for ; Thu, 15 Feb 2007 14:12:23 -0500 Received: from localhost (localhost [127.0.0.1]) (uid 1000) by krystal.dyndns.org with local; Thu, 15 Feb 2007 14:12:22 -0500 id 001C25B6.45D4B096.00007B99 Date: Thu, 15 Feb 2007 19:12:00 -0000 From: Mathieu Desnoyers To: Andrew Morton Cc: linux-kernel@vger.kernel.org, Christoph Hellwig , Ingo Molnar , systemtap@sources.redhat.com, ltt-dev@shafik.org Subject: Re: [PATCH 02/05] Linux Kernel Markers, architecture independant code. Message-ID: <20070215191222.GB31359@Krystal> References: <1171224207118-git-send-email-mathieu.desnoyers@polymtl.ca> <11712242074091-git-send-email-mathieu.desnoyers@polymtl.ca> <20070214232137.7aa86259.akpm@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20070214232137.7aa86259.akpm@linux-foundation.org> X-Editor: vi X-Info: http://krystal.dyndns.org:8080 X-Operating-System: Linux/2.4.34-grsec (i686) X-Uptime: 14:09:42 up 13 days, 9:17, 7 users, load average: 1.03, 1.12, 1.31 User-Agent: Mutt/1.5.13 (2006-08-11) X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2007-q1/txt/msg00347.txt.bz2 * Andrew Morton (akpm@linux-foundation.org) wrote: > On Sun, 11 Feb 2007 15:03:24 -0500 Mathieu Desnoyers wrote: >=20 > > Linux Kernel Markers, architecture independant code. > >=20 > > Signed-off-by: Mathieu Desnoyers > >=20 > > ... > > > > + > > +#ifndef MARK > > +#define MARK GEN_MARK > > +#define MARK_ENABLE_TYPE GEN_MARK_ENABLE_TYPE > > +#define MARK_ENABLE_IMMEDIATE_OFFSET GEN_MARK_ENABLE_IMMEDIATE_OFFSET > > +#endif >=20 > Also perhaps this nastiness can go away once each architecture has > asm/marker.h? >=20 Yes, absolutely. > > +#ifdef MARK_POLYMORPHIC >=20 > What's this? Is it commented somewhere? (It should be...) >=20 No, but should be : it is defined by the architecture's marker.h when the marker flavor has to do code motification when the marker state is modified. > > +static int marker_set_ins_enable(void *address, char enable) > > +{ > > +#ifdef CONFIG_X86_32 > > + return arch_marker_set_ins_enable(address, enable); > > +#else > > + char newi[MARK_ENABLE_IMMEDIATE_OFFSET+1]; > > + int size =3D MARK_ENABLE_IMMEDIATE_OFFSET+sizeof(MARK_ENABLE_TYPE); > > + > > + memcpy(newi, address, size); > > + MARK_ENABLE(&newi[0]) =3D enable; > > + memcpy(address, newi, size); > > + flush_icache_range((unsigned long)address, size); > > + return 0; > > +#endif //CONFIG_X86_32 > > +} >=20 > eww. Can we put a suitable arch_marker_set_ins_enable() into each arch's > marker.h? >=20 Or maybe put that in asm-generic so we do not duplicate code. > > +#else > > +static int marker_set_ins_enable(void *address, char enable) > > +{ > > + return -EPERM; > > +} > > +#endif //MARK_POLYMORPHIC > > + > > > > ... > > >=20 --=20 Mathieu Desnoyers Computer Engineering Ph.D. Candidate, =C9cole Polytechnique de Montr=E9al OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68