From: Yan <rottled@gmail.com>
To: "Arjan van de Ven" <arjan@infradead.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.6.22.6 - Discrepancy between running and on-disk kernels
Date: Fri, 14 Mar 2008 12:08:16 -0400 [thread overview]
Message-ID: <54b90fdf0803140908k44bee3a2gbf4187ae40dad4b3@mail.gmail.com> (raw)
In-Reply-To: <20080314090049.346d7428@laptopd505.fenrus.org>
Can you point me to where in the source that self-patching happens? I
tried grep'ing
through the source for anything relevant, and came out empty handed.
-yan
On Fri, Mar 14, 2008 at 12:00 PM, Arjan van de Ven <arjan@infradead.org> wrote:
> On Fri, 14 Mar 2008 10:51:43 -0400
> Yan <rottled@gmail.com> wrote:
>
> > Hello,
> >
> > I have been trying to compare the code from the on-disk compressed
> > kernel that was booted and the running kernel extracted
> > from /dev/kmem. I extracted the kernel's code from the disk image by
> > stripping the head.S and similar and gunzipping it, and extracted the
> > kernel from /dev/kmem by reading data between _text and _etext symbol
> > offsets.
> >
> > I then ran both through a disassembler and diff'ed the outputs.
> > Predictably, the disassembly was similar, but not identical. Some
> > instructions (e.g. bts) had a 'lock' prefix, where as others had a
> > 'nop' in its place.
> >
> > There were other differences with some instructions like mfence.
> > Everything else matched just fine, the differences were mostly in
> > memory-referencing instructions.
> >
> > My question is, what can be changing the kernel between being on
> > static storage and being loaded?
>
> the kernel code is self-patching, it gets modified to match your system
> during boot time. So you cannot assume that the kernel on disk and the kernel
> in memory are identical.
> (Same goes for modules)
>
next prev parent reply other threads:[~2008-03-14 16:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-14 14:51 Yan
2008-03-14 16:00 ` Arjan van de Ven
2008-03-14 16:08 ` Yan [this message]
2008-03-14 16:31 ` Arjan van de Ven
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=54b90fdf0803140908k44bee3a2gbf4187ae40dad4b3@mail.gmail.com \
--to=rottled@gmail.com \
--cc=arjan@infradead.org \
--cc=linux-kernel@vger.kernel.org \
/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®