All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Smith <alex.smith@imgtec.com>
To: Huacai Chen <chenhc@lemote.com>
Cc: David Daney <ddaney.cavm@gmail.com>,
	Ralf Baechle <ralf@linux-mips.org>,
	John Crispin <john@phrozen.org>,
	"Steven J. Hill" <steven.hill@imgtec.com>,
	Aurelien Jarno <aurelien@aurel32.net>,
	Linux MIPS Mailing List <linux-mips@linux-mips.org>,
	Fuxin Zhang <zhangfx@lemote.com>,
	Zhangjin Wu <wuzhangjin@gmail.com>
Subject: Re: [PATCH 5/9] MIPS: Add numa api support
Date: Fri, 11 Apr 2014 13:15:04 +0100	[thread overview]
Message-ID: <5347DCC8.1090802@imgtec.com> (raw)
In-Reply-To: <CAAhV-H4gjj+PsEOi0UWDZSjG8v2yAD1-kGkz9ZP+Nrg3EqjmXw@mail.gmail.com>

Hi Huacai,

The compat wrappers are needed for all of them for O32/N32 on a 64-bit 
kernel. {get,set}mempolicy, mbind and migrate_pages all copy bitmaps 
to/from user memory. The non-compat versions would behave fine on little 
endian, but the compat versions are needed to convert the 32-bit bitmaps 
to 64-bit on big endian.

move_pages takes an array of pointers, the compat version is needed to 
convert that to 64-bit.

Alex

On 11/04/14 09:21, Huacai Chen wrote:
> Hi, MIPS hackers,
>
> Could anyone help me?
>
> Huacai
>
> On Thu, Apr 10, 2014 at 6:47 PM, Huacai Chen <chenhc@lemote.com> wrote:
>> Hi, David,
>>
>> After some code reading, I have some understanding about compat
>> syscall, please tell me whether I'm correct.
>> 1, compat syscall is only needed by n32/o32 userspace on 64-bit kernel.
>> 2, compat syscall is only needed when there are arguments in pointer type.
>> 3, compat syscall is only needed when pointer arguments are
>> array/struct/union for reading (reading means get_user or
>> copy_from_user), or pointer arguments are array/struct/union/long
>> integer for writing (writing means put_user or copy_to_user).
>>
>> If my understanding is correct, then in this patch, get_mempolicy()
>> need to use the compat version for n32/o32 on 64-bit kernel, mbind()
>> and set_mempolicy() can use the normal version in all cases. But when
>> I reading the X86 code, it seems like only o32 on 64-bit kernel need a
>> compat version (I assume i386/X32/X64 on X86 is the same as
>> o32/n32/n64 on MIPS).
>>
>> Please give some information, thanks.
>>
>> Huacai
>>
>> On Sat, Apr 5, 2014 at 8:54 AM, "陈华才" <chenhc@lemote.com> wrote:
>>> Excuse me, what's the compat version exactly means? Or how to produce a
>>> problem  without a compat version? It seems everything works fine just
>>> with this patch.
>>>
>>> Huacai
>>>
>>>> On 04/04/2014 01:11 AM, Huacai Chen wrote:
>>>>> Enable sys_mbind()/sys_get_mempolicy()/sys_set_mempolicy() for O32, N32,
>>>>> and N64 ABIs.
>>>>>
>>>>> Signed-off-by: Huacai Chen <chenhc@lemote.com>
>>>>
>>>> NACK.
>>>>
>>>> You need compat versions of the syscalls...
>>>>
>>>> Also current migrate_pages and move_pages syscalls need to use the
>>>> compat wrappers for 32-bit ABIs.
>>>>
>>>> David Daney
>>>>
>>>>
>>>>> ---
>>>>>    arch/mips/kernel/scall32-o32.S |    4 ++--
>>>>>    arch/mips/kernel/scall64-64.S  |    4 ++--
>>>>>    arch/mips/kernel/scall64-n32.S |    6 +++---
>>>>>    arch/mips/kernel/scall64-o32.S |    6 +++---
>>>>>    4 files changed, 10 insertions(+), 10 deletions(-)
>>>>>
>>>>> diff --git a/arch/mips/kernel/scall32-o32.S
>>>>> b/arch/mips/kernel/scall32-o32.S
>>>>> index fdc70b4..7f7e2fb 100644
>>>>> --- a/arch/mips/kernel/scall32-o32.S
>>>>> +++ b/arch/mips/kernel/scall32-o32.S
>>>>> @@ -495,8 +495,8 @@ EXPORT(sys_call_table)
>>>>>       PTR     sys_tgkill
>>>>>       PTR     sys_utimes
>>>>>       PTR     sys_mbind
>>>>> -    PTR     sys_ni_syscall                  /* sys_get_mempolicy */
>>>>> -    PTR     sys_ni_syscall                  /* 4270 sys_set_mempolicy */
>>>>> +    PTR     sys_get_mempolicy
>>>>> +    PTR     sys_set_mempolicy               /* 4270 */
>>>>>       PTR     sys_mq_open
>>>>>       PTR     sys_mq_unlink
>>>>>       PTR     sys_mq_timedsend
>>>>> diff --git a/arch/mips/kernel/scall64-64.S
>>>>> b/arch/mips/kernel/scall64-64.S
>>>>> index dd99c328..a4baf06 100644
>>>>> --- a/arch/mips/kernel/scall64-64.S
>>>>> +++ b/arch/mips/kernel/scall64-64.S
>>>>> @@ -347,8 +347,8 @@ EXPORT(sys_call_table)
>>>>>       PTR     sys_tgkill                      /* 5225 */
>>>>>       PTR     sys_utimes
>>>>>       PTR     sys_mbind
>>>>> -    PTR     sys_ni_syscall                  /* sys_get_mempolicy */
>>>>> -    PTR     sys_ni_syscall                  /* sys_set_mempolicy */
>>>>> +    PTR     sys_get_mempolicy
>>>>> +    PTR     sys_set_mempolicy
>>>>>       PTR     sys_mq_open                     /* 5230 */
>>>>>       PTR     sys_mq_unlink
>>>>>       PTR     sys_mq_timedsend
>>>>> diff --git a/arch/mips/kernel/scall64-n32.S
>>>>> b/arch/mips/kernel/scall64-n32.S
>>>>> index f68d2f4..92db19e 100644
>>>>> --- a/arch/mips/kernel/scall64-n32.S
>>>>> +++ b/arch/mips/kernel/scall64-n32.S
>>>>> @@ -339,9 +339,9 @@ EXPORT(sysn32_call_table)
>>>>>       PTR     compat_sys_clock_nanosleep
>>>>>       PTR     sys_tgkill
>>>>>       PTR     compat_sys_utimes               /* 6230 */
>>>>> -    PTR     sys_ni_syscall                  /* sys_mbind */
>>>>> -    PTR     sys_ni_syscall                  /* sys_get_mempolicy */
>>>>> -    PTR     sys_ni_syscall                  /* sys_set_mempolicy */
>>>>> +    PTR     sys_mbind
>>>>> +    PTR     sys_get_mempolicy
>>>>> +    PTR     sys_set_mempolicy
>>>>
>>>> Here
>>>>
>>>>
>>>>>       PTR     compat_sys_mq_open
>>>>>       PTR     sys_mq_unlink                   /* 6235 */
>>>>>       PTR     compat_sys_mq_timedsend
>>>>> diff --git a/arch/mips/kernel/scall64-o32.S
>>>>> b/arch/mips/kernel/scall64-o32.S
>>>>> index 70f6ace..0230429 100644
>>>>> --- a/arch/mips/kernel/scall64-o32.S
>>>>> +++ b/arch/mips/kernel/scall64-o32.S
>>>>> @@ -473,9 +473,9 @@ EXPORT(sys32_call_table)
>>>>>       PTR     compat_sys_clock_nanosleep      /* 4265 */
>>>>>       PTR     sys_tgkill
>>>>>       PTR     compat_sys_utimes
>>>>> -    PTR     sys_ni_syscall                  /* sys_mbind */
>>>>> -    PTR     sys_ni_syscall                  /* sys_get_mempolicy */
>>>>> -    PTR     sys_ni_syscall                  /* 4270 sys_set_mempolicy */
>>>>> +    PTR     sys_mbind
>>>>> +    PTR     sys_get_mempolicy
>>>>> +    PTR     sys_set_mempolicy               /* 4270 */
>>>>
>>>> And Here.
>>>>
>>>>
>>>>>       PTR     compat_sys_mq_open
>>>>>       PTR     sys_mq_unlink
>>>>>       PTR     compat_sys_mq_timedsend
>>>>>
>>>>
>>>>
>>>
>>>
>>>
>

  reply	other threads:[~2014-04-11 12:15 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-04  8:11 [PATCH 00/12] MIPS: Loongson-3: Add NUMA and Loongson-3B support Huacai Chen
2014-04-04  8:11 ` [PATCH 1/9] MIPS: Support hard limit of cpu count (nr_cpu_ids) Huacai Chen
2014-04-04 11:48   ` Sergei Shtylyov
2014-04-04  8:11 ` [PATCH 2/9] MIPS: Support CPU topology files in sysfs Huacai Chen
2014-04-04  8:11 ` [PATCH 3/9] MIPS: Loongson: Modify ChipConfig register definition Huacai Chen
2014-04-04  8:11 ` [PATCH 4/9] MIPS: Add NUMA support for Loongson-3 Huacai Chen
2014-04-04  8:11 ` [PATCH 5/9] MIPS: Add numa api support Huacai Chen
2014-04-04 16:45   ` David Daney
2014-04-05  0:54     ` "陈华才"
2014-04-10 10:47       ` Huacai Chen
2014-04-11  8:21         ` Huacai Chen
2014-04-11 12:15           ` Alex Smith [this message]
2014-04-11 13:38             ` Huacai Chen
2014-04-11 13:57               ` Alex Smith
2014-04-04  8:11 ` [PATCH 6/9] MIPS: Add Loongson-3B support Huacai Chen
2014-04-04  8:11 ` [PATCH 7/9] MIPS: Loongson: Make CPU name more clear Huacai Chen
2014-04-04  8:48   ` Aaro Koskinen
2014-04-05 19:10     ` Matt Turner
2014-04-04  8:11 ` [PATCH 8/9] MIPS: Loongson-3: Enable the COP2 usage Huacai Chen
2014-04-05 18:51   ` Matt Turner
2014-04-06  2:06     ` "陈华才"
2014-04-09  8:23       ` chengxiuzhi
2014-04-04  8:11 ` [PATCH 9/9] MIPS: Loongson: Rename CONFIG_LEMOTE_MACH3A to CONFIG_LOONGSON_MACH3X Huacai Chen

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=5347DCC8.1090802@imgtec.com \
    --to=alex.smith@imgtec.com \
    --cc=aurelien@aurel32.net \
    --cc=chenhc@lemote.com \
    --cc=ddaney.cavm@gmail.com \
    --cc=john@phrozen.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    --cc=steven.hill@imgtec.com \
    --cc=wuzhangjin@gmail.com \
    --cc=zhangfx@lemote.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.