From: "Luck, Tony" <tony.luck@intel.com>
To: linux-ia64@vger.kernel.org
Subject: RE: [Linux-ia64] patching sys_call_table from a module
Date: Tue, 03 Jul 2001 22:58:34 +0000 [thread overview]
Message-ID: <marc-linux-ia64-105590693005815@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-105590693005808@msgid-missing>
It looks like you can't do this easily right now. As others
have pointed out, on IA64 a pointer to a function is actually
a pointer to a two element structure that contains the actual
function address, and the gp value to use for that function.
However, sys_call_table in the kernel is not currently implemented
as a real "array of pointers to functions" ... it is simply an
array of function addresses ... and the code in ivt.S that makes
the branch through the pointer when a user invokes a system call
knows this. So the ivt.S code just leaves "gp" unchanged ... which
works for all system calls that are staticly linked into the kernel,
but means that system calls in modules are in trouble as they will
be invoked with the kernel "gp" instead of their own, and they will
fault as soon as they try to access any data objects that belong to
the module.
You might be able to workaround this for now by providing a stub
function in your module that sets "gp" and calls your real function.
Probably the real fix would be to change sys_call_table and ivt.S to
make them follow the usual ia64 conventions for pointers to functions.
-Tony Luck
-----Original Message-----
From: chas williams [mailto:chas@cmf.nrl.navy.mil]
Sent: Tuesday, July 03, 2001 6:46 AM
To: linux-ia64@linuxia64.org
Subject: [Linux-ia64] patching sys_call_table from a module
afs patches the sys_call_table to provide support for various functions.
the existing doesnt seem to work right. i figured out that the ia64
calls are offset by 1024. but know i have a different problem:
next prev parent reply other threads:[~2001-07-03 22:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-07-03 13:45 [Linux-ia64] patching sys_call_table from a module chas williams
2001-07-03 20:03 ` chas williams
2001-07-03 20:44 ` Don Dugger
2001-07-03 20:53 ` chas williams
2001-07-03 21:04 ` chas williams
2001-07-03 21:16 ` Don Dugger
2001-07-03 21:22 ` Don Dugger
2001-07-03 22:58 ` Luck, Tony [this message]
2001-07-04 15:31 ` chas williams
2001-07-04 21:34 ` Chas Williams
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=marc-linux-ia64-105590693005815@msgid-missing \
--to=tony.luck@intel.com \
--cc=linux-ia64@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