2002-08-29 00:37:47

by Tim Hockin

[permalink] [raw]
Subject: [PATCH} s390x sys32 duplicated code cleanup (was [PATCH RFC] s390x sys32...)

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.588 -> 1.589
# arch/s390x/defconfig 1.9 -> 1.10
# arch/s390x/config.in 1.10 -> 1.11
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/08/28 [email protected] 1.589
# S390x: make CONFIG_UID16 depend on legacy CONFIG_S390_SUPPORT
# --------------------------------------------
#
diff -Nru a/arch/s390x/config.in b/arch/s390x/config.in
--- a/arch/s390x/config.in Wed Aug 28 17:22:30 2002
+++ b/arch/s390x/config.in Wed Aug 28 17:22:30 2002
@@ -13,7 +13,6 @@
mainmenu_name "Linux Kernel Configuration"
define_bool CONFIG_ARCH_S390 y
define_bool CONFIG_ARCH_S390X y
-define_bool CONFIG_UID16 y

mainmenu_option next_comment
comment 'Code maturity level options'
@@ -25,6 +24,7 @@
bool 'Symmetric multi-processing support' CONFIG_SMP
bool 'Kernel support for 31 bit emulation' CONFIG_S390_SUPPORT
if [ "$CONFIG_S390_SUPPORT" = "y" ]; then
+ define_bool CONFIG_UID16 y
tristate 'Kernel support for 31 bit ELF binaries' CONFIG_BINFMT_ELF32
fi
endmenu
diff -Nru a/arch/s390x/defconfig b/arch/s390x/defconfig
--- a/arch/s390x/defconfig Wed Aug 28 17:22:30 2002
+++ b/arch/s390x/defconfig Wed Aug 28 17:22:30 2002
@@ -9,7 +9,6 @@
# CONFIG_GENERIC_BUST_SPINLOCK is not set
CONFIG_ARCH_S390=y
CONFIG_ARCH_S390X=y
-CONFIG_UID16=y

#
# Code maturity level options
@@ -21,6 +20,7 @@
#
CONFIG_SMP=y
CONFIG_S390_SUPPORT=y
+CONFIG_UID16=y
CONFIG_BINFMT_ELF32=y

#


Attachments:
s390x-2.4.x-uid16-1.patch (13.04 kB)
s390x-2.4.x-uid16-2.patch (1.66 kB)
Download all attachments

2002-09-04 18:15:20

by Tim Hockin

[permalink] [raw]
Subject: Re: [PATCH} s390x sys32 duplicated code cleanup (was [PATCH RFC] s390x sys32...)

Tim Hockin wrote:
> Martin Schwidefsky wrote:
>
>>> It seems to me that if we do:
>>> * s390x defines CONFIG_UID16
>>> * typedef __kernel_old_gid_t to u16
>>> * get rid of all the sys32_*16 stuff and just call the uid16.c function
>>
>>
>> I checked the code and didn't find any reason why this shouldn't work.
>> In fact with the 31 bit emulation layer the 64 bit kernel does need the
>> 16 bit uid/gid system calls although only for the emulation. To make it
>> really perfect you could define CONFIG_UID16 dependent on
>> CONFIG_S390_SUPPORT. This saves a few bytes in the image if the emulation
>> support is not enabled.

Uggh, DaveM pointed out a very good issue with this fix (similar for
Sparc64) and core files. Core files will now have truncated uid/gid
values because fs/binfmt_elf calls NEW_TO_OLD_UID(). May be other
places, too.

I guess you should not apply this patch until I've had a better think
about it.

Tim




--
Tim Hockin
Systems Software Engineer
Sun Microsystems, Linux Kernel Engineering
[email protected]

2002-09-05 07:31:54

by Martin Schwidefsky

[permalink] [raw]
Subject: Re: [PATCH} s390x sys32 duplicated code cleanup (was [PATCH RFC] s390x sys32...)


Hi Tim,

>Uggh, DaveM pointed out a very good issue with this fix (similar for
>Sparc64) and core files. Core files will now have truncated uid/gid
>values because fs/binfmt_elf calls NEW_TO_OLD_UID(). May be other
>places, too.
>
>I guess you should not apply this patch until I've had a better think
>about it.

Sad but true. And I don't see an easy way around it without changes
to fs/binfmt_elf.c.

blue skies,
Martin

Linux/390 Design & Development, IBM Deutschland Entwicklung GmbH
Sch?naicherstr. 220, D-71032 B?blingen, Telefon: 49 - (0)7031 - 16-2247
E-Mail: [email protected]