Linux 2.4.5-ac6
ftp://ftp.kernel.org/pub/linux/kernel/people/alan/2.4/ Intermediate diffs are available from http://www.bzimage.org
In terms of going through the code audit almost all the sound drivers still need fixing to lock against format changes during a read/write. Poll creating and starting a buffer as write does and also mmap during write, write during an mmap.
2.4.5-ac6
o Fix the cs46xx right this time (me)
o Further FATfs cleanup (OGAWA Hirofumi)
o ISDN PPP code cleanup, cvs tag update (Kai Germaschewski)
o Large amount of UFS file system cleanup (Al Viro)
o Move UFS file system to use dcache for metadata (Al Viro)
o Fix endianness problems in FATfs (Petr Vandrovec)
o Fix -ac quota crashes (Jan Kara)
o Fix bluetooth out of memory handling (Greg Kroah-Hartmann)
o Fix freevxfs readdir (Christoph Hellwig)
o Fix freevxfs sign/unsigned issues (Christoph Hellwig)
o Fix doctypos, other freevxfs cleanup (Christoph Hellwig)
o Fix flush_dirty_buffers warning (J A Magallon)
o Add Carlos Gorges to credits (Carlos Gorges)
o Further atm cleanup fixes (kmalloc/signedness) (Mitchell Blank)
o Fix hotplug variable in matroxfb (Petr Vandrovec)
o Fix ns558 crash (Vojtech Pavlik)
o Revert to Pete Zaitcev's khub locking (Pete Zaitcev)
| It works for me, Johannes changes don't seem to
o Fix usb Config.in breakage for input devices (Vojtech Pavlik)
o Add another 3c509 ISAPnP id (Marcus Meissner)
o Fix oopses and null checks on iphase (Mitchell Blank)
o CS46xx update (Thomas Woller)
o Fix mmap cornercase (Maciej Rozycki)
o Tidy up aironet and saa9730 delay abuse (Andrzej Krzysztofowicz)
o Force initial umask to be sane for broken (Andrew Tridgell)
init programs
o Teach CML1 to strip out <file: > from the (Eric Raymond)
Configure.help
o Resync with Eric's master Configure.help (Eric Raymond)
o Revert FIOQSIZE
o Fix missing copy_*_user in cosa driver (me)
| From Stanford tools
o Fix missing copy_*_user in eicon (me)
+ clean up ioctls a bit more
| From Stanford tools
o Fix use after free in lpbether (me)
| From Stanford tools
o Fix missing return in rose_dev (me)
| From Stanford tools
o Fix use after free in bpqether (me)
| From Stanford tools
2.4.5-ac5
o Fix bug introduced in cs46xx/trident locking (me)
o Fix reiserfs unload/exit locking race (Paul Mundt)
o Miscellaneous small UML updates (Jeff Dike)
o Further FAT cleanups (OGAWA Hirofumi)
o Fix ext2fs oops following disk error (Andreas Dilger)
o Optimise segment reloads, syscall path (Andi Kleen)
o Clean up .byte abuse where asm is now known (Brian Gerst)
by required tools
o Fix eepro100 on 64bit machine bitops bug (Andrea Arcangeli)
o Move the pagecache and pagemap_lru_lock to (Andrea Arcangeli)
different cache lines
o Clean up .byte abuse where asm is now known (Brian Gerst)
by required tools
o Fix user space dereference in bluetooth (me)
| From Stanford tools
o Fix user space dereference in sbc60wdt (me)
| From Stanford tools
o Fix user space dereference in mdc800 (me)
| From Stanford tools
o Fix a rather wrong memset in nubus.c (Chris Peterson)
o Remove fpu references from dmfe (Arjan van de Ven)
o Fix spelling of Portuguese (Nerijus Baliunas)
2.4.5-ac4
o APIC parsing updates (Ingo Molnar)
o Retry rather than losing I/O on an IDE DMA (Jens Axboe)
timeout.
o Add missing locking to cs46xx (Frank Davis)
o Clean up sym53c416 and add PnP support (me)
o Tidy up changelog in apm.c (Stephen Rothwell)
o Update jffs2, remove abuse of kdev_t (David Woodhouse)
o Fix oops on unplugging bluetooth (Greg Kroah-Hartmann)
o Move stuff into bss on aironet4500 (Rasmus Andersen)
o Fix up alpha oops output (George France)
o Update SysKonnect PCI id list (Mirko Lindner)
o Update SysKonnect GigE driver (Mirko Lindner)
o Add ATM DS3/OC12 definitions to atmdev.h (Mitchell Blank)
o Clean up atm drivers, fixed up user space (Mitchell Blank,
access with irqs off, kmalloc and use after John Levon)
free.
o Update input device/joystick/gameport drivers (Vojtech Pavlik)
o Update USB hid drivers (Vojtech Pavlik)
o Fix out of memory oops in hysdn (Rasmus Andersen)
o Belarussian should be Belarusian according to (Nerijus Baliunas)
the standards
o Support booting off old 720K floppies (Niels Jensen,
Chris Noe)
2.4.5-ac3
o Ignore console writes from an IRQ handler (me)
o Make SIGBUS/SIGILL visible to UML debugger (Jeff Dike)
o Clean up UML syscalls add missing items (Jeff Dike)
o Clean up non portable UML code (Jeff Dike)
o Fix off by one and other oddments in hostfs (Henrik Nordstrom)
o Update UML to use CONFIG_SMP not __SMP__ (Jeff Dike)
o Fix UML crash if console is typed at too early (Jeff Dike)
o Clean up UML host transports (Lennert Buytenhek,
Jim Leu)
o Resynchronize UML/ppc (Chris Emerson)
o Fix UML crash if it had an address space hole (Jeff Dike)
between text and data
o Fix rd_ioctl crash with initrd (Go Taniguchi)
o Fix IRQ ack path on Alpha rawhide (Richard Henderson)
o Drop back to older 8139too driver from 2.4.3
| Seems the new one causes lockups
o Experimental promise fastrak raid driver (Arjan van de Ven)
2.4.5-ac2
o Restore lock_kernel on umount (Al Viro)
| Should cure Reiserfs crash in 2.4.5
o Fix additional scsi_ioctl leak (John Martin)
o Clean up scsi_ioctl error handling (me)
o Configure.help typo fixes (Nerijus Baliunas)
o Fix hgafb problems with logos (Ferenc Bakonyi)
o Fix lock problems in the rio driver (Rasmus Andersen)
o Make new cmpci SMP safe (Carlos E Gorges)
o Fix missing restore flags in soundmodem (Rasmus Andersen)
o Set max sectors in ps2esdi (Paul Gortmaker)
o Fix interrupt restore problems in mixcom (Rasmus Andersen)
o Fix alpha compile on dp264/generic (Andrea Arcangeli)
o Fix irda irport locking restores (Rasmus Andersen)
o Fix failed kmalloc handling in hisax (Kai Germaschewski)
o Add missing memory barrier in qlogicisp (?)
o Fix missing restore_flags in eata_dma (Rasmus Andersen)
o Fix procfs locking in irttp (Rasmus Andersen)
o Winbond updates (Manfred Spraul)
o Stop network eating PF_MEMALLOC ram (Manfred Spraul)
o Drop fs/buffer.c low mem flush changes (me)
o Drop changes to mm/highmem.c (me)
| I don't think the Linus one is quite right but its easier | for everyone to be working off one base
o Revert GFP_FAIL and some other alloc bits (me)
o Hopefully fix initrd problem (me)
o Fix kmalloc check in ide-tape (Rasmus Andersen)
o Fix irda irtty locking (Rasmus Andersen)
o Fix missing irq restore in qla1280 (Rasmus Andersen)
o Fix proc/pid/mem cross exec behaviour (Arjan van de Ven)
o Fix direct user space derefs in eicon (me)
| From Stanford checker
o Fix direct user space derefs in ipddp (me)
| From Stanford checker
o Fix direct user space derefs in ixj (me)
| From Stanford checker
o Fix direct user space derefs in decnet (me)
| From Stanford checker
2.4.5-ac1
o Merge Linus 2.4.5 tree
Summary of changes for Linux 2.4.5-ac versus Linus 2.4.5
o Fix memory leak in wanrouter
o Fix memory leak in wanmain
o Use non atomic memory for linearising NFS buffers as they are
done in task context
o Fix dereference of freed memory in NetROM drivers
o Fix writing to freed memory in ax25_ip
o Support debugging of slab pools
o NinjaSCSI pcmcia scsi driver
o Raw HID device for USB peripheral buttons/controllers
o Updated NTFS
o RAMfs with resource limits
o NMI watchdog available on uniprocessor x86
o Update CMPCI drivers (not yet SMP safe)
o Configurable max_map_count
o Dynamic sysctl key registration
o SE401 USB camera driver
o Updated Zoran ZR3606x driver (replaces buz)
o w9966 parallel port camera driver (partially merged with Linus)
o Include headers in etags
o Don't delete empty directories on make distclean
o Fix halt/reboot handling on Alcor Alpha
o IDE driver support for Etrax E100
o IDE infrastructure support for IDE using non standard data transfers
o Run ~/bin/installkernel if present
o Support for out of order stores on x86 with this mode (IDT Winchip)
- worth 20% performance on them
o Configure level debugging menu
o Make BUG() default to an oops only - saves 70K
o Power management help for UP-APIC
o Work around 440BX APIC hang (eg the ne2000 SMP hang)
o Run time configurable APM behaviour (interrupts, psr etc)
o Smarter DMI parser - handles multiple use of names
o DMI layer has blacklist tables fixing Dell Inspiron 5000e crashes,
PowerEdge reboot problems , and IBM laptop APM problems
o PNPBios support
o Fix atomicity of IRQ error count
o Handle PCI/ISA boxes that don't list edge levels but have an ELCR
o Don't erroneously mangle settings on all VIA bridges - cures the
horrible performance problem in 2.4.5 vanilla with VIA
o Fix bootmem corruption on x86 boot
o Scan and retrieve multipliers for processors (not yet used to handle
the SMP cases where we need to disable tsc use)
o Support machine check on Athlon and Pentium
o Fix SUS violation with signal stacks
o Handle boxes where firmware resets the timer to 18Hz (this should
now not show false positives)
o Better OOPS formatting on x86
o Fix nasty problems with interrupts being disabled for long periods
in frame buffer drivers
o PAE mode alignment assumption fixes
o 32bit UID clean quota
o Fix quota deadlocks
o Fix TLB shootdown races
o Experimental merge of usermode Linux
o Fix memory leaks and othe rproblems with the iphase driver
o IBM AS/400 iSeries virtual drivers
o DAC960 null pointer checks
o CCISS driver leak fixes
o MPT fusion drivers for scsi and networking
o Handle out of memory allocating request queue entries and avoid oops
o Free the initial ramdisk correctly
o Small CD-ROM layer updates
o AGP power management hooks
o First basic applicom driver fixes
o Fix copy_from_user with interrupts off in cyclades driver
o Fix out of memory handling in DRM
o Clean up dsp56K driver
o Update generic serial driver with break support
o Clean up h8 driver namespace
o Fix keymap changing problems in console drivers
o Fix locking in machzwd
o Updated rio serial driver
o A2232 driver
o Fix serial driver mangling of some clone uarts
o Handle xircom serial port setup delay bug
o Updated sx driver for newer generic_serial
o W83877F watchdog driver
o ITE8172 IDE driver support
o Q40/Q60 IDE support
o Fix nodma handling bug in alim15x3
o hpt366 DMA blacklist
o IDE-CD updates
o Updated IDE DMA blacklist
o OOPS catch for sg reuse in IDE driver
o Support formatting of IDE floppies
o Support PIIX4U4 (851EM)
o Enable second port on promise pseudo raid
o Support nodma on pmac
o Support more PCI irq sharing on IDE
o IDE tape updates - DI-50 support,
o Much updated VIA IDE support
o video1394 updated to newer module API
o Support write on the input event driver
o Quieten mouse and keyboard input drivers
o Fix compile problem with pc110pad
o Fix memory leak in isdnppp
o LVM updates
o Fix plan b locking
o Fix saa5249 locking
o Fix stradis locking
o Acenic driver updates
o aironet4500 cleanups, probe tables
o Ariadne updated to newer API
o Don't limit mtu to 68+ in arlan drivers
o Updated eepro100 driver
o Fix potential crash on downing a bpqether port
o Updated nsc-ircc driver
o Updated toshoboe driver
o Intel Panther LP486e ethernet driver
o Remove erroneous check in eth_change_mtu
o Alternative xircom_cb driver
o Avoid ibm tr being rebuilt each make
o Updated ibm token ring drivers
o Add 'static' to bits of ppp code
o Add pci probe table to roadrunner
o Fix memory leak in sk_ge
o sk_g16 updates
o sk_mca updates
o Add tools to generate starfire firmware
o Synclink driver can be compiled in
o Fix possible oops in lapbether
o Fix memory leak in lanmedia driver
o Fix SDLA_X25 warnings
o Fix syncppp negotiation loop bug
o GSC parallel port support
o PCMCIA parallel port support
o Support PnPBIOS probing for PC parallel ports
o Fix leak in PCMCIA bulkmem driver
o Fix leak in PCMCIA ds driver
o Add more cards to the ti list for the yenta pcmcia
o Updated 3ware scsi driver
o NCR 53c700 and 53c700/66 driver core
o Fix pci_enable/resource read order on buslogic
o Updated NCR53c8xx driver
o Updated SYM53c8xx driver
o Fix NCR53c406 warnings
o NCR dual MCA driver
o AIC7xxx pci probe table for hotplug
o Updated aic7xxx_old
o Fix resource leaks in dec esp driver
o Fix printk levels in dmx3191 driver
o Allow per device max sector counts. (2.4 workaround until 2.5 does
this in the block layer per device)
o Support SCSI2/SCSI3 extended LUN numbering
o Limit qlogicisp and qlogicpti to 64 sectors/write
o Fix missing EFAULT return in scsi proc
o Fix locking of scsi_unregister_host
o Fix leaks in scsi_ioctl
o Fix potential lost requests in scsi merges
o Fix leak on write when scsi driver has no proc write op
o Extend the scsi black/whitelist
o Fix locking/eject/rescan on removable scsi disk media
o Updated scsi generic driver
o Updated scsi cdrom driver
o Correct ac97 handling on sparc
o Fix use after kfree in cs4281
o Update ess solo to new PCI style and PM
o Update maestro to new PCI style and PM
o Add docking station support to maestro
o Update sonicvies to new PCI api
o Fix trident locking problems
o Fix buzzing on ymfpci
o Power management for ymfpci
o Fix leak/missized copy on xjack driver
o CDCEther driver
o ACM driver with fixed CLOCAL
o Updated USB audio drivers
o Fix locking/reporting in USB device list
o Allow dsbr100 to take a radio_nr option
o HP5300 series USB scanner driver
o Updated IBM cam driver
o Fix USB inode locking
o Driver for Kawasaki based USB ethernet
o Small ov511 fixes
o Updated USB storage drivers
o Entries for Sony MSC-U01N memory stick, Fujifilm FinePix 1400Zoom,
Casio QV Digial Camera
o USB Ultracam driver
o Fix derefence of freed memory in the USB code
o Generic USB host->host drivers for anchorchip 2270, ipaq, netchip
1080, and Prolific PL-2301/2
o Updated ATI frame buffer drivers
o Updated clgen and control frame buffer drivers
o Updated cyber2000 driver
o Documentation for fbcon driver
o Additional modes for titanium powerbook (1152x768)
o Updated matrxofb drivers
o Support __setup in mdacon
o Radeon console driver
o Handle out of memory on sun3 fb
o Updated tga/vesa fb
o CMS file system (basic R/O)
o JFFS journalling flash file system with compression
o Updated AFFS file system
o Threaded core dumps
o Fix security holes in binfmt_misc
o Allow flushing of low buffers only when we need bounce buffers
o Use brelse in cramfs
o Fix memory leaks in freevxfs
o Updated isofs
o Small lockd updates (experimental)
o Fix nfs alignment funnies
o Report correct SuS errors on some opens
o Add generic_file_open to get 64bit stuff right
o Locking on make_inode_number for procfs
o Report shmem size in shared memory proc field
o Fail lseek outside of allowed range for filesystem
o Fix select race with fdset growth
o Kernel message levels and handle oom on superblock/mount ops
o Updated frame buffer logos
o Prefetch support for AMD Athlon
o Support out of order stores in spinlocks on x86
o m68k bitop compile fixes
o Add truncatepage op to address operations
o shmem filesystem cleanups and updates
o Fix off by one on real time pre-emption in scheduler
o Use prefetches in scheduler and wakeups
o Support GFP_FAIL to avoid highmem deadlocks
---
Alan Cox <[email protected]>
Red Hat Kernel Hacker
& Linux 2.2 Maintainer Brainbench MVP for TCP/IP
http://www.linux.org.uk/diary http://www.brainbench.com
Quoted 4 lines · Alan Cox
o Fix the cs46xx right this time (me)
o Further FATfs cleanup (OGAWA Hirofumi)
o ISDN PPP code cleanup, cvs tag update (Kai Germaschewski)
o Large amount of UFS file system cleanup (Al Viro)
Tt's still broken on r/w. R/o should be OK now.
Quoted 1 line
o Move UFS file system to use dcache for metadata (Al Viro)
What???
Quoted 5 lines
Tt's still broken on r/w. R/o should be OK now.
Quoted 1 line
o Move UFS file system to use dcache for metadata (Al Viro)
What???
My error. I was pasting down the notes when you were talking about that bit on #kernel and forgot to take it out
ftp://oss.sgi.com/projects/kdb/download/ix86/kdb-v1.8-2.4.5-ac6.gz is available.
Quoted 1 line
o Fix mmap cornercase (Maciej Rozycki)
when i try running osf/1 netscape on alpha, mmap of libXmu fails. works fine on -ac5.
Signature · 2 lines
Tom Vier <[email protected]> DSA Key id 0x27371A2C
Quoted 4 lines · Tom Vier
Quoted 1 line
o Fix mmap cornercase (Maciej Rozycki)
when i try running osf/1 netscape on alpha, mmap of libXmu fails. works fine on -ac5.
Can you get a strace of your failing netscape?
Signature · 3 lines
+ Maciej W. Rozycki, Technical University of Gdansk, Poland + +--------------------------------------------------------------+ + e-mail: [email protected], PGP key available +
Quoted 4 lines · Tom Vier
Quoted 1 line
o Fix mmap cornercase (Maciej Rozycki)
when i try running osf/1 netscape on alpha, mmap of libXmu fails. works fine on -ac5.
Indeed. Netscape is essentially 32 bit application, so probably it treats TASK_UNMAPPED_BASE (0x20000000000) as failure. A tad more respect of specified address fixes that. Also small fix for endless compile warnings with gcc 3.0 on alpha (`struct mm_struct' declared inside parameter list).
Ivan.
mm/mmap.c +7 -4
@@ -404,10 +404,13 @@ static inline unsigned long arch_get_unmif (addr) { addr =PAGE_ALIGN (addr); - vma =find_vma (current->mm, addr); -if (TASK_SIZE - len >= addr && - (!vma || addr + len <= vma->vm_start)) -return addr; +for (vma =find_vma (current->mm, addr); ; vma = vma->vm_next) { +if (TASK_SIZE - len < addr) +break ; +if (!vma || addr + len <= vma->vm_start) +return addr; + addr = vma->vm_end; + } } addr =PAGE_ALIGN (TASK_UNMAPPED_BASE );
include/linux/binfmts.h +3 -0
@@ -32,6 +32,9 @@ struct linux_binprm{unsigned long loader, exec; }; +/* Forward declaration */ +struct mm_struct ; +/* * This structure defines the functions that are used to load the binary formats that * linux accepts.
Quoted 3 lines · Ivan Kokshaysky
Indeed. Netscape is essentially 32 bit application, so probably it treats
TASK_UNMAPPED_BASE(0x20000000000) as failure. A tad more respect of specified address fixes that.
Iterating over memory areas twice is ugly. Tom, could you please try the
following patch? It should make things better with less ugliness.
Signature · 90 lines
+ Maciej W. Rozycki, Technical University of Gdansk, Poland + +--------------------------------------------------------------+ + e-mail: [email protected], PGP key available + patch-2.4.5-ac8-mmap-7 diff -up --recursive --new-file linux-2.4.5-ac8.macro/arch/ia64/kernel/sys_ia64.c linux-2.4.5-ac8/arch/ia64/kernel/sys_ia64.c --- linux-2.4.5-ac8.macro/arch/ia64/kernel/sys_ia64.c Tue Jun 5 14:22:10 2001 +++ linux-2.4.5-ac8/arch/ia64/kernel/sys_ia64.c Tue Jun 5 14:46:14 2001 @@ -39,11 +39,15 @@ arch_get_unmapped_area (struct file *fil rgn_offset(addr) + len <= RGN_MAP_LIMIT) && (!vmm || addr + len <= vmm->vm_start)) return addr; + if (addr > TASK_UNMAPPED_BASE) + addr = 0; + } + if (!addr) { + if (flags & MAP_SHARED) + addr = COLOR_ALIGN(TASK_UNMAPPED_BASE); + else + addr = PAGE_ALIGN(TASK_UNMAPPED_BASE); } - if (flags & MAP_SHARED) - addr = COLOR_ALIGN(TASK_UNMAPPED_BASE); - else - addr = PAGE_ALIGN(TASK_UNMAPPED_BASE); for (vmm = find_vma(current->mm, addr); ; vmm = vmm->vm_next) { /* At this point: (!vmm || addr < vmm->vm_end). */ diff -up --recursive --new-file linux-2.4.5-ac8.macro/arch/sparc/kernel/sys_sparc.c linux-2.4.5-ac8/arch/sparc/kernel/sys_sparc.c --- linux-2.4.5-ac8.macro/arch/sparc/kernel/sys_sparc.c Tue Jun 5 14:22:10 2001 +++ linux-2.4.5-ac8/arch/sparc/kernel/sys_sparc.c Tue Jun 5 14:39:49 2001 @@ -69,11 +69,15 @@ unsigned long arch_get_unmapped_area(str if (TASK_SIZE - PAGE_SIZE - len >= addr && (!vmm || addr + len <= vmm->vm_start)) return addr; + if (addr > TASK_UNMAPPED_BASE) + addr = 0; + } + if (!addr) { + if (flags & MAP_SHARED) + addr = COLOUR_ALIGN(TASK_UNMAPPED_BASE); + else + addr = PAGE_ALIGN(TASK_UNMAPPED_BASE); } - if (flags & MAP_SHARED) - addr = COLOUR_ALIGN(TASK_UNMAPPED_BASE); - else - addr = PAGE_ALIGN(TASK_UNMAPPED_BASE); for (vmm = find_vma(current->mm, addr); ; vmm = vmm->vm_next) { /* At this point: (!vmm || addr < vmm->vm_end). */ diff -up --recursive --new-file linux-2.4.5-ac8.macro/arch/sparc64/kernel/sys_sparc.c linux-2.4.5-ac8/arch/sparc64/kernel/sys_sparc.c --- linux-2.4.5-ac8.macro/arch/sparc64/kernel/sys_sparc.c Tue Jun 5 14:22:10 2001 +++ linux-2.4.5-ac8/arch/sparc64/kernel/sys_sparc.c Tue Jun 5 14:44:19 2001 @@ -76,11 +76,15 @@ unsigned long arch_get_unmapped_area(str if (task_size >= addr && (!vmm || addr + len <= vmm->vm_start)) return addr; + if (addr > TASK_UNMAPPED_BASE) + addr = 0; + } + if (!addr) { + if (flags & MAP_SHARED) + addr = COLOUR_ALIGN(TASK_UNMAPPED_BASE); + else + addr = PAGE_ALIGN(TASK_UNMAPPED_BASE); } - if (flags & MAP_SHARED) - addr = COLOUR_ALIGN(TASK_UNMAPPED_BASE); - else - addr = PAGE_ALIGN(TASK_UNMAPPED_BASE); for (vmm = find_vma(current->mm, addr); ; vmm = vmm->vm_next) { /* At this point: (!vmm || addr < vmm->vm_end). */ diff -up --recursive --new-file linux-2.4.5-ac8.macro/mm/mmap.c linux-2.4.5-ac8/mm/mmap.c --- linux-2.4.5-ac8.macro/mm/mmap.c Tue Jun 5 14:22:29 2001 +++ linux-2.4.5-ac8/mm/mmap.c Tue Jun 5 14:45:57 2001 @@ -408,8 +408,11 @@ static inline unsigned long arch_get_unm if (TASK_SIZE - len >= addr && (!vma || addr + len <= vma->vm_start)) return addr; + if (addr > TASK_UNMAPPED_BASE) + addr = 0; } - addr = PAGE_ALIGN(TASK_UNMAPPED_BASE); + if (!addr) + addr = PAGE_ALIGN(TASK_UNMAPPED_BASE); for (vma = find_vma(current->mm, addr); ; vma = vma->vm_next) { /* At this point: (!vma || addr < vma->vm_end). */
Quoted 1 line · Maciej W. Rozycki
Iterating over memory areas twice is ugly.
Hmm, yes. However, your patch isn't pretty, too. You may check the same area twice, and won't satisfy requested address > TASK_UNMAPPED_BASE. What do you think about following? Everything is scanned only once, and returned address matches specified one as close as possible.
Ivan.
mm/mmap.c renamed from mm/mmap.c.orig +13 -5
@@ -398,22 +398,30 @@ free_vma:static inline unsigned long arch_get_unmapped_area (struct file *filp,unsigned long addr,unsigned long len,unsigned long pgoff,unsigned long flags) {struct vm_area_struct *vma; +unsigned long addr_limit =TASK_SIZE - len;if (len >TASK_SIZE )return -ENOMEM ;if (addr) { addr =PAGE_ALIGN (addr); - vma =find_vma (current->mm, addr); -if (TASK_SIZE - len >= addr && - (!vma || addr + len <= vma->vm_start)) -return addr; +if (addr <=TASK_UNMAPPED_BASE ) + goto scan_low; + addr_limit = addr; +for (vma =find_vma (current->mm, addr); ; vma = vma->vm_next) { +if (TASK_SIZE - len < addr) +break ; +if (!vma || addr + len <= vma->vm_start) +return addr; + addr = vma->vm_end; + } } addr =PAGE_ALIGN (TASK_UNMAPPED_BASE ); +scan_low:for (vma =find_vma (current->mm, addr); ; vma = vma->vm_next) {/* At this point: (!vma || addr < vma->vm_end). */ -if (TASK_SIZE - len < addr) +if (addr_limit < addr)return -ENOMEM ;if (!vma || addr + len <= vma->vm_start)return addr;
Quoted 2 lines · Ivan Kokshaysky
Hmm, yes. However, your patch isn't pretty, too. You may check the same area twice, and won't satisfy requested address >
TASK_UNMAPPED_BASE.
Only a single address may be checked twice. There is no second loop I'm
trying to avoid. The loop starts from addr or TASK_UNMAPPED_BASE, whichever is lower. If that won't succeed you won't be able to mmap anything anyway.
Quoted 2 lines
What do you think about following? Everything is scanned only once, and returned address matches specified one as close as possible.
No, no, no... The address specified is a hint only and the system is
free to use any other. Actually this patch made me curious, why we should change the limit -- TASK_SIZE is fine in all cases. After a bit of studying of Alpha headers, I concluded none of the patches is needed at all, because TASK_UNMAPPED_BASE is set to:
((current->personality & ADDR_LIMIT_32BIT) ? 0x40000000 : TASK_SIZE / 2)
to support 32-bit binaries. So if the personality is set appropriately for netscape, mmap() should work fine as is, placing maps in the low 4GB. No need to patch arch_get_unmapped_area(), but OSF/1 compatibility code might need fixing. I suppose an OSF/1 binary must have an appropriate flag set in its header after building with the -taso option so that the system knows the binary wants 32-bit addressing.
I have no Alpha/Linux system available anymore -- could anyone else check
what the real problem with netscape is?
Maciej
Signature · 3 lines
+ Maciej W. Rozycki, Technical University of Gdansk, Poland + +--------------------------------------------------------------+ + e-mail: [email protected], PGP key available +
Quoted 4 lines · Maciej W. Rozycki
((
current->personality&ADDR_LIMIT_32BIT) ?0x40000000:TASK_SIZE/ 2)to support 32-bit binaries. So if the personality is set appropriately for netscape,
mmap()should work fine as is, placing maps in the low 4GB.
This works perfectly with ELF, but unfortunately netscape isn't recognized as 32 bit binary.
Quoted 4 lines
No need to patch
arch_get_unmapped_area(), but OSF/1 compatibility code might need fixing. I suppose an OSF/1 binary must have an appropriate flag set in its header after building with the -taso option so that the system knows the binary wants 32-bit addressing.
I'm not sure if COFF headers have such flag at all. I'll check this.
Ivan.
Quoted 6 lines · Ivan Kokshaysky
Quoted 4 lines
No need to patch
arch_get_unmapped_area(), but OSF/1 compatibility code might need fixing. I suppose an OSF/1 binary must have an appropriate flag set in its header after building with the -taso option so that the system knows the binary wants 32-bit addressing.I'm not sure if COFF headers have such flag at all. I'll check this.
Then how does OSF/1, especially the dynamic linker, know if a binary
needs 32-bit addressing? I suppose we could use the same way of selection.
Hmm...:
$ uname -mprsv
OSF1 V4.0 1091 alpha alpha
$ file /usr/bin/X11/real-netscape
/usr/bin/X11/real-netscape: COFF format alpha dynamically linked,
demand paged executable or object module stripped - version 3.11-8
$ odump -D /usr/bin/X11/real-netscape | grep FLAGS
FLAGS: 0x40000001
$ odump -D /usr/bin/X11/xterm | grep FLAGS
FLAGS: 0x00000001A wild guess: the 32-bit flag is bit 30.
A second attempt (after a bit of searching in /usr/include):
$ grep ADDRESSES /usr/include/elf_mips.h #define RHF_USE_31BIT_ADDRESSES 0x40000000
Ah, here it is. Remember OSF/1 was running on MIPS (DECstation) first and they never used ELF but apparently reused a few of its properties.
So what is needed is already in place and ready to use.
Maciej
Signature · 3 lines
+ Maciej W. Rozycki, Technical University of Gdansk, Poland + +--------------------------------------------------------------+ + e-mail: [email protected], PGP key available +
Quoted 8 lines · Maciej W. Rozycki
Quoted 5 lines · Ivan Kokshaysky
Quoted 4 lines
No need to patch
arch_get_unmapped_area(), but OSF/1 compatibility code might need fixing. I suppose an OSF/1 binary must have an appropriate flag set in its header after building with the -taso option so that the system knows the binary wants 32-bit addressing.
Quoted 5 lines
Quoted 1 line
I'm not sure if COFF headers have such flag at all. I'll check this.
Then how does OSF/1, especially the dynamic linker, know if a binary
needs 32-bit addressing? I suppose we could use the same way of selection.
There are two things you can do here, one is easy: use linker tricks to make sure that an application built on alpha -- with 64-bit pointers -- uses no more than the lower 32 bits of each pointer for addressing. This should fix a ton of applications which cast pointer values to ints and similar garbage.
The other option, hacking gcc to output "32-bit alpha" binary code, is a tougher job.
I had mentioned this to Richard Henderson a while back, when I was wondering how easy it is to implement -taso under Linux, and IIRC he seemed to think that linker tricks were much easier.
Jeff
Signature · 3 lines
Jeff Garzik | An expert is one who knows more and more about Building 1024 | less and less until he knows absolutely everything MandrakeSoft | about nothing.
Quoted 5 lines · Jeff Garzik
There are two things you can do here, one is easy: use linker tricks to make sure that an application built on alpha -- with 64-bit pointers -- uses no more than the lower 32 bits of each pointer for addressing. This should fix a ton of applications which cast pointer values to ints and similar garbage.
Note we are only writing of executing an OSF/1 netscape binary. The
binary is built with the -taso option on OSF/1 and is linked fine with respect to 31-bit pointers. It fails when mmap()ping shared libraries after applying my patch that went to -ac series recently. Since OSF/1 shared libraries are PIC, there should be no problem to mmap() them into the low 2GB provided mmap() know we want it. And mmap() has already all needed bits in place -- it's the ECOFF support on Alpha/Linux that does not set the personality as it should.
Quoted 6 lines
The other option, hacking gcc to output "32-bit alpha" binary code, is a tougher job.
I had mentioned this to Richard Henderson a while back, when I was wondering how easy it is to implement -taso under Linux, and IIRC he seemed to think that linker tricks were much easier.
It might be unavoidable to prevent shared libraries from being mmap()ped
outside the 31-bit address space unless we hint the dynamic linker somehow. Implementing the -taso option is trivial -- all it actually does on OSF/1 is mapping program's segments into low 2GB of memory (we may do it by selecting a different linker script) and setting the "31-bit address space flag" in the program's header so that the dynamic linker mmap()s shared libraries appropriately as well. We do have all the bits in place already as well.
Note that personally I'm strongly against the -taso approach -- it's a
hack to be meant as an excuse for fixing broken programs. But fixing programs is not that difficult (though it might be boring and time-consuming). I've already did a conversion of a moderately sized DOS program to *nix. The program was twisted by far and near pointers and casts to ints and longs (depending on the pointer type) scattered over the source. It took me about two weeks worth of full-time work (assuming eight hours per day; the actual time elapsed was longer, but I was only doing it in my free time) to make the program working on i386/Linux, another week to port it to Alpha/Linux (i.e. make it 64-bit clean) and yet another day to make it work on SPARC/Solaris (i.e. make it endianness-clean). The program was checked to be running fine on MIPS/Ultrix and Alpha/OSF/1 afterwards as well. Therefore I see no point in keeping programs broken. If a vendor is not willing to fix a non-open-sourced broken program, then maybe the program is just not worth attention.
Maciej
Signature · 3 lines
+ Maciej W. Rozycki, Technical University of Gdansk, Poland + +--------------------------------------------------------------+ + e-mail: [email protected], PGP key available +
Quoted 6 lines · Maciej W. Rozycki
$ odump -D /usr/bin/X11/real-netscape | grep FLAGS FLAGS: 0x40000001 $ odump -D /usr/bin/X11/xterm | grep FLAGS FLAGS: 0x00000001A wild guess: the 32-bit flag is bit 30.
Thanks for the info. I dug a bit that OSF stuff (on Compaq's testdrive boxes), and found no traces of 32-bit addressing support in the OSF kernel. Everything seems to be done by dynamic linker (i.e. /sbin/loader) in user space.
Quoted 4 lines
A second attempt (after a bit of searching in
/usr/include):$ grep ADDRESSES /usr/include/elf_mips.h #define RHF_USE_31BIT_ADDRESSES 0x40000000
Same in /usr/include/coff_dyn.h, True64 v5.1.
Quoted 1 line
So what is needed is already in place and ready to use.
I don't think so. The EF_ALPHA_32BIT in the ELF header flags is elegant and easy to use. Unlike this, RHF_USE_31BIT_ADDRESSES is not in the headers, but somewhere in .dynamic section. And what about a static binary calling mmap()? ;-)
BTW, OSF/1 manpages say nothing about first argument of mmap(2) being just a hint:
...
PARAMETERS
addr Specifies the starting address of the new region (truncated to a
page boundary).
len Specifies the length in bytes of the new region (rounded up to a
page boundary).
...
Ivan.
Quoted 4 lines · Maciej W. Rozycki
Quoted 3 lines · Jeff Garzik
I had mentioned this to Richard Henderson a while back, when I was wondering how easy it is to implement -taso under Linux, and IIRC he seemed to think that linker tricks were much easier.
Yes, it was discussed on the axp-list a while back. After that I've hacked the ld for -taso, and it went into official binutils about a year ago.
$ ld -v
GNU ld version 2.10.91 (with BFD 2.10.91.0.2)
$ ld -help
...
ld: emulation specific options:
elf64alpha:
-Bgroup Selects group name lookup rules for DSO
...
-taso Load executable in the lower 31-bit addressable
virtual address range
...Quoted 2 lines
Note that personally I'm strongly against the -taso approach -- it's a
hack to be meant as an excuse for fixing broken programs.
Exactly. However, there are situations when you have only two options:
rewrite from scratch or use -taso. Netscape vs. mozilla is a good example. :-)
Ivan.
Quoted 4 lines · Ivan Kokshaysky
Thanks for the info. I dug a bit that OSF stuff (on Compaq's testdrive boxes), and found no traces of 32-bit addressing support in the OSF kernel. Everything seems to be done by dynamic linker (i.e.
/sbin/loader) in user space.
Their docs imply just that.
Quoted 3 lines
I don't think so. The
EF_ALPHA_32BITin the ELF header flags is elegant and easy to use. Unlike this,RHF_USE_31BIT_ADDRESSESis not in the headers, but somewhere in .dynamic section. And what
You are right.
Quoted 1 line
about a static binary calling
mmap()? ;-)
DU seems to map as low as possible, it would seem. Maybe we could just
do the same for OSF/1 binaries by setting TASK_UNMAPPED_BASE appropriately?
Quoted 2 lines
BTW, OSF/1 manpages say nothing about first argument of mmap(2) being just a hint:
Nope, see:
The new region is placed at the requested address if the requested address is not null and it is possible to place the region at this address. When the requested address is null or the region cannot be placed at the requested address, the MAP_VARIABLE and MAP_FIXED flags control the place- ment of the region. One of these flags must be selected.
If MAP_VARIABLE is set in the flags parameter:
+ If the requested address is null or if it is not possible for the sys- tem to place the region at the requested address, the region is placed at an address selected by the system.
If MAP_FIXED is set in the flags parameter:
[...]
We don't have MAP_VARIABLE but it's expands to zero in OSF/1 anyway.
Maciej
Signature · 3 lines
+ Maciej W. Rozycki, Technical University of Gdansk, Poland + +--------------------------------------------------------------+ + e-mail: [email protected], PGP key available +
Quoted 5 lines · Ivan Kokshaysky
Quoted 2 lines
Note that personally I'm strongly against the -taso approach -- it's a
hack to be meant as an excuse for fixing broken programs.Exactly. However, there are situations when you have only two options:
rewrite from scratch or use -taso. Netscape vs. mozilla is a good example. :-)
Why can't mozilla be fixed? With the -taso option there is actually less
encouragement to do so.
Signature · 3 lines
+ Maciej W. Rozycki, Technical University of Gdansk, Poland + +--------------------------------------------------------------+ + e-mail: [email protected], PGP key available +
Quoted 7 lines · Maciej W. Rozycki
Quoted 2 lines · Ivan Kokshaysky
Exactly. However, there are situations when you have only two options:
rewrite from scratch or use -taso. Netscape vs. mozilla is a good example. :-)Why can't mozilla be fixed? With the -taso option there is actually less
encouragement to do so.
Mozilla is fine. Its netscape 4.X that probably needs -taso.
Jim
Quoted 1 line · Maciej W. Rozycki
DU seems to map as low as possible, it would seem.
Yes, I've just checked, starting at 64K...
Quoted 3 lines
Maybe we could just
do the same for OSF/1 binaries by settingTASK_UNMAPPED_BASEappropriately?
No. I've changed in load_aout_binary() set_personality(PER_LINUX) to set_personality(PER_LINUX_32BIT), and now I have another error. You will laugh, but...
$ netscape 665:/usr/lib/netscape/netscape-communicator: : Fatal Error: mmap available address is not larger than requested
This happens aftermmap(0x7fdc8000, 40960, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40018000
And note, this is the message from loader, not from netscape itself. So I think my second patch is an easiest solution for now. Look, compared with the code in Linus' tree:
- it doesn't add any overhead in general case (addr == 0);
- if the specified address is too high and we can't find a free area above it, we just continue search from TASK_UNMAPPED_BASE as usual;
- if address is too low, extra cost is only compare and taken branch. I think it's clean enough.
Ivan.
Quoted 2 lines · Maciej W. Rozycki
Why can't mozilla be fixed? With the -taso option there is actually less
encouragement to do so.
Mozilla is 64-bit clean. Roughly speaking, I meant that mozilla is [cleanly] fixed netscape, but that "fix" took 2 years and lot of people involved, and still it's not quite usable. But we're way OT...
Ivan.
Quoted 11 lines · Ivan Kokshaysky
No. I've changed in
load_aout_binary()set_personality(PER_LINUX)toset_personality(PER_LINUX_32BIT), and now I have another error. You will laugh, but...$ netscape 665:/usr/lib/netscape/netscape-communicator: : Fatal Error: mmap available address is not larger than requestedThis happens after
mmap(0x7fdc8000, 40960, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)=0x40018000And note, this is the message from loader, not from netscape itself.
Oh well, so they cheat -- they claim in their docs the kernel may choose
whatever address it considers appropriate and then rely on particular behaviour. What for, I wonder... I guess they weren't able to resolve signedness issues...
Quoted 7 lines
So I think my second patch is an easiest solution for now. Look, compared with the code in Linus' tree:
- it doesn't add any overhead in general case (addr == 0);
- if the specified address is too high and we can't find a free area above it, we just continue search fromTASK_UNMAPPED_BASEas usual;
- if address is too low, extra cost is only compare and taken branch.
That's all fine, but...
Quoted 1 line
I think it's clean enough.
Still it has two loops... I'm not sure how to eliminate one of them at
the moment, though. I think we might also consider moving the compatibility crap into arch/alpha/kernel.
Signature · 3 lines
+ Maciej W. Rozycki, Technical University of Gdansk, Poland + +--------------------------------------------------------------+ + e-mail: [email protected], PGP key available +
Quoted 10 lines · On Fri, 8 Jun 2001 [email protected] wrote:
Quoted 7 lines · Maciej W. Rozycki
Quoted 2 lines · Ivan Kokshaysky
Exactly. However, there are situations when you have only two options:
rewrite from scratch or use -taso. Netscape vs. mozilla is a good example. :-)Why can't mozilla be fixed? With the -taso option there is actually less
encouragement to do so.Mozilla is fine. Its netscape 4.X that probably needs -taso.
And only the old netscape 4.x releases at that afik the newer releases are all compiled ELF.
Gerhard
--
Gerhard Mack
<>< As a computer I find your faith in technology amusing.
Quoted 4 lines · Maciej W. Rozycki
Oh well, so they cheat -- they claim in their docs the kernel may choose
whatever address it considers appropriate and then rely on particular behaviour. What for, I wonder... I guess they weren't able to resolve signedness issues...
*Sigh*. Do not trust docs... even DEC docs :-(
Quoted 2 lines
Still it has two loops... I'm not sure how to eliminate one of them at
the moment, though.
Me either; I'll think about that.
Quoted 2 lines
I think we might also consider moving the
compatibility crap intoarch/alpha/kernel.
This also would be acceptable, IMO.
Ivan.
Quoted 1 line · Maciej W. Rozycki
Still it has two loops...
Ok, here is a single loop version.
Ivan.
mm/mmap.c +16 -6
@@ -398,27 +398,37 @@ free_vma:static inline unsigned long arch_get_unmapped_area (struct file *filp,unsigned long addr,unsigned long len,unsigned long pgoff,unsigned long flags) {struct vm_area_struct *vma; +unsigned long addr_limit =TASK_SIZE - len; +unsigned long addr1 =0 ;if (len >TASK_SIZE )return -ENOMEM ;if (addr) { addr =PAGE_ALIGN (addr); - vma =find_vma (current->mm, addr); -if (TASK_SIZE - len >= addr && - (!vma || addr + len <= vma->vm_start)) -return addr; +if (addr >TASK_UNMAPPED_BASE ) + addr1 = addr; + goto find_free_area; } + +default_area: addr =PAGE_ALIGN (TASK_UNMAPPED_BASE ); +find_free_area:for (vma =find_vma (current->mm, addr); ; vma = vma->vm_next) {/* At this point: (!vma || addr < vma->vm_end). */ -if (TASK_SIZE - len < addr) -return -ENOMEM ; +if (addr_limit < addr) +break ;if (!vma || addr + len <= vma->vm_start)return addr; addr = vma->vm_end; } +if (addr1) { +/* No unmapped areas above addr; try below it */ + addr_limit = addr1; + goto default_area; + } +return -ENOMEM ; }#else extern unsigned long arch_get_unmapped_area (struct file *,unsigned long ,unsigned long ,unsigned long ,unsigned long );
include/linux/binfmts.h +3 -0
@@ -32,6 +32,9 @@ struct linux_binprm{unsigned long loader, exec; }; +/* Forward declaration */ +struct mm_struct ; +/* * This structure defines the functions that are used to load the binary formats that * linux accepts.
Quoted 1 line · Ivan Kokshaysky
Ok, here is a single loop version.
that fixed it. netscape runs fine now.
Signature · 2 lines
Tom Vier <[email protected]> DSA Key id 0x27371A2C