From: april <aapril03@gmail.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Is compat_sys_ioctl called when both kernel and userland are 64bit ?
Date: Wed, 12 Aug 2009 21:00:19 +0800 [thread overview]
Message-ID: <d67deb790908120600s1b307fc2j21d4622584ee63d1@mail.gmail.com> (raw)
In-Reply-To: <87skfxfh1g.fsf@basil.nowhere.org>
2009/8/12 Andi Kleen <andi@firstfloor.org>:
> april <aapril03@gmail.com> writes:
>>
>> it seems when a kernel is built to x86_64, whenever a ioctl called
>> ,the call flow will be ia32_syscall -->compat_sys_ioctl->compat
>> ioctl(if provided)
>
> Only for syscalls throught int 0x80 (or 32bit SYSCALL/SYSENTER), which normally
> only come from 32bit processes. In theory 64bit processes
> could use them, but they normally don't.
>
so you mean in 64bit process with a 64bit Linux kernel, system call is
not through int 0x80 ?
I know little about x86_64 arch, so I suppose it still through INT 0x80
can you tell me more about this? or where to get more information abort it?
>> but I have some doubt:
>>
>> My question is:
>> 1. Is compat_sys_ioctl called when both kernel and userland are 64bit
>> (suppose I provide those compat ioctl functions)?
>
> No.
>
>> If not, how kernel knows the driver is 32bit or 64bit?
>
> There are no 32bit drivers on a 64bit kernel, all drivers are 64bit.
>
> For 32bit processes running on a 64bit kernel it depends on the
> entry points (int 0x80 or SYSENTER/SYSCALL)
>
>> 2. when using mmap, the 64bit kernel will return a 64bit address, and
>> a userland(32bit) application can only get the lower 32bit,
>> it can work when the memory is not large.
>
> The kernel makes sure to only hand out 32bit addresses to 32bit
> processes.
>
I am using a 64bit kernel ,32bit Ubuntu9.04 which kernel was replaced
by a 64bit one,
and add some compat ioctl to make drm module work(on VIA platform),X
can work well(only 512M ram)
I am not test but guess it will has problem is memory is large (for
example ,over 4G)
> -Andi
>
> --
> ak@linux.intel.com -- Speaking for myself only.
>
prev parent reply other threads:[~2009-08-12 13:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-12 9:27 april
2009-08-12 10:44 ` Andi Kleen
2009-08-12 13:00 ` april [this message]
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=d67deb790908120600s1b307fc2j21d4622584ee63d1@mail.gmail.com \
--to=aapril03@gmail.com \
--cc=andi@firstfloor.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®