* [PATCH] um: always use the same type for __syscall_stub_start
@ 2014-10-11 11:29 Nicolas Iooss
2014-10-11 11:42 ` Richard Weinberger
0 siblings, 1 reply; 7+ messages in thread
From: Nicolas Iooss @ 2014-10-11 11:29 UTC (permalink / raw)
To: Jeff Dike, Richard Weinberger, user-mode-linux-devel,
user-mode-linux-user
Cc: linux-kernel
syscall_stub_start is declared with different types in C files:
arch/um/kernel/physmem.c: extern int __syscall_stub_start;
arch/um/kernel/skas/mmu.c: extern int __syscall_stub_start;
arch/um/os-Linux/skas/mem.c: extern unsigned long __syscall_stub_start;
arch/um/os-Linux/skas/process.c: extern int __syscall_stub_start;
Fix this inconsistency by always using unsigned long. This does not
change anything in the compiled code because only the address of
__syscall_stub_start is used, but it makes the static checker I use
stop complaining about incompatible declarations.
Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
---
arch/um/kernel/physmem.c | 2 +-
arch/um/kernel/skas/mmu.c | 2 +-
arch/um/os-Linux/skas/process.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c
index 30fdd5d0067b..f1d7ed26d638 100644
--- a/arch/um/kernel/physmem.c
+++ b/arch/um/kernel/physmem.c
@@ -75,7 +75,7 @@ void map_memory(unsigned long virt, unsigned long phys, unsigned long len,
}
}
-extern int __syscall_stub_start;
+extern unsigned long __syscall_stub_start;
void __init setup_physmem(unsigned long start, unsigned long reserve_end,
unsigned long len, unsigned long long highmem)
diff --git a/arch/um/kernel/skas/mmu.c b/arch/um/kernel/skas/mmu.c
index 007d5503f49b..4bdd49e0bdc3 100644
--- a/arch/um/kernel/skas/mmu.c
+++ b/arch/um/kernel/skas/mmu.c
@@ -12,7 +12,7 @@
#include <os.h>
#include <skas.h>
-extern int __syscall_stub_start;
+extern unsigned long __syscall_stub_start;
static int init_stub_pte(struct mm_struct *mm, unsigned long proc,
unsigned long kernel)
diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c
index 908579f2b0ab..f30575557791 100644
--- a/arch/um/os-Linux/skas/process.c
+++ b/arch/um/os-Linux/skas/process.c
@@ -193,7 +193,7 @@ static void handle_trap(int pid, struct uml_pt_regs *regs,
handle_syscall(regs);
}
-extern int __syscall_stub_start;
+extern unsigned long __syscall_stub_start;
static int userspace_tramp(void *stack)
{
--
2.1.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [uml-devel] [PATCH] um: always use the same type for __syscall_stub_start
2014-10-11 11:29 [PATCH] um: always use the same type for __syscall_stub_start Nicolas Iooss
@ 2014-10-11 11:42 ` Richard Weinberger
0 siblings, 0 replies; 7+ messages in thread
From: Richard Weinberger @ 2014-10-11 11:42 UTC (permalink / raw)
To: Nicolas Iooss, Jeff Dike, user-mode-linux-devel,
user-mode-linux-user
Cc: linux-kernel
Am 11.10.2014 um 13:29 schrieb Nicolas Iooss:
> syscall_stub_start is declared with different types in C files:
>
> arch/um/kernel/physmem.c: extern int __syscall_stub_start;
> arch/um/kernel/skas/mmu.c: extern int __syscall_stub_start;
> arch/um/os-Linux/skas/mem.c: extern unsigned long __syscall_stub_start;
> arch/um/os-Linux/skas/process.c: extern int __syscall_stub_start;
>
> Fix this inconsistency by always using unsigned long. This does not
> change anything in the compiled code because only the address of
> __syscall_stub_start is used, but it makes the static checker I use
> stop complaining about incompatible declarations.
While we're here, can you put these declarations into a single header file?
Thanks,
//richard
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://p.sf.net/sfu/Zoho
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] um: always use the same type for __syscall_stub_start
@ 2014-10-11 11:42 ` Richard Weinberger
0 siblings, 0 replies; 7+ messages in thread
From: Richard Weinberger @ 2014-10-11 11:42 UTC (permalink / raw)
To: Nicolas Iooss, Jeff Dike, user-mode-linux-devel,
user-mode-linux-user
Cc: linux-kernel
Am 11.10.2014 um 13:29 schrieb Nicolas Iooss:
> syscall_stub_start is declared with different types in C files:
>
> arch/um/kernel/physmem.c: extern int __syscall_stub_start;
> arch/um/kernel/skas/mmu.c: extern int __syscall_stub_start;
> arch/um/os-Linux/skas/mem.c: extern unsigned long __syscall_stub_start;
> arch/um/os-Linux/skas/process.c: extern int __syscall_stub_start;
>
> Fix this inconsistency by always using unsigned long. This does not
> change anything in the compiled code because only the address of
> __syscall_stub_start is used, but it makes the static checker I use
> stop complaining about incompatible declarations.
While we're here, can you put these declarations into a single header file?
Thanks,
//richard
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] um: always use the same type for __syscall_stub_start
2014-10-11 11:42 ` Richard Weinberger
(?)
@ 2014-10-11 12:15 ` Nicolas Iooss
2014-10-11 12:24 ` Richard Weinberger
-1 siblings, 1 reply; 7+ messages in thread
From: Nicolas Iooss @ 2014-10-11 12:15 UTC (permalink / raw)
To: Richard Weinberger, Jeff Dike, user-mode-linux-devel,
user-mode-linux-user
Cc: linux-kernel
2014-10-11 13:42 GMT+02:00 Richard Weinberger:
> Am 11.10.2014 um 13:29 schrieb Nicolas Iooss:
>> syscall_stub_start is declared with different types in C files:
>>
>> arch/um/kernel/physmem.c: extern int __syscall_stub_start;
>> arch/um/kernel/skas/mmu.c: extern int __syscall_stub_start;
>> arch/um/os-Linux/skas/mem.c: extern unsigned long __syscall_stub_start;
>> arch/um/os-Linux/skas/process.c: extern int __syscall_stub_start;
>>
>> Fix this inconsistency by always using unsigned long. This does not
>> change anything in the compiled code because only the address of
>> __syscall_stub_start is used, but it makes the static checker I use
>> stop complaining about incompatible declarations.
>
> While we're here, can you put these declarations into a single header
file?
Sure. Do you have a specific header file in mind or shall I create
arch/um/include/asm/sections.h with declarations for
__syscall_stub_start, __syscall_stub_end and __binary_start (used in
arch/um/kernel/um_arch.c)?
Thanks for your quick reply,
Nicolas
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] um: always use the same type for __syscall_stub_start
2014-10-11 12:15 ` Nicolas Iooss
@ 2014-10-11 12:24 ` Richard Weinberger
2014-10-11 13:26 ` Nicolas Iooss
0 siblings, 1 reply; 7+ messages in thread
From: Richard Weinberger @ 2014-10-11 12:24 UTC (permalink / raw)
To: Nicolas Iooss, Jeff Dike, user-mode-linux-devel,
user-mode-linux-user
Cc: linux-kernel
Am 11.10.2014 um 14:15 schrieb Nicolas Iooss:
> 2014-10-11 13:42 GMT+02:00 Richard Weinberger:
>> Am 11.10.2014 um 13:29 schrieb Nicolas Iooss:
>>> syscall_stub_start is declared with different types in C files:
>>>
>>> arch/um/kernel/physmem.c: extern int __syscall_stub_start;
>>> arch/um/kernel/skas/mmu.c: extern int __syscall_stub_start;
>>> arch/um/os-Linux/skas/mem.c: extern unsigned long __syscall_stub_start;
>>> arch/um/os-Linux/skas/process.c: extern int __syscall_stub_start;
>>>
>>> Fix this inconsistency by always using unsigned long. This does not
>>> change anything in the compiled code because only the address of
>>> __syscall_stub_start is used, but it makes the static checker I use
>>> stop complaining about incompatible declarations.
>>
>> While we're here, can you put these declarations into a single header
> file?
>
> Sure. Do you have a specific header file in mind or shall I create
> arch/um/include/asm/sections.h with declarations for
> __syscall_stub_start, __syscall_stub_end and __binary_start (used in
> arch/um/kernel/um_arch.c)?
Not really. Maybe you can find a common header for all.
But I fear where is a reason why these declarations are not in a
common header. They are used in the kernel- and userspace part of
UML.
Anyway, please give it a try. :)
Thanks,
//richard
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] um: always use the same type for __syscall_stub_start
2014-10-11 12:24 ` Richard Weinberger
@ 2014-10-11 13:26 ` Nicolas Iooss
0 siblings, 0 replies; 7+ messages in thread
From: Nicolas Iooss @ 2014-10-11 13:26 UTC (permalink / raw)
To: Richard Weinberger, Jeff Dike, user-mode-linux-devel,
user-mode-linux-user
Cc: linux-kernel
Le 11/10/2014 14:24, Richard Weinberger a écrit :
> Am 11.10.2014 um 14:15 schrieb Nicolas Iooss:
>> 2014-10-11 13:42 GMT+02:00 Richard Weinberger:
>>> Am 11.10.2014 um 13:29 schrieb Nicolas Iooss:
>>>> syscall_stub_start is declared with different types in C files:
>>>>
>>>> arch/um/kernel/physmem.c: extern int __syscall_stub_start;
>>>> arch/um/kernel/skas/mmu.c: extern int __syscall_stub_start;
>>>> arch/um/os-Linux/skas/mem.c: extern unsigned long __syscall_stub_start;
>>>> arch/um/os-Linux/skas/process.c: extern int __syscall_stub_start;
>>>>
>>>> Fix this inconsistency by always using unsigned long. This does not
>>>> change anything in the compiled code because only the address of
>>>> __syscall_stub_start is used, but it makes the static checker I use
>>>> stop complaining about incompatible declarations.
>>>
>>> While we're here, can you put these declarations into a single header
>> file?
>>
>> Sure. Do you have a specific header file in mind or shall I create
>> arch/um/include/asm/sections.h with declarations for
>> __syscall_stub_start, __syscall_stub_end and __binary_start (used in
>> arch/um/kernel/um_arch.c)?
>
> Not really. Maybe you can find a common header for all.
> But I fear where is a reason why these declarations are not in a
> common header. They are used in the kernel- and userspace part of
> UML.
> Anyway, please give it a try. :)
Ok. I'll at least try to add a kernel header and send a new patch after
some tests.
By the way, most variables in include/asm-generic/sections.h are
declared "char[]" and used without operator, contrary to
__syscall_stub_start, declared "int" or "unsigned long" and only used
with "&" operator. Is there any reason why there are in the kernel two
ways of declaring/accessing code addresses defined in linker files? If
not, I can send a patch which makes __syscall_stub_start "char[]"
instead of "unsigned long" to make the code a little bit clearer.
Nicolas
--
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/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] um: always use the same type for __syscall_stub_start
@ 2014-10-11 13:26 ` Nicolas Iooss
0 siblings, 0 replies; 7+ messages in thread
From: Nicolas Iooss @ 2014-10-11 13:26 UTC (permalink / raw)
To: Richard Weinberger, Jeff Dike, user-mode-linux-devel,
user-mode-linux-user
Cc: linux-kernel
Le 11/10/2014 14:24, Richard Weinberger a écrit :
> Am 11.10.2014 um 14:15 schrieb Nicolas Iooss:
>> 2014-10-11 13:42 GMT+02:00 Richard Weinberger:
>>> Am 11.10.2014 um 13:29 schrieb Nicolas Iooss:
>>>> syscall_stub_start is declared with different types in C files:
>>>>
>>>> arch/um/kernel/physmem.c: extern int __syscall_stub_start;
>>>> arch/um/kernel/skas/mmu.c: extern int __syscall_stub_start;
>>>> arch/um/os-Linux/skas/mem.c: extern unsigned long __syscall_stub_start;
>>>> arch/um/os-Linux/skas/process.c: extern int __syscall_stub_start;
>>>>
>>>> Fix this inconsistency by always using unsigned long. This does not
>>>> change anything in the compiled code because only the address of
>>>> __syscall_stub_start is used, but it makes the static checker I use
>>>> stop complaining about incompatible declarations.
>>>
>>> While we're here, can you put these declarations into a single header
>> file?
>>
>> Sure. Do you have a specific header file in mind or shall I create
>> arch/um/include/asm/sections.h with declarations for
>> __syscall_stub_start, __syscall_stub_end and __binary_start (used in
>> arch/um/kernel/um_arch.c)?
>
> Not really. Maybe you can find a common header for all.
> But I fear where is a reason why these declarations are not in a
> common header. They are used in the kernel- and userspace part of
> UML.
> Anyway, please give it a try. :)
Ok. I'll at least try to add a kernel header and send a new patch after
some tests.
By the way, most variables in include/asm-generic/sections.h are
declared "char[]" and used without operator, contrary to
__syscall_stub_start, declared "int" or "unsigned long" and only used
with "&" operator. Is there any reason why there are in the kernel two
ways of declaring/accessing code addresses defined in linker files? If
not, I can send a patch which makes __syscall_stub_start "char[]"
instead of "unsigned long" to make the code a little bit clearer.
Nicolas
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-10-11 13:26 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-11 11:29 [PATCH] um: always use the same type for __syscall_stub_start Nicolas Iooss
2014-10-11 11:42 ` [uml-devel] " Richard Weinberger
2014-10-11 11:42 ` Richard Weinberger
2014-10-11 12:15 ` Nicolas Iooss
2014-10-11 12:24 ` Richard Weinberger
2014-10-11 13:26 ` Nicolas Iooss
2014-10-11 13:26 ` Nicolas Iooss
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.