From: Mikael Pettersson <mikpe@csd.uu.se>
To: Luca Barbieri <ldb@ldb.ods.org>
Cc: Linux-Kernel ML <linux-kernel@vger.kernel.org>,
Linus Torvalds <torvalds@transmeta.com>
Subject: Re: [PATCH 1 / ...] i386 dynamic fixup/self modifying code
Date: Wed, 28 Aug 2002 17:53:11 +0200 [thread overview]
Message-ID: <15724.61927.221405.274843@kim.it.uu.se> (raw)
In-Reply-To: <1030506106.1489.27.camel@ldb>
Luca Barbieri writes:
> This patch implements a system that modifies the kernel code at runtime
> depending on CPU features and SMPness.
>...
> /* If we are running on SMP any other processor might be executing the
> code that we are modifying. We must make sure that the other
> processor will either fault or will execute the complete
> replacement instruction.
>
> This is accomplished by using instructions that fault only
> depending on up to 4 bytes. When fixing up something we first write
> bytes after the first 4 and we then use a locked write to set the
> first 4.
>
> We depend on the processor execute unit to never see our locked
> write before it sees the other modifications.
>
> According to page 7-5 of the Intel Pentium 4 System Programming
> Manual, this is safe on 486 and Pentium <= 4.
I've tried this sort of thing before (unsynchronised cross-modifying code),
but I had to abandon it due to Pentium III Erratum E49 and similar errata
for all Intel P6 CPUs. Have you verified that you're not hitting this erratum?
/Mikael
next prev parent reply other threads:[~2002-08-28 15:50 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-28 3:41 Luca Barbieri
2002-08-28 12:11 ` Pavel Machek
2002-08-29 22:57 ` Luca Barbieri
2002-08-29 23:19 ` Alan Cox
2002-08-29 23:22 ` Pavel Machek
2002-08-30 0:05 ` David S. Miller
2002-08-30 0:21 ` Luca Barbieri
2002-08-29 23:29 ` Luca Barbieri
2002-08-29 23:32 ` Alan Cox
2002-08-30 0:10 ` Luca Barbieri
2002-08-30 11:17 ` Alan Cox
2002-09-03 21:31 ` Jamie Lokier
2002-09-03 21:35 ` Jamie Lokier
2002-08-30 0:08 ` David S. Miller
2002-08-28 15:53 ` Mikael Pettersson [this message]
2002-08-28 16:16 ` Luca Barbieri
2002-08-28 19:48 ` Mikael Pettersson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=15724.61927.221405.274843@kim.it.uu.se \
--to=mikpe@csd.uu.se \
--cc=ldb@ldb.ods.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®