* Question about ia64 linux
@ 2004-03-22 3:00 Raj Pati
2004-03-22 6:13 ` Luck, Tony
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Raj Pati @ 2004-03-22 3:00 UTC (permalink / raw)
To: linux-ia64
Hello,
A question wrt to ia64 linux environment:
Is it possible to modify a running code (in a module or kernel)
in ia64 linux? (It is not a good practise to do it.
But, I need to check this out as it was done in ia32.....)
Probably, it is possible. I just wanted to see whether
there are any issues one should be aware of other than
serialization/flushing. There are couple of pages of
documentation regarding self-modifying code in one of
the ia64 software developers manual. I am curious
whether there are any other notes/writeups or sample
code where similar kind of things are done in ia64
linux. I really appreciate if some one can direct me
to such doc or code (if they exist) which can give
some
more ia64 specific information.
Thank you very much in advance.
Regards,
Raj
_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar – get it now!
http://clk.atdmt.com/AVE/go/onm00200415ave/direct/01/
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: Question about ia64 linux
2004-03-22 3:00 Question about ia64 linux Raj Pati
@ 2004-03-22 6:13 ` Luck, Tony
2004-03-22 22:09 ` Raj Pati
2004-03-23 21:57 ` David Mosberger
2 siblings, 0 replies; 4+ messages in thread
From: Luck, Tony @ 2004-03-22 6:13 UTC (permalink / raw)
To: linux-ia64
>Is it possible to modify a running code (in a module or kernel)
>in ia64 linux? (It is not a good practise to do it.
>But, I need to check this out as it was done in ia32.....)
Yes it can be done. Whether it is good practice is in the
eye of the beholder ... and depends a lot on what you are
actually doing. If you have some 1950's code that reads
auccessive elements from an array my modifying the code that
loads the address ... then it's time to rewrite :-) If you
have some on-the-fly code generation (e.g. a Just-in-time
compilation system) ... then that's a lot more palatable.
>Probably, it is possible. I just wanted to see whether
>there are any issues one should be aware of other than
>serialization/flushing. There are couple of pages of
>documentation regarding self-modifying code in one of
>the ia64 software developers manual. I am curious
>whether there are any other notes/writeups or sample
>code where similar kind of things are done in ia64
>linux. I really appreciate if some one can direct me
>to such doc or code (if they exist) which can give
>some more ia64 specific information.
The software developers manual covers everything that
you need to know. There are some code examples in the
Linux kernel code (where we modify a load instruction
to grab the physical address of an object, rather than
the virtual address ... used because the address won't
be known for sure until run-time). These aren't very dynamic
though ... the instructions are patched during kernel
initialization, and never touched again. Look at
ia64_patch_vtop() in arch/kernel/ia64/patch.c
-Tony
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: Question about ia64 linux
2004-03-22 3:00 Question about ia64 linux Raj Pati
2004-03-22 6:13 ` Luck, Tony
@ 2004-03-22 22:09 ` Raj Pati
2004-03-23 21:57 ` David Mosberger
2 siblings, 0 replies; 4+ messages in thread
From: Raj Pati @ 2004-03-22 22:09 UTC (permalink / raw)
To: linux-ia64
Thanks for the comments/pointers Tony.
Regards,
Raj
>From: "Luck, Tony" <tony.luck@intel.com>
>To: "Raj Pati" <rpatil0299@hotmail.com>, <linux-ia64@vger.kernel.org>
>Subject: RE: Question about ia64 linux
>Date: Sun, 21 Mar 2004 22:13:23 -0800
>
> >Is it possible to modify a running code (in a module or kernel)
> >in ia64 linux? (It is not a good practise to do it.
> >But, I need to check this out as it was done in ia32.....)
>
>Yes it can be done. Whether it is good practice is in the
>eye of the beholder ... and depends a lot on what you are
>actually doing. If you have some 1950's code that reads
>auccessive elements from an array my modifying the code that
>loads the address ... then it's time to rewrite :-) If you
>have some on-the-fly code generation (e.g. a Just-in-time
>compilation system) ... then that's a lot more palatable.
>
> >Probably, it is possible. I just wanted to see whether
> >there are any issues one should be aware of other than
> >serialization/flushing. There are couple of pages of
> >documentation regarding self-modifying code in one of
> >the ia64 software developers manual. I am curious
> >whether there are any other notes/writeups or sample
> >code where similar kind of things are done in ia64
> >linux. I really appreciate if some one can direct me
> >to such doc or code (if they exist) which can give
> >some more ia64 specific information.
>
>The software developers manual covers everything that
>you need to know. There are some code examples in the
>Linux kernel code (where we modify a load instruction
>to grab the physical address of an object, rather than
>the virtual address ... used because the address won't
>be known for sure until run-time). These aren't very dynamic
>though ... the instructions are patched during kernel
>initialization, and never touched again. Look at
>ia64_patch_vtop() in arch/kernel/ia64/patch.c
>
>-Tony
_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar – get it now!
http://clk.atdmt.com/AVE/go/onm00200415ave/direct/01/
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: Question about ia64 linux
2004-03-22 3:00 Question about ia64 linux Raj Pati
2004-03-22 6:13 ` Luck, Tony
2004-03-22 22:09 ` Raj Pati
@ 2004-03-23 21:57 ` David Mosberger
2 siblings, 0 replies; 4+ messages in thread
From: David Mosberger @ 2004-03-23 21:57 UTC (permalink / raw)
To: linux-ia64
>>>>> On Sun, 21 Mar 2004 22:13:23 -0800, "Luck, Tony" <tony.luck@intel.com> said:
Tony> The software developers manual covers everything that
Tony> you need to know.
True, but if you modify code in such a way that it affects a
procedure's call-frame, then you need to patch the unwind info as
well, and that's not discussed in these manuals. The Software
Convention and Runtime Architecture does discuss unwind info, but
doesn't directly address the issue of runtime-generated code. The
libunwind API (http://www.hpl.hp.com/research/linux/libunwind/) has
support for (efficiently) describing runtime-generated code but, alas,
this API isn't used in the kernel yet. And even if it were, it's
unlikely the dynamic unwind info support would be enabled for the
kernel (not until someone demonstrates a real need for having a JIT in
the kernel, at least ;-).
--david
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-03-23 21:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-22 3:00 Question about ia64 linux Raj Pati
2004-03-22 6:13 ` Luck, Tony
2004-03-22 22:09 ` Raj Pati
2004-03-23 21:57 ` David Mosberger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox