From: Chen Gang <gang.chen.5i5j-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: James Hogan <james.hogan-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
Cc: Chen Gang
<gang.chen.5i5j-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
rostedt-nx8X9YLhiw1AfugRpC6u6w@public.gmane.org,
"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
linux-metag-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] arch: metag: lib: add "umoddi3.S" file for __umoddi3()
Date: Fri, 20 Dec 2013 09:44:10 +0800 [thread overview]
Message-ID: <52B3A0EA.9010801@gmail.com> (raw)
In-Reply-To: <52B2F8DC.8060006-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
On 12/19/2013 09:47 PM, James Hogan wrote:
> On 19/12/13 13:37, Chen Gang wrote:
>> On 12/19/2013 08:17 PM, James Hogan wrote:
>>> On 19/12/13 12:05, Chen Gang wrote:
>>>> Use objdump to get "umoddi3.S" for __umoddi3(), the original binary
>>>> file is "gcc-4.2.4-final/gcc/libgcc/umoddi3.o" which is generated by
>>>> "gcc-4.2.4/gcc/libgcc2.c".
>>>>
>>>> The relate error with allmodconfig:
>>>>
>>>> MODPOST 2909 modules
>>>> ERROR: "__umoddi3" [drivers/target/target_core_mod.ko] undefined!
>>>
>>> _umoddi3 is a 64bit division, which should be using the proper division
>>> functions provided by the kernel in <linux/math64.h>.
>>>
>>> It needs fixing wherever it comes from in drivers/target/target_core_mod.ko.
>>>
>>
>> After disassemble target_core_mod.ko, for me, the compiler will use
>> ___umoddi3 for '%' operator and use ___udivsi3 for '/' operator.
>
> Yeh, % is in this case remainder from a 64bit division, for which the
> standard division functions in <linux/math64.h> should be used instead.
>
>> If what I guess is correct, we need use/copy the "system library" which
>> compiler provides, so just use its ".o" file is OK (just like another
>> "arch/metag/lib/*.S" have done).
>
> No, I believe there shouldn't be any use of the C 64bit division/modulo
> operations in generic kernel code in the first place, so like I said
> before the code in question should be fixed to use the proper functions
> in <linux/math64.h>.
>
OK, thanks, your idea is one of fix ways.
Hmm... for me, it is still not a bad idea to add "__umoddi3" to metag.
- there are already several 64-bit functions in "arch/metag/lib/*.S".
- some of architectures already content "__umoddi3".
- it is easier for users (e.g. various drivers) to use '%' and '/'.
(especially, we have already support '/').
Thanks
> Cheers
> James
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
--
Chen Gang
Open, share and attitude like air, water and life which God blessed
--
To unsubscribe from this list: send the line "unsubscribe linux-metag" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Chen Gang <gang.chen.5i5j@gmail.com>
To: James Hogan <james.hogan@imgtec.com>
Cc: Chen Gang <gang.chen.5i5j@gmail.com>,
rostedt@goodmis.org,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
linux-metag@vger.kernel.org
Subject: Re: [PATCH] arch: metag: lib: add "umoddi3.S" file for __umoddi3()
Date: Fri, 20 Dec 2013 09:44:10 +0800 [thread overview]
Message-ID: <52B3A0EA.9010801@gmail.com> (raw)
In-Reply-To: <52B2F8DC.8060006@imgtec.com>
On 12/19/2013 09:47 PM, James Hogan wrote:
> On 19/12/13 13:37, Chen Gang wrote:
>> On 12/19/2013 08:17 PM, James Hogan wrote:
>>> On 19/12/13 12:05, Chen Gang wrote:
>>>> Use objdump to get "umoddi3.S" for __umoddi3(), the original binary
>>>> file is "gcc-4.2.4-final/gcc/libgcc/umoddi3.o" which is generated by
>>>> "gcc-4.2.4/gcc/libgcc2.c".
>>>>
>>>> The relate error with allmodconfig:
>>>>
>>>> MODPOST 2909 modules
>>>> ERROR: "__umoddi3" [drivers/target/target_core_mod.ko] undefined!
>>>
>>> _umoddi3 is a 64bit division, which should be using the proper division
>>> functions provided by the kernel in <linux/math64.h>.
>>>
>>> It needs fixing wherever it comes from in drivers/target/target_core_mod.ko.
>>>
>>
>> After disassemble target_core_mod.ko, for me, the compiler will use
>> ___umoddi3 for '%' operator and use ___udivsi3 for '/' operator.
>
> Yeh, % is in this case remainder from a 64bit division, for which the
> standard division functions in <linux/math64.h> should be used instead.
>
>> If what I guess is correct, we need use/copy the "system library" which
>> compiler provides, so just use its ".o" file is OK (just like another
>> "arch/metag/lib/*.S" have done).
>
> No, I believe there shouldn't be any use of the C 64bit division/modulo
> operations in generic kernel code in the first place, so like I said
> before the code in question should be fixed to use the proper functions
> in <linux/math64.h>.
>
OK, thanks, your idea is one of fix ways.
Hmm... for me, it is still not a bad idea to add "__umoddi3" to metag.
- there are already several 64-bit functions in "arch/metag/lib/*.S".
- some of architectures already content "__umoddi3".
- it is easier for users (e.g. various drivers) to use '%' and '/'.
(especially, we have already support '/').
Thanks
> Cheers
> James
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
--
Chen Gang
Open, share and attitude like air, water and life which God blessed
next prev parent reply other threads:[~2013-12-20 1:44 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-19 12:05 [PATCH] arch: metag: lib: add "umoddi3.S" file for __umoddi3() Chen Gang
2013-12-19 12:17 ` James Hogan
2013-12-19 12:17 ` James Hogan
2013-12-19 13:37 ` Chen Gang
2013-12-19 13:47 ` James Hogan
2013-12-19 13:47 ` James Hogan
[not found] ` <52B2F8DC.8060006-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2013-12-20 1:44 ` Chen Gang [this message]
2013-12-20 1:44 ` Chen Gang
2013-12-20 9:30 ` James Hogan
2013-12-20 9:30 ` James Hogan
2013-12-20 10:20 ` Chen Gang
2013-12-20 10:48 ` James Hogan
2013-12-20 10:48 ` James Hogan
[not found] ` <52B4208B.1080801-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2013-12-20 11:51 ` Chen Gang
2013-12-20 11:51 ` Chen Gang
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=52B3A0EA.9010801@gmail.com \
--to=gang.chen.5i5j-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=james.hogan-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-metag-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=rostedt-nx8X9YLhiw1AfugRpC6u6w@public.gmane.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 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.