* Sparc32 not working:2.6.23-rc1 (git commit 1e4dcd22efa7d24f637ab2ea3a77dd65774eb005)
@ 2007-07-28 18:18 Mark Fortescue
2007-07-28 21:48 ` Sparc32 not working:2.6.23-rc1 (git commit Krzysztof Helt
` (14 more replies)
0 siblings, 15 replies; 27+ messages in thread
From: Mark Fortescue @ 2007-07-28 18:18 UTC (permalink / raw)
To: sparclinux
[-- Attachment #1: Type: TEXT/PLAIN, Size: 747 bytes --]
Hi David,
Do you have any Sparc32/generic Sparc patches that have not already been
pushded up to
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
I have just tried out the latest commit on my sun4c SS1 and have found it
to have a NULL pointer bug. I can't give any details as the serial console
support is broaken and on the cgthree console, the information scrolled of
the top of the console before I had a chance to read any of the key
details.
In addition, enabling CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY killed the
kernel while starting up the cgthree (it just stopped - no messages).
Looks like I am going to have to step through the changes from my
working v2.6.22 kernel slowly.
Regards
Mark Fortescue.
[-- Attachment #2: Type: TEXT/PLAIN, Size: 21477 bytes --]
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.23-rc1
# Sat Jul 28 18:37:40 2007
#
CONFIG_MMU=y
CONFIG_HIGHMEM=y
CONFIG_ZONE_DMA=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_ARCH_NO_VIRT_TO_BUS=y
CONFIG_OF=y
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
#
# Code maturity level options
#
CONFIG_EXPERIMENTAL=y
CONFIG_BROKEN_ON_SMP=y
CONFIG_INIT_ENV_ARG_LIMIT=32
#
# General setup
#
CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
CONFIG_POSIX_MQUEUE=y
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
# CONFIG_TASKSTATS is not set
# CONFIG_USER_NS is not set
# CONFIG_AUDIT is not set
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=16
# CONFIG_SYSFS_DEPRECATED is not set
CONFIG_RELAY=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_SYSCTL=y
CONFIG_EMBEDDED=y
CONFIG_UID16=y
CONFIG_SYSCTL_SYSCALL=y
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
CONFIG_KALLSYMS_EXTRA_PASS=y
CONFIG_HOTPLUG=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_ANON_INODES=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_SLAB=y
# CONFIG_SLUB is not set
# CONFIG_SLOB is not set
CONFIG_RT_MUTEXES=y
# CONFIG_TINY_SHMEM is not set
CONFIG_BASE_SMALL=0
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
CONFIG_MODULE_FORCE_UNLOAD=y
CONFIG_MODVERSIONS=y
CONFIG_MODULE_SRCVERSION_ALL=y
CONFIG_KMOD=y
CONFIG_BLOCK=y
# CONFIG_LBD is not set
# CONFIG_BLK_DEV_IO_TRACE is not set
# CONFIG_LSF is not set
CONFIG_BLK_DEV_BSG=y
#
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
# CONFIG_IOSCHED_AS is not set
# CONFIG_IOSCHED_DEADLINE is not set
CONFIG_IOSCHED_CFQ=y
# CONFIG_DEFAULT_AS is not set
# CONFIG_DEFAULT_DEADLINE is not set
CONFIG_DEFAULT_CFQ=y
# CONFIG_DEFAULT_NOOP is not set
CONFIG_DEFAULT_IOSCHED="cfq"
#
# General machine setup
#
# CONFIG_SMP is not set
CONFIG_SPARC=y
CONFIG_SPARC32=y
CONFIG_SBUS=y
CONFIG_SBUSCHAR=y
CONFIG_SERIAL_CONSOLE=y
CONFIG_SUN_AUXIO=y
CONFIG_SUN_IO=y
CONFIG_RWSEM_GENERIC_SPINLOCK=y
CONFIG_GENERIC_FIND_NEXT_BIT=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
# CONFIG_ARCH_HAS_ILOG2_U32 is not set
# CONFIG_ARCH_HAS_ILOG2_U64 is not set
CONFIG_EMULATED_CMPXCHG=y
CONFIG_SUN_PM=y
# CONFIG_SUN4 is not set
# CONFIG_PCI is not set
# CONFIG_PCI_SYSCALL is not set
# CONFIG_ARCH_SUPPORTS_MSI is not set
CONFIG_NO_DMA=y
CONFIG_SUN_OPENPROMFS=m
CONFIG_SPARC_LED=m
CONFIG_BINFMT_ELF=y
CONFIG_BINFMT_AOUT=m
CONFIG_BINFMT_MISC=m
CONFIG_SUNOS_EMUL=y
CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="check_vtoc=1 root=/dev/nfs nfsroot=10.1.1.4:/cross/sparc/sys-root,rsize=2048,wsize=2048 ip=dhcp init=/sbin/simpleinit rw"
CONFIG_SELECT_MEMORY_MODEL=y
CONFIG_FLATMEM_MANUAL=y
# CONFIG_DISCONTIGMEM_MANUAL is not set
# CONFIG_SPARSEMEM_MANUAL is not set
CONFIG_FLATMEM=y
CONFIG_FLAT_NODE_MEM_MAP=y
# CONFIG_SPARSEMEM_STATIC is not set
CONFIG_SPLIT_PTLOCK_CPUS=4
# CONFIG_RESOURCES_64BIT is not set
CONFIG_ZONE_DMA_FLAG=1
CONFIG_BOUNCE=y
#
# Networking
#
CONFIG_NET=y
#
# Networking options
#
CONFIG_PACKET=m
CONFIG_PACKET_MMAP=y
CONFIG_UNIX=y
# CONFIG_NET_KEY is not set
CONFIG_INET=y
# CONFIG_IP_MULTICAST is not set
# CONFIG_IP_ADVANCED_ROUTER is not set
CONFIG_IP_FIB_HASH=y
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
# CONFIG_IP_PNP_BOOTP is not set
# CONFIG_IP_PNP_RARP is not set
# CONFIG_NET_IPIP is not set
# CONFIG_NET_IPGRE is not set
# CONFIG_ARPD is not set
# CONFIG_SYN_COOKIES is not set
# CONFIG_INET_AH is not set
# CONFIG_INET_ESP is not set
# CONFIG_INET_IPCOMP is not set
# CONFIG_INET_XFRM_TUNNEL is not set
# CONFIG_INET_TUNNEL is not set
# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
# CONFIG_INET_XFRM_MODE_BEET is not set
# CONFIG_INET_DIAG is not set
# CONFIG_TCP_CONG_ADVANCED is not set
CONFIG_TCP_CONG_CUBIC=y
CONFIG_DEFAULT_TCP_CONG="cubic"
# CONFIG_TCP_MD5SIG is not set
# CONFIG_IPV6 is not set
# CONFIG_INET6_XFRM_TUNNEL is not set
# CONFIG_INET6_TUNNEL is not set
# CONFIG_NETLABEL is not set
# CONFIG_NETWORK_SECMARK is not set
# CONFIG_NETFILTER is not set
# CONFIG_IP_DCCP is not set
CONFIG_IP_SCTP=m
# CONFIG_SCTP_DBG_MSG is not set
# CONFIG_SCTP_DBG_OBJCNT is not set
# CONFIG_SCTP_HMAC_NONE is not set
# CONFIG_SCTP_HMAC_SHA1 is not set
CONFIG_SCTP_HMAC_MD5=y
# CONFIG_TIPC is not set
# CONFIG_ATM is not set
# CONFIG_BRIDGE is not set
# CONFIG_VLAN_8021Q is not set
# CONFIG_DECNET is not set
# CONFIG_LLC2 is not set
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
# CONFIG_ECONET is not set
# CONFIG_WAN_ROUTER is not set
#
# QoS and/or fair queueing
#
# CONFIG_NET_SCHED is not set
#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
# CONFIG_HAMRADIO is not set
# CONFIG_IRDA is not set
# CONFIG_BT is not set
# CONFIG_AF_RXRPC is not set
#
# Wireless
#
# CONFIG_CFG80211 is not set
# CONFIG_WIRELESS_EXT is not set
# CONFIG_MAC80211 is not set
# CONFIG_IEEE80211 is not set
# CONFIG_RFKILL is not set
# CONFIG_NET_9P is not set
#
# Device Drivers
#
#
# Generic Driver Options
#
CONFIG_STANDALONE=y
# CONFIG_PREVENT_FIRMWARE_BUILD is not set
# CONFIG_FW_LOADER is not set
# CONFIG_DEBUG_DRIVER is not set
# CONFIG_DEBUG_DEVRES is not set
# CONFIG_SYS_HYPERVISOR is not set
# CONFIG_CONNECTOR is not set
# CONFIG_MTD is not set
CONFIG_OF_DEVICE=y
CONFIG_PARPORT=m
# CONFIG_PARPORT_GSC is not set
CONFIG_PARPORT_SUNBPP=m
# CONFIG_PARPORT_AX88796 is not set
# CONFIG_PARPORT_1284 is not set
CONFIG_PARPORT_NOT_PC=y
CONFIG_BLK_DEV=y
CONFIG_BLK_DEV_FD=y
# CONFIG_BLK_DEV_COW_COMMON is not set
CONFIG_BLK_DEV_LOOP=m
CONFIG_BLK_DEV_CRYPTOLOOP=m
CONFIG_BLK_DEV_NBD=m
CONFIG_BLK_DEV_RAM=m
CONFIG_BLK_DEV_RAM_COUNT=2
CONFIG_BLK_DEV_RAM_SIZE=4096
CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
# CONFIG_CDROM_PKTCDVD is not set
# CONFIG_ATA_OVER_ETH is not set
CONFIG_MISC_DEVICES=y
# CONFIG_EEPROM_93CX6 is not set
# CONFIG_IDE is not set
#
# SCSI device support
#
# CONFIG_RAID_ATTRS is not set
CONFIG_SCSI=y
# CONFIG_SCSI_DMA is not set
CONFIG_SCSI_TGT=m
# CONFIG_SCSI_NETLINK is not set
CONFIG_SCSI_PROC_FS=y
#
# SCSI support type (disk, tape, CD-ROM)
#
CONFIG_BLK_DEV_SD=y
CONFIG_CHR_DEV_ST=m
# CONFIG_CHR_DEV_OSST is not set
CONFIG_BLK_DEV_SR=m
CONFIG_BLK_DEV_SR_VENDOR=y
CONFIG_CHR_DEV_SG=m
CONFIG_CHR_DEV_SCH=m
#
# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
#
CONFIG_SCSI_MULTI_LUN=y
# CONFIG_SCSI_CONSTANTS is not set
CONFIG_SCSI_LOGGING=y
# CONFIG_SCSI_SCAN_ASYNC is not set
CONFIG_SCSI_WAIT_SCAN=m
#
# SCSI Transports
#
CONFIG_SCSI_SPI_ATTRS=y
# CONFIG_SCSI_FC_ATTRS is not set
# CONFIG_SCSI_ISCSI_ATTRS is not set
# CONFIG_SCSI_SAS_ATTRS is not set
# CONFIG_SCSI_SAS_LIBSAS is not set
CONFIG_SCSI_LOWLEVEL=y
# CONFIG_ISCSI_TCP is not set
CONFIG_SCSI_QLOGICPTI=y
# CONFIG_SCSI_DEBUG is not set
CONFIG_SCSI_SUNESP=y
# CONFIG_ATA is not set
CONFIG_MD=y
CONFIG_BLK_DEV_MD=m
CONFIG_MD_LINEAR=m
CONFIG_MD_RAID0=m
CONFIG_MD_RAID1=m
CONFIG_MD_RAID10=m
CONFIG_MD_RAID456=m
CONFIG_MD_RAID5_RESHAPE=y
CONFIG_MD_MULTIPATH=m
CONFIG_MD_FAULTY=m
CONFIG_BLK_DEV_DM=m
# CONFIG_DM_DEBUG is not set
CONFIG_DM_CRYPT=m
CONFIG_DM_SNAPSHOT=m
CONFIG_DM_MIRROR=m
CONFIG_DM_ZERO=m
CONFIG_DM_MULTIPATH=m
CONFIG_DM_MULTIPATH_EMC=m
CONFIG_DM_MULTIPATH_RDAC=m
CONFIG_DM_DELAY=m
CONFIG_NETDEVICES=y
# CONFIG_NETDEVICES_MULTIQUEUE is not set
# CONFIG_DUMMY is not set
# CONFIG_BONDING is not set
# CONFIG_MACVLAN is not set
# CONFIG_EQUALIZER is not set
# CONFIG_TUN is not set
# CONFIG_PHYLIB is not set
CONFIG_NET_ETHERNET=y
# CONFIG_MII is not set
CONFIG_SUNLANCE=y
# CONFIG_HAPPYMEAL is not set
# CONFIG_SUNBMAC is not set
# CONFIG_SUNQE is not set
# CONFIG_NET_POCKET is not set
# CONFIG_NETDEV_1000 is not set
# CONFIG_NETDEV_10000 is not set
#
# Wireless LAN
#
# CONFIG_WLAN_PRE80211 is not set
# CONFIG_WLAN_80211 is not set
# CONFIG_WAN is not set
# CONFIG_PLIP is not set
# CONFIG_PPP is not set
# CONFIG_SLIP is not set
# CONFIG_SHAPER is not set
# CONFIG_NETCONSOLE is not set
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set
# CONFIG_ISDN is not set
# CONFIG_PHONE is not set
#
# Input device support
#
CONFIG_INPUT=y
# CONFIG_INPUT_FF_MEMLESS is not set
CONFIG_INPUT_POLLDEV=m
#
# Userland interfaces
#
CONFIG_INPUT_MOUSEDEV=m
CONFIG_INPUT_MOUSEDEV_PSAUX=y
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1152
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=900
# CONFIG_INPUT_JOYDEV is not set
# CONFIG_INPUT_TSDEV is not set
CONFIG_INPUT_EVDEV=m
# CONFIG_INPUT_EVBUG is not set
#
# Input Device Drivers
#
CONFIG_INPUT_KEYBOARD=y
# CONFIG_KEYBOARD_ATKBD is not set
CONFIG_KEYBOARD_SUNKBD=y
# CONFIG_KEYBOARD_LKKBD is not set
# CONFIG_KEYBOARD_XTKBD is not set
# CONFIG_KEYBOARD_NEWTON is not set
# CONFIG_KEYBOARD_STOWAWAY is not set
CONFIG_INPUT_MOUSE=y
# CONFIG_MOUSE_PS2 is not set
CONFIG_MOUSE_SERIAL=y
# CONFIG_MOUSE_VSXXXAA is not set
# CONFIG_INPUT_JOYSTICK is not set
# CONFIG_INPUT_TABLET is not set
# CONFIG_INPUT_TOUCHSCREEN is not set
CONFIG_INPUT_MISC=y
CONFIG_INPUT_UINPUT=m
#
# Hardware I/O ports
#
CONFIG_SERIO=y
# CONFIG_SERIO_I8042 is not set
CONFIG_SERIO_SERPORT=y
# CONFIG_SERIO_PARKBD is not set
# CONFIG_SERIO_LIBPS2 is not set
CONFIG_SERIO_RAW=m
# CONFIG_GAMEPORT is not set
#
# Character devices
#
CONFIG_VT=y
CONFIG_VT_CONSOLE=y
CONFIG_HW_CONSOLE=y
# CONFIG_VT_HW_CONSOLE_BINDING is not set
# CONFIG_SERIAL_NONSTANDARD is not set
#
# Serial drivers
#
#
# Non-8250 serial port support
#
CONFIG_SERIAL_SUNCORE=y
CONFIG_SERIAL_SUNZILOG=y
CONFIG_SERIAL_SUNZILOG_CONSOLE=y
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_UNIX98_PTYS=y
CONFIG_LEGACY_PTYS=y
CONFIG_LEGACY_PTY_COUNT=16
CONFIG_PRINTER=m
# CONFIG_LP_CONSOLE is not set
CONFIG_PPDEV=m
# CONFIG_TIPAR is not set
# CONFIG_IPMI_HANDLER is not set
CONFIG_WATCHDOG=y
# CONFIG_WATCHDOG_NOWAYOUT is not set
#
# Watchdog Device Drivers
#
CONFIG_SOFT_WATCHDOG=m
# CONFIG_HW_RANDOM is not set
# CONFIG_R3964 is not set
# CONFIG_RAW_DRIVER is not set
# CONFIG_TCG_TPM is not set
# CONFIG_I2C is not set
#
# SPI support
#
# CONFIG_SPI is not set
# CONFIG_SPI_MASTER is not set
# CONFIG_W1 is not set
# CONFIG_POWER_SUPPLY is not set
# CONFIG_HWMON is not set
#
# Multifunction device drivers
#
# CONFIG_MFD_SM501 is not set
#
# Multimedia devices
#
# CONFIG_VIDEO_DEV is not set
# CONFIG_DVB_CORE is not set
# CONFIG_DAB is not set
#
# Graphics support
#
# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
#
# Display device support
#
# CONFIG_DISPLAY_SUPPORT is not set
# CONFIG_VGASTATE is not set
CONFIG_VIDEO_OUTPUT_CONTROL=m
CONFIG_FB=y
# CONFIG_FIRMWARE_EDID is not set
# CONFIG_FB_DDC is not set
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_IMAGEBLIT=y
# CONFIG_FB_SYS_FILLRECT is not set
# CONFIG_FB_SYS_COPYAREA is not set
# CONFIG_FB_SYS_IMAGEBLIT is not set
# CONFIG_FB_SYS_FOPS is not set
CONFIG_FB_DEFERRED_IO=y
# CONFIG_FB_SVGALIB is not set
# CONFIG_FB_MACMODES is not set
# CONFIG_FB_BACKLIGHT is not set
CONFIG_FB_MODE_HELPERS=y
# CONFIG_FB_TILEBLITTING is not set
#
# Frame buffer hardware drivers
#
CONFIG_FB_SBUS=y
# CONFIG_FB_BW2 is not set
CONFIG_FB_CG3=y
# CONFIG_FB_CG6 is not set
# CONFIG_FB_TCX is not set
# CONFIG_FB_CG14 is not set
# CONFIG_FB_P9100 is not set
# CONFIG_FB_LEO is not set
# CONFIG_FB_IGA is not set
# CONFIG_FB_S1D13XXX is not set
# CONFIG_FB_VIRTUAL is not set
#
# Console display driver support
#
CONFIG_PROM_CONSOLE=y
CONFIG_DUMMY_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE=y
# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
# CONFIG_FONTS is not set
# CONFIG_FONT_SUN8x16 is not set
CONFIG_FONT_SUN12x22=y
CONFIG_LOGO=y
# CONFIG_LOGO_LINUX_MONO is not set
# CONFIG_LOGO_LINUX_VGA16 is not set
CONFIG_LOGO_LINUX_CLUT224=y
# CONFIG_LOGO_SUN_CLUT224 is not set
#
# Sound
#
CONFIG_SOUND=m
#
# Advanced Linux Sound Architecture
#
CONFIG_SND=m
CONFIG_SND_TIMER=m
CONFIG_SND_PCM=m
CONFIG_SND_SEQUENCER=m
# CONFIG_SND_SEQ_DUMMY is not set
CONFIG_SND_OSSEMUL=y
CONFIG_SND_MIXER_OSS=m
CONFIG_SND_PCM_OSS=m
# CONFIG_SND_PCM_OSS_PLUGINS is not set
CONFIG_SND_SEQUENCER_OSS=y
# CONFIG_SND_DYNAMIC_MINORS is not set
# CONFIG_SND_SUPPORT_OLD_API is not set
CONFIG_SND_VERBOSE_PROCFS=y
# CONFIG_SND_VERBOSE_PRINTK is not set
# CONFIG_SND_DEBUG is not set
#
# Generic devices
#
# CONFIG_SND_DUMMY is not set
# CONFIG_SND_VIRMIDI is not set
# CONFIG_SND_MTPAV is not set
# CONFIG_SND_MTS64 is not set
# CONFIG_SND_SERIAL_U16550 is not set
# CONFIG_SND_MPU401 is not set
# CONFIG_SND_PORTMAN2X4 is not set
#
# ALSA Sparc devices
#
CONFIG_SND_SUN_AMD7930=m
# CONFIG_SND_SUN_CS4231 is not set
# CONFIG_SND_SUN_DBRI is not set
#
# System on Chip audio support
#
# CONFIG_SND_SOC is not set
#
# SoC Audio support for SuperH
#
#
# Open Sound System
#
# CONFIG_SOUND_PRIME is not set
# CONFIG_HID_SUPPORT is not set
# CONFIG_USB_SUPPORT is not set
# CONFIG_MMC is not set
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=m
#
# LED drivers
#
#
# LED Triggers
#
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_TIMER=m
CONFIG_LEDS_TRIGGER_HEARTBEAT=m
#
# Real Time Clock
#
CONFIG_RTC_LIB=m
CONFIG_RTC_CLASS=m
#
# RTC interfaces
#
CONFIG_RTC_INTF_SYSFS=y
CONFIG_RTC_INTF_PROC=y
CONFIG_RTC_INTF_DEV=y
CONFIG_RTC_INTF_DEV_UIE_EMUL=y
CONFIG_RTC_DRV_TEST=m
#
# Platform RTC drivers
#
# CONFIG_RTC_DRV_DS1553 is not set
# CONFIG_RTC_DRV_STK17TA8 is not set
# CONFIG_RTC_DRV_DS1742 is not set
# CONFIG_RTC_DRV_M48T86 is not set
# CONFIG_RTC_DRV_M48T59 is not set
# CONFIG_RTC_DRV_V3020 is not set
#
# on-CPU RTC drivers
#
# CONFIG_AUXDISPLAY is not set
#
# Userspace I/O
#
CONFIG_UIO=m
#
# Misc Linux/SPARC drivers
#
CONFIG_SUN_OPENPROMIO=m
CONFIG_SUN_MOSTEK_RTC=m
# CONFIG_SUN_BPP is not set
# CONFIG_SUN_VIDEOPIX is not set
# CONFIG_TADPOLE_TS102_UCTRL is not set
# CONFIG_SUN_JSFLASH is not set
#
# Unix98 PTY support
#
CONFIG_UNIX98_PTY_COUNT=16
#
# File systems
#
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y
CONFIG_EXT2_FS_POSIX_ACL=y
CONFIG_EXT2_FS_SECURITY=y
CONFIG_EXT2_FS_XIP=y
CONFIG_FS_XIP=y
CONFIG_EXT3_FS=m
CONFIG_EXT3_FS_XATTR=y
CONFIG_EXT3_FS_POSIX_ACL=y
CONFIG_EXT3_FS_SECURITY=y
# CONFIG_EXT4DEV_FS is not set
CONFIG_JBD=m
# CONFIG_JBD_DEBUG is not set
CONFIG_FS_MBCACHE=y
# CONFIG_REISERFS_FS is not set
# CONFIG_JFS_FS is not set
CONFIG_FS_POSIX_ACL=y
# CONFIG_XFS_FS is not set
# CONFIG_GFS2_FS is not set
# CONFIG_OCFS2_FS is not set
# CONFIG_MINIX_FS is not set
# CONFIG_ROMFS_FS is not set
CONFIG_INOTIFY=y
CONFIG_INOTIFY_USER=y
# CONFIG_QUOTA is not set
# CONFIG_DNOTIFY is not set
# CONFIG_AUTOFS_FS is not set
CONFIG_AUTOFS4_FS=m
CONFIG_FUSE_FS=m
CONFIG_GENERIC_ACL=y
#
# CD-ROM/DVD Filesystems
#
CONFIG_ISO9660_FS=m
CONFIG_JOLIET=y
CONFIG_ZISOFS=y
CONFIG_UDF_FS=m
CONFIG_UDF_NLS=y
#
# DOS/FAT/NT Filesystems
#
CONFIG_FAT_FS=m
CONFIG_MSDOS_FS=m
CONFIG_VFAT_FS=m
CONFIG_FAT_DEFAULT_CODEPAGE=437
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
# CONFIG_NTFS_FS is not set
#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
CONFIG_PROC_SYSCTL=y
CONFIG_SYSFS=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
# CONFIG_HUGETLB_PAGE is not set
CONFIG_RAMFS=y
CONFIG_CONFIGFS_FS=m
#
# Miscellaneous filesystems
#
# CONFIG_ADFS_FS is not set
# CONFIG_AFFS_FS is not set
# CONFIG_ECRYPT_FS is not set
# CONFIG_HFS_FS is not set
# CONFIG_HFSPLUS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_EFS_FS is not set
# CONFIG_CRAMFS is not set
# CONFIG_VXFS_FS is not set
# CONFIG_HPFS_FS is not set
# CONFIG_QNX4FS_FS is not set
# CONFIG_SYSV_FS is not set
CONFIG_UFS_FS=y
CONFIG_UFS_FS_WRITE=y
# CONFIG_UFS_DEBUG is not set
#
# Network File Systems
#
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
CONFIG_NFS_DIRECTIO=y
CONFIG_NFSD=m
CONFIG_NFSD_V2_ACL=y
CONFIG_NFSD_V3=y
CONFIG_NFSD_V3_ACL=y
CONFIG_NFSD_V4=y
CONFIG_NFSD_TCP=y
CONFIG_ROOT_NFS=y
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_EXPORTFS=m
CONFIG_NFS_ACL_SUPPORT=y
CONFIG_NFS_COMMON=y
CONFIG_SUNRPC=y
CONFIG_SUNRPC_GSS=y
# CONFIG_SUNRPC_BIND34 is not set
CONFIG_RPCSEC_GSS_KRB5=y
# CONFIG_RPCSEC_GSS_SPKM3 is not set
CONFIG_SMB_FS=m
CONFIG_SMB_NLS_DEFAULT=y
CONFIG_SMB_NLS_REMOTE="cp437"
CONFIG_CIFS=m
# CONFIG_CIFS_STATS is not set
CONFIG_CIFS_WEAK_PW_HASH=y
CONFIG_CIFS_XATTR=y
CONFIG_CIFS_POSIX=y
# CONFIG_CIFS_DEBUG2 is not set
CONFIG_CIFS_EXPERIMENTAL=y
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
# CONFIG_AFS_FS is not set
#
# Partition Types
#
CONFIG_PARTITION_ADVANCED=y
# CONFIG_ACORN_PARTITION is not set
# CONFIG_OSF_PARTITION is not set
# CONFIG_AMIGA_PARTITION is not set
# CONFIG_ATARI_PARTITION is not set
# CONFIG_MAC_PARTITION is not set
CONFIG_MSDOS_PARTITION=y
CONFIG_BSD_DISKLABEL=y
# CONFIG_MINIX_SUBPARTITION is not set
CONFIG_SOLARIS_X86_PARTITION=y
# CONFIG_UNIXWARE_DISKLABEL is not set
# CONFIG_LDM_PARTITION is not set
# CONFIG_SGI_PARTITION is not set
# CONFIG_ULTRIX_PARTITION is not set
CONFIG_SUN_PARTITION=y
# CONFIG_KARMA_PARTITION is not set
# CONFIG_EFI_PARTITION is not set
# CONFIG_SYSV68_PARTITION is not set
#
# Native Language Support
#
CONFIG_NLS=m
CONFIG_NLS_DEFAULT="iso8859-1"
CONFIG_NLS_CODEPAGE_437=m
CONFIG_NLS_CODEPAGE_737=m
CONFIG_NLS_CODEPAGE_775=m
CONFIG_NLS_CODEPAGE_850=m
CONFIG_NLS_CODEPAGE_852=m
CONFIG_NLS_CODEPAGE_855=m
CONFIG_NLS_CODEPAGE_857=m
CONFIG_NLS_CODEPAGE_860=m
CONFIG_NLS_CODEPAGE_861=m
CONFIG_NLS_CODEPAGE_862=m
CONFIG_NLS_CODEPAGE_863=m
CONFIG_NLS_CODEPAGE_864=m
CONFIG_NLS_CODEPAGE_865=m
CONFIG_NLS_CODEPAGE_866=m
CONFIG_NLS_CODEPAGE_869=m
CONFIG_NLS_CODEPAGE_936=m
CONFIG_NLS_CODEPAGE_950=m
CONFIG_NLS_CODEPAGE_932=m
CONFIG_NLS_CODEPAGE_949=m
CONFIG_NLS_CODEPAGE_874=m
CONFIG_NLS_ISO8859_8=m
CONFIG_NLS_CODEPAGE_1250=m
CONFIG_NLS_CODEPAGE_1251=m
CONFIG_NLS_ASCII=m
CONFIG_NLS_ISO8859_1=m
CONFIG_NLS_ISO8859_2=m
CONFIG_NLS_ISO8859_3=m
CONFIG_NLS_ISO8859_4=m
CONFIG_NLS_ISO8859_5=m
CONFIG_NLS_ISO8859_6=m
CONFIG_NLS_ISO8859_7=m
CONFIG_NLS_ISO8859_9=m
CONFIG_NLS_ISO8859_13=m
CONFIG_NLS_ISO8859_14=m
CONFIG_NLS_ISO8859_15=m
CONFIG_NLS_KOI8_R=m
CONFIG_NLS_KOI8_U=m
CONFIG_NLS_UTF8=m
#
# Distributed Lock Manager
#
CONFIG_DLM=m
# CONFIG_DLM_DEBUG is not set
#
# Instrumentation Support
#
# CONFIG_PROFILING is not set
#
# Kernel hacking
#
# CONFIG_PRINTK_TIME is not set
# CONFIG_ENABLE_MUST_CHECK is not set
CONFIG_MAGIC_SYSRQ=y
# CONFIG_UNUSED_SYMBOLS is not set
# CONFIG_DEBUG_FS is not set
CONFIG_HEADERS_CHECK=y
CONFIG_DEBUG_KERNEL=y
CONFIG_DETECT_SOFTLOCKUP=y
# CONFIG_SCHED_DEBUG is not set
# CONFIG_SCHEDSTATS is not set
# CONFIG_TIMER_STATS is not set
CONFIG_DEBUG_SLAB=y
CONFIG_DEBUG_SLAB_LEAK=y
# CONFIG_DEBUG_RT_MUTEXES is not set
# CONFIG_RT_MUTEX_TESTER is not set
# CONFIG_DEBUG_SPINLOCK is not set
# CONFIG_DEBUG_MUTEXES is not set
# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
# CONFIG_DEBUG_KOBJECT is not set
# CONFIG_DEBUG_HIGHMEM is not set
# CONFIG_DEBUG_BUGVERBOSE is not set
# CONFIG_DEBUG_INFO is not set
# CONFIG_DEBUG_VM is not set
# CONFIG_DEBUG_LIST is not set
CONFIG_FORCED_INLINING=y
# CONFIG_RCU_TORTURE_TEST is not set
# CONFIG_FAULT_INJECTION is not set
# CONFIG_DEBUG_STACK_USAGE is not set
#
# Security options
#
CONFIG_KEYS=y
CONFIG_KEYS_DEBUG_PROC_KEYS=y
CONFIG_SECURITY=y
CONFIG_SECURITY_NETWORK=y
CONFIG_SECURITY_CAPABILITIES=m
CONFIG_XOR_BLOCKS=m
CONFIG_ASYNC_CORE=m
CONFIG_ASYNC_MEMCPY=m
CONFIG_ASYNC_XOR=m
CONFIG_CRYPTO=y
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_ABLKCIPHER=m
CONFIG_CRYPTO_BLKCIPHER=y
CONFIG_CRYPTO_HASH=m
CONFIG_CRYPTO_MANAGER=y
CONFIG_CRYPTO_HMAC=m
CONFIG_CRYPTO_XCBC=m
CONFIG_CRYPTO_NULL=m
CONFIG_CRYPTO_MD4=m
CONFIG_CRYPTO_MD5=y
CONFIG_CRYPTO_SHA1=m
CONFIG_CRYPTO_SHA256=m
CONFIG_CRYPTO_SHA512=m
CONFIG_CRYPTO_WP512=m
CONFIG_CRYPTO_TGR192=m
CONFIG_CRYPTO_GF128MUL=m
CONFIG_CRYPTO_ECB=m
CONFIG_CRYPTO_CBC=y
CONFIG_CRYPTO_PCBC=m
CONFIG_CRYPTO_LRW=m
CONFIG_CRYPTO_CRYPTD=m
CONFIG_CRYPTO_DES=y
CONFIG_CRYPTO_FCRYPT=m
CONFIG_CRYPTO_BLOWFISH=m
CONFIG_CRYPTO_TWOFISH=m
CONFIG_CRYPTO_TWOFISH_COMMON=m
CONFIG_CRYPTO_SERPENT=m
CONFIG_CRYPTO_AES=m
CONFIG_CRYPTO_CAST5=m
CONFIG_CRYPTO_CAST6=m
CONFIG_CRYPTO_TEA=m
CONFIG_CRYPTO_ARC4=m
CONFIG_CRYPTO_KHAZAD=m
CONFIG_CRYPTO_ANUBIS=m
CONFIG_CRYPTO_DEFLATE=m
CONFIG_CRYPTO_MICHAEL_MIC=m
CONFIG_CRYPTO_CRC32C=m
CONFIG_CRYPTO_CAMELLIA=m
CONFIG_CRYPTO_TEST=m
# CONFIG_CRYPTO_HW is not set
#
# Library routines
#
CONFIG_BITREVERSE=y
CONFIG_CRC_CCITT=m
CONFIG_CRC16=m
CONFIG_CRC_ITU_T=m
CONFIG_CRC32=y
CONFIG_CRC7=m
CONFIG_LIBCRC32C=m
CONFIG_ZLIB_INFLATE=m
CONFIG_ZLIB_DEFLATE=m
CONFIG_PLIST=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
^ permalink raw reply [flat|nested] 27+ messages in thread* Re: Sparc32 not working:2.6.23-rc1 (git commit 2007-07-28 18:18 Sparc32 not working:2.6.23-rc1 (git commit 1e4dcd22efa7d24f637ab2ea3a77dd65774eb005) Mark Fortescue @ 2007-07-28 21:48 ` Krzysztof Helt 2007-07-28 22:38 ` Krzysztof Helt ` (13 subsequent siblings) 14 siblings, 0 replies; 27+ messages in thread From: Krzysztof Helt @ 2007-07-28 21:48 UTC (permalink / raw) To: sparclinux On Sat, 28 Jul 2007 19:18:50 +0100 (BST) Mark Fortescue <mark@mtfhpc.demon.co.uk> wrote: > Hi David, > > Do you have any Sparc32/generic Sparc patches that have not already been > pushded up to > git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git > > I have just tried out the latest commit on my sun4c SS1 and have found it > to have a NULL pointer bug. I can't give any details as the serial console > support is broaken and on the cgthree console, the information scrolled of > the top of the console before I had a chance to read any of the key > details. > I have just booted the 2.6.32-rc1-git4 (which differs from yours by only 3 IA64 patches) on SS20 with UP kernel and Aurora 3. The SMP kernel boots but it crashes when storage is initialized (I try tracking this down). There is a trick however which appeared to be needed some kernel versions ago. I need to patch vsprinf.c file to replace the va_arg(long long) call with two va_arg(long) calls. It is probably due to broken compiler in the Aurora 3. Otherwise it hangs very early. This hanging is random and may differ with features selected to be compiled into the kernel. Regards, Krzysztof ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: Sparc32 not working:2.6.23-rc1 (git commit 2007-07-28 18:18 Sparc32 not working:2.6.23-rc1 (git commit 1e4dcd22efa7d24f637ab2ea3a77dd65774eb005) Mark Fortescue 2007-07-28 21:48 ` Sparc32 not working:2.6.23-rc1 (git commit Krzysztof Helt @ 2007-07-28 22:38 ` Krzysztof Helt 2007-07-28 23:21 ` Mark Fortescue ` (12 subsequent siblings) 14 siblings, 0 replies; 27+ messages in thread From: Krzysztof Helt @ 2007-07-28 22:38 UTC (permalink / raw) To: sparclinux On Sat, 28 Jul 2007 23:48:56 +0200 Krzysztof Helt <krzysztof.h1@wp.pl> wrote: > > I have just booted the 2.6.32-rc1-git4 (which differs from yours by only 3 IA64 patches) on SS20 > with UP kernel and Aurora 3. The SMP kernel boots but it crashes when storage is > initialized (I try tracking this down). > Update: this is not storage, but sunlance.ko module. Loading this module ends with message: Unable to handle kernel paging request at virtual address ef7dc000 and more messages about MMU until the linux hangs. I have the second lance chip on the SBUS 10Mbit + SCSI card (I don't know the name). I'll do more tests tomorrow. Regards, Krzysztof PS. Everything works ok with UP kernel. ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: Sparc32 not working:2.6.23-rc1 (git commit 2007-07-28 18:18 Sparc32 not working:2.6.23-rc1 (git commit 1e4dcd22efa7d24f637ab2ea3a77dd65774eb005) Mark Fortescue 2007-07-28 21:48 ` Sparc32 not working:2.6.23-rc1 (git commit Krzysztof Helt 2007-07-28 22:38 ` Krzysztof Helt @ 2007-07-28 23:21 ` Mark Fortescue 2007-07-29 5:40 ` David Miller ` (11 subsequent siblings) 14 siblings, 0 replies; 27+ messages in thread From: Mark Fortescue @ 2007-07-28 23:21 UTC (permalink / raw) To: sparclinux Hi Krzysztof, There have been lots of changes to the DMA system (git bisect is not viable form my working 2.6.22 kernel as the dma changes kill the build for over half the posible commits to check). It could be a side effect of these changes. For me, a non-functional lance is a show stopper as my kernels are all tested using an NFS root. No network means no root ... :( I am setting up an ext2 partition at the moment. It should alow me do some testing without any network but it will be a dificult setup to test as I have not tries running up an nfs server on my linux-sparc setup yet so getting the files setup will take several reboots to different OS/OS Versions. Regards Mark Fortescue. On Sun, 29 Jul 2007, Krzysztof Helt wrote: > On Sat, 28 Jul 2007 23:48:56 +0200 > Krzysztof Helt <krzysztof.h1@wp.pl> wrote: > > >> >> I have just booted the 2.6.32-rc1-git4 (which differs from yours by only 3 IA64 patches) on SS20 >> with UP kernel and Aurora 3. The SMP kernel boots but it crashes when storage is >> initialized (I try tracking this down). >> > > Update: this is not storage, but sunlance.ko module. Loading this module ends with message: > > Unable to handle kernel paging request at virtual address ef7dc000 > > and more messages about MMU until the linux hangs. > > I have the second lance chip on the SBUS 10Mbit + SCSI card (I don't know the name). I'll do more tests tomorrow. > > Regards, > Krzysztof > PS. Everything works ok with UP kernel. > - > To unsubscribe from this list: send the line "unsubscribe sparclinux" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: Sparc32 not working:2.6.23-rc1 (git commit 2007-07-28 18:18 Sparc32 not working:2.6.23-rc1 (git commit 1e4dcd22efa7d24f637ab2ea3a77dd65774eb005) Mark Fortescue ` (2 preceding siblings ...) 2007-07-28 23:21 ` Mark Fortescue @ 2007-07-29 5:40 ` David Miller 2007-07-29 8:29 ` Mark Fortescue ` (10 subsequent siblings) 14 siblings, 0 replies; 27+ messages in thread From: David Miller @ 2007-07-29 5:40 UTC (permalink / raw) To: sparclinux From: Mark Fortescue <mark@mtfhpc.demon.co.uk> Date: Sat, 28 Jul 2007 19:18:50 +0100 (BST) > Do you have any Sparc32/generic Sparc patches that have not already been > pushded up to > git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git No. > I have just tried out the latest commit on my sun4c SS1 and have found it > to have a NULL pointer bug. I can't give any details as the serial console > support is broaken and on the cgthree console, the information scrolled of > the top of the console before I had a chance to read any of the key > details. > > In addition, enabling CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY killed the > kernel while starting up the cgthree (it just stopped - no messages). > > Looks like I am going to have to step through the changes from my > working v2.6.22 kernel slowly. Yes, basically expect sparc32 to break as long as there is not a maintainer that constantly pulls from upstream and tests things on a frequent basis as I do for sparc64. Feel free to step up and be "the one" :-) ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: Sparc32 not working:2.6.23-rc1 (git commit 2007-07-28 18:18 Sparc32 not working:2.6.23-rc1 (git commit 1e4dcd22efa7d24f637ab2ea3a77dd65774eb005) Mark Fortescue ` (3 preceding siblings ...) 2007-07-29 5:40 ` David Miller @ 2007-07-29 8:29 ` Mark Fortescue 2007-07-29 9:05 ` David Miller ` (9 subsequent siblings) 14 siblings, 0 replies; 27+ messages in thread From: Mark Fortescue @ 2007-07-29 8:29 UTC (permalink / raw) To: sparclinux On Sat, 28 Jul 2007, David Miller wrote: > From: Mark Fortescue <mark@mtfhpc.demon.co.uk> > Date: Sat, 28 Jul 2007 19:18:50 +0100 (BST) > >> Do you have any Sparc32/generic Sparc patches that have not already been >> pushded up to >> git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git > > No. > >> I have just tried out the latest commit on my sun4c SS1 and have found it >> to have a NULL pointer bug. I can't give any details as the serial console >> support is broaken and on the cgthree console, the information scrolled of >> the top of the console before I had a chance to read any of the key >> details. >> >> In addition, enabling CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY killed the >> kernel while starting up the cgthree (it just stopped - no messages). >> >> Looks like I am going to have to step through the changes from my >> working v2.6.22 kernel slowly. > > Yes, basically expect sparc32 to break as long as there is not > a maintainer that constantly pulls from upstream and tests things > on a frequent basis as I do for sparc64. > > Feel free to step up and be "the one" :-) The trouble is I by the time I have sorted out one bug, another 3 or more have been introduced :-(. Are there any additional notes arround on being a maintainer? Is there a linux distribution that you would recommend that has all the required tools? If the rate of breakage can be reduced to somthing that can be dealt with over 1 to 2 days per week then I could try to keep things tested. If not then I will run out of time whenever I am earing a living. I have tried to identify a NULL pointer bug that has crepped into the code that runs /sbin/init but git bisect only gave me a kernel that will not build because of DMA changes. I tries some random selections to try and find a buildable/working kernel but without any sucess. Any sugestions as to how to track the issue down through the 2000+ commits since v2.6.22. At between 20 and 40min per build+test the time required to test each build untill I get one that works is excessive. > - > To unsubscribe from this list: send the line "unsubscribe sparclinux" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: Sparc32 not working:2.6.23-rc1 (git commit 2007-07-28 18:18 Sparc32 not working:2.6.23-rc1 (git commit 1e4dcd22efa7d24f637ab2ea3a77dd65774eb005) Mark Fortescue ` (4 preceding siblings ...) 2007-07-29 8:29 ` Mark Fortescue @ 2007-07-29 9:05 ` David Miller 2007-07-29 9:57 ` Mark Fortescue ` (8 subsequent siblings) 14 siblings, 0 replies; 27+ messages in thread From: David Miller @ 2007-07-29 9:05 UTC (permalink / raw) To: sparclinux From: Mark Fortescue <mark@mtfhpc.demon.co.uk> Date: Sun, 29 Jul 2007 09:29:33 +0100 (BST) > The trouble is I by the time I have sorted out one bug, another 3 or more > have been introduced :-(. I share your pain, even from purely the sparc64 perspective every day feels exactly the same way to me. Today was no exception. I even try to share as much code as possible between sparc32 and sparc64 when the opportunity presents itself. That's the whole idea behind the of_device and generic PROM device tree layers. Unfortunately these unifications bring along with them some temporary breakage as well. Nothing is free :-) > If the rate of breakage can be reduced to somthing that can be dealt with > over 1 to 2 days per week then I could try to keep things tested. If not > then I will run out of time whenever I am earing a living. At the very least if you do a GIT pull every few days, you will have so much less to sift through if a breakage occurs all of a sudden. The best thing to do is to have a fast build machine, and for sparc32 that undoubtedly means cross compilation on a more modern platform, and then test booting those images on the real sparc32 hardware. Another option is qemu, which I am to understand can boot sparc32 kernels. > I have tried to identify a NULL pointer bug that has crepped into the code > that runs /sbin/init but git bisect only gave me a kernel that will not > build because of DMA changes. I tries some random selections to try and > find a buildable/working kernel but without any sucess. > > Any sugestions as to how to track the issue down through the 2000+ commits > since v2.6.22. At between 20 and 40min per build+test the time required to > test each build untill I get one that works is excessive. This can be the problem with GIT bisects. Figure out what's NULL, then try to figure out why it might have gotten that way. If you can't figure out why, add tracing code into some choice locations (for example, do_sparc_fault() or similar) that does something like: if (!strcmp(current->comm, "init") && whatever = NULL) printk("FOO is NULL at ..."); keep adding these until you see exactly what makes it NULL. This is most doable when you have a very isolated time in which the problem occurs, which fits perfectly to a case like init failing to execute properly. To be honest, once you find out what is NULL, it may be clear to aparent what the cause is. I'm surprised you haven't figured this out yet in the traces :-) I think analysis should be the first step before even considering a GIT bisect, I only ever bisect when the crash is so mysterious that up to an hour of code inspection and crash analysis and probing is unable to reach an answer. And frankly you'll learn more and be better prepared for future bug analysis if you don't resort to GIT bisect. ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: Sparc32 not working:2.6.23-rc1 (git commit 2007-07-28 18:18 Sparc32 not working:2.6.23-rc1 (git commit 1e4dcd22efa7d24f637ab2ea3a77dd65774eb005) Mark Fortescue ` (5 preceding siblings ...) 2007-07-29 9:05 ` David Miller @ 2007-07-29 9:57 ` Mark Fortescue 2007-07-29 14:44 ` Sparc32 not working:2.6.23-rc1 (git commit 1e4dcd22efa7d24f637ab2ea3a77dd65774eb005) Mark Fortescue 2007-07-29 15:45 ` Sparc32 not working:2.6.23-rc1 (git commit Krzysztof Helt ` (7 subsequent siblings) 14 siblings, 1 reply; 27+ messages in thread From: Mark Fortescue @ 2007-07-29 9:57 UTC (permalink / raw) To: sparclinux On Sun, 29 Jul 2007, David Miller wrote: > From: Mark Fortescue <mark@mtfhpc.demon.co.uk> > Date: Sun, 29 Jul 2007 09:29:33 +0100 (BST) > >> The trouble is I by the time I have sorted out one bug, another 3 or more >> have been introduced :-(. > > I share your pain, even from purely the sparc64 perspective every > day feels exactly the same way to me. Today was no exception. > > I even try to share as much code as possible between sparc32 and > sparc64 when the opportunity presents itself. That's the whole idea > behind the of_device and generic PROM device tree layers. > Unfortunately these unifications bring along with them some temporary > breakage as well. Nothing is free :-) > >> If the rate of breakage can be reduced to somthing that can be dealt with >> over 1 to 2 days per week then I could try to keep things tested. If not >> then I will run out of time whenever I am earing a living. > > At the very least if you do a GIT pull every few days, you will have > so much less to sift through if a breakage occurs all of a sudden. > > The best thing to do is to have a fast build machine, and for sparc32 > that undoubtedly means cross compilation on a more modern platform, > and then test booting those images on the real sparc32 hardware. > I use an Athlon64 to do my corss compilation. Building on the SS1 takes forever espesially over NFS to a i486 NFS server. I only do native builds on the SS1 as a last resort, to find out changes I need to make to configure scripts to get the correct options when cross compiling :-). > Another option is qemu, which I am to understand can boot sparc32 > kernels. > Last I heard, qemu is ok for sun4m but sun4c had not been implemented. In the absence of documentation (everyone apears to have thrown there sun4c hardware documentation), nothing beats the real hardware. >> I have tried to identify a NULL pointer bug that has crepped into the code >> that runs /sbin/init but git bisect only gave me a kernel that will not >> build because of DMA changes. I tries some random selections to try and >> find a buildable/working kernel but without any sucess. >> >> Any sugestions as to how to track the issue down through the 2000+ commits >> since v2.6.22. At between 20 and 40min per build+test the time required to >> test each build untill I get one that works is excessive. > > This can be the problem with GIT bisects. > > Figure out what's NULL, then try to figure out why it might have > gotten that way. If you can't figure out why, add tracing code into > some choice locations (for example, do_sparc_fault() or similar) > that does something like: > > if (!strcmp(current->comm, "init") && > whatever = NULL) > printk("FOO is NULL at ..."); > > keep adding these until you see exactly what makes it NULL. This > is most doable when you have a very isolated time in which the > problem occurs, which fits perfectly to a case like init failing > to execute properly. > The null pointer Opos is in sun4c_update_mmu_cache. Although I am beginning to get to grips with sun4c memory management, I am still finding it difficult. > To be honest, once you find out what is NULL, it may be clear to > aparent what the cause is. I'm surprised you haven't figured > this out yet in the traces :-) > > I think analysis should be the first step before even considering a > GIT bisect, I only ever bisect when the crash is so mysterious that up > to an hour of code inspection and crash analysis and probing is unable > to reach an answer. And frankly you'll learn more and be better > prepared for future bug analysis if you don't resort to GIT bisect. I will take your advice on this and dump some prom_printf/printk's into the code to see what falls out. :-). > - > To unsubscribe from this list: send the line "unsubscribe sparclinux" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: Sparc32 not working:2.6.23-rc1 (git commit 2007-07-29 9:57 ` Mark Fortescue @ 2007-07-29 14:44 ` Mark Fortescue 0 siblings, 0 replies; 27+ messages in thread From: Mark Fortescue @ 2007-07-29 14:44 UTC (permalink / raw) To: David Miller; +Cc: sparclinux, linux-mm Hi David, I have finally located where my NULL pointer is. The problem is that I have not got a clue how it is getting set to NULL. In arch/sparc/mm/sun4c.c, add_ring_ordered, head->next is getting corrupted and is becoming a NULL pointer. This is ment to be a circular linked list so it should never be NULL. The simple explenation, since nothing significant apears to have changed in sun4c.c, is that some change in mm/memory.c is wrong/incompatible with sun4c mmu. The problem is that all the kernels I tried to build around the changes to the mm code don't build on Sparc32 due to the DMA changes. This makes it more dificult to be cirtain of the cause of the corruption. I am going to try to back out the mm/memory.c changes so that I can eliminate them as a cause. Unless someone who understands the memory management code spots an error, this is not going to be easy to track down and fix. Do you have any documentation on the sun4c mmu? If not, I am going to have to create some diagrams/documentation as tralling through the code takes forever and gets very confusing. I am struggel to understand what tables have what in them for the sun4c mmu. Regards Mark Fortescue. ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: Sparc32 not working:2.6.23-rc1 (git commit 1e4dcd22efa7d24f637ab2ea3a77dd65774eb005) @ 2007-07-29 14:44 ` Mark Fortescue 0 siblings, 0 replies; 27+ messages in thread From: Mark Fortescue @ 2007-07-29 14:44 UTC (permalink / raw) To: David Miller; +Cc: sparclinux, linux-mm Hi David, I have finally located where my NULL pointer is. The problem is that I have not got a clue how it is getting set to NULL. In arch/sparc/mm/sun4c.c, add_ring_ordered, head->next is getting corrupted and is becoming a NULL pointer. This is ment to be a circular linked list so it should never be NULL. The simple explenation, since nothing significant apears to have changed in sun4c.c, is that some change in mm/memory.c is wrong/incompatible with sun4c mmu. The problem is that all the kernels I tried to build around the changes to the mm code don't build on Sparc32 due to the DMA changes. This makes it more dificult to be cirtain of the cause of the corruption. I am going to try to back out the mm/memory.c changes so that I can eliminate them as a cause. Unless someone who understands the memory management code spots an error, this is not going to be easy to track down and fix. Do you have any documentation on the sun4c mmu? If not, I am going to have to create some diagrams/documentation as tralling through the code takes forever and gets very confusing. I am struggel to understand what tables have what in them for the sun4c mmu. Regards Mark Fortescue. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: Sparc32 not working:2.6.23-rc1 (git commit 2007-07-28 18:18 Sparc32 not working:2.6.23-rc1 (git commit 1e4dcd22efa7d24f637ab2ea3a77dd65774eb005) Mark Fortescue ` (6 preceding siblings ...) 2007-07-29 9:57 ` Mark Fortescue @ 2007-07-29 15:45 ` Krzysztof Helt 2007-07-29 18:26 ` Mark Fortescue 2007-07-29 20:56 ` Sparc32 not working:2.6.23-rc1 (git commit Krzysztof Helt ` (6 subsequent siblings) 14 siblings, 1 reply; 27+ messages in thread From: Krzysztof Helt @ 2007-07-29 15:45 UTC (permalink / raw) To: sparclinux On Sun, 29 Jul 2007 00:21:06 +0100 (BST) Mark Fortescue <mark@mtfhpc.demon.co.uk> wrote: > Hi Krzysztof, > > There have been lots of changes to the DMA system (git bisect is not > viable form my working 2.6.22 kernel as the dma changes kill the build for > over half the posible commits to check). It could be a side effect of > these changes. > It is not DMA I suppose. It does not happen in any specific place. It is easy to trigger by loading and unloading the sunlance module, but it hangs linux in other places (init process, console login). It happens only in SMP. If it happens in the sunlance module it happens in sparc_lance_probe_one() (in probing function). I thought it is due to openprom accesses so I commented them out (and put hardcoded values there). No real change. It is always in the probe_one method before any DMA is started. Sometimes it drops me to the prom prompt. I am not very experienced so I was able only to find (ctrace) that the prompt was called in the method spwin_bad_ustack_from_kernel() which got there from mna_handler (misaligned access) through kernel_unaligned_trap(). I don't know which function triggered the unaligned access. The %o register values sent to the kernel_unaligned_trap() are outside addresses from System.map and outside addresses of loaded (or just loaded the sunlance) modules. This is where I need help. How can I find where the misaligned access happened? Regards, Krzysztof ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: Sparc32 not working:2.6.23-rc1 (git commit 2007-07-29 15:45 ` Sparc32 not working:2.6.23-rc1 (git commit Krzysztof Helt 2007-07-29 18:26 ` Mark Fortescue @ 2007-07-29 18:26 ` Mark Fortescue 0 siblings, 0 replies; 27+ messages in thread From: Mark Fortescue @ 2007-07-29 18:26 UTC (permalink / raw) To: Krzysztof Helt; +Cc: sparclinux, linux-mm, linux-kernel On Sun, 29 Jul 2007, Krzysztof Helt wrote: > On Sun, 29 Jul 2007 00:21:06 +0100 (BST) > Mark Fortescue <mark@mtfhpc.demon.co.uk> wrote: > >> Hi Krzysztof, >> >> There have been lots of changes to the DMA system (git bisect is not >> viable form my working 2.6.22 kernel as the dma changes kill the build for >> over half the posible commits to check). It could be a side effect of >> these changes. >> > > It is not DMA I suppose. It does not happen in any specific place. It is easy to trigger by loading > and unloading the sunlance module, but it hangs linux in other places (init process, console login). > > It happens only in SMP. If it happens in the sunlance module it happens in sparc_lance_probe_one() > (in probing function). I thought it is due to openprom accesses so I commented them out (and put > hardcoded values there). No real change. It is always in the probe_one method before any DMA is > started. > > Sometimes it drops me to the prom prompt. I am not very experienced so I was able only to find (ctrace) that > the prompt was called in the method spwin_bad_ustack_from_kernel() which got there from mna_handler > (misaligned access) through kernel_unaligned_trap(). I don't know which function triggered the > unaligned access. The %o register values sent to the kernel_unaligned_trap() are outside addresses > from System.map and outside addresses of loaded (or just loaded the sunlance) modules. > > This is where I need help. How can I find where the misaligned access happened? > The is a memory corruption issue on Sparc32 - sun4c (I am going to try and track it done over the next few days). It sounds like it may affect more than just sun4c issue. Try going back to v2.6.22 and then appling f61698e6489f229f9fcfe29e68f228389a772993 - memset.S error, 196bffa5dc3181897bd32e41415ec0db8dbab5e7 - entry.S delay loops, f3c681c028846bd5d39f563909409832a295ca69 - Serial Console Locking (My last working kernel is v2.6.22 Commit eb6bf6bfb580afaf1e1a1d30cba17a078530cf4 with the first of the above two patches applied and some additional ones that fix verious sun partition/UFS filing sustem issues). I am going to try to cherry pick a set of commits to see if I can't get a better idear of where the memory corruption on sun4c is coming from. Build problems sue to the DMA changes make git bisecting un-usable untill I have found out which patches fix the DMA build issues. > Regards, > Krzysztof > - > To unsubscribe from this list: send the line "unsubscribe sparclinux" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: Sparc32 not working:2.6.23-rc1 (git commit 1e4dcd22efa7d24f637ab2ea3a77dd65774eb005) @ 2007-07-29 18:26 ` Mark Fortescue 0 siblings, 0 replies; 27+ messages in thread From: Mark Fortescue @ 2007-07-29 18:26 UTC (permalink / raw) To: Krzysztof Helt; +Cc: sparclinux, linux-mm, linux-kernel On Sun, 29 Jul 2007, Krzysztof Helt wrote: > On Sun, 29 Jul 2007 00:21:06 +0100 (BST) > Mark Fortescue <mark@mtfhpc.demon.co.uk> wrote: > >> Hi Krzysztof, >> >> There have been lots of changes to the DMA system (git bisect is not >> viable form my working 2.6.22 kernel as the dma changes kill the build for >> over half the posible commits to check). It could be a side effect of >> these changes. >> > > It is not DMA I suppose. It does not happen in any specific place. It is easy to trigger by loading > and unloading the sunlance module, but it hangs linux in other places (init process, console login). > > It happens only in SMP. If it happens in the sunlance module it happens in sparc_lance_probe_one() > (in probing function). I thought it is due to openprom accesses so I commented them out (and put > hardcoded values there). No real change. It is always in the probe_one method before any DMA is > started. > > Sometimes it drops me to the prom prompt. I am not very experienced so I was able only to find (ctrace) that > the prompt was called in the method spwin_bad_ustack_from_kernel() which got there from mna_handler > (misaligned access) through kernel_unaligned_trap(). I don't know which function triggered the > unaligned access. The %o register values sent to the kernel_unaligned_trap() are outside addresses > from System.map and outside addresses of loaded (or just loaded the sunlance) modules. > > This is where I need help. How can I find where the misaligned access happened? > The is a memory corruption issue on Sparc32 - sun4c (I am going to try and track it done over the next few days). It sounds like it may affect more than just sun4c issue. Try going back to v2.6.22 and then appling f61698e6489f229f9fcfe29e68f228389a772993 - memset.S error, 196bffa5dc3181897bd32e41415ec0db8dbab5e7 - entry.S delay loops, f3c681c028846bd5d39f563909409832a295ca69 - Serial Console Locking (My last working kernel is v2.6.22 Commit eb6bf6bfb580afaf1e1a1d30cba17a078530cf4 with the first of the above two patches applied and some additional ones that fix verious sun partition/UFS filing sustem issues). I am going to try to cherry pick a set of commits to see if I can't get a better idear of where the memory corruption on sun4c is coming from. Build problems sue to the DMA changes make git bisecting un-usable untill I have found out which patches fix the DMA build issues. > Regards, > Krzysztof > - > To unsubscribe from this list: send the line "unsubscribe sparclinux" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: Sparc32 not working:2.6.23-rc1 (git commit 1e4dcd22efa7d24f637ab2ea3a77dd65774eb005) @ 2007-07-29 18:26 ` Mark Fortescue 0 siblings, 0 replies; 27+ messages in thread From: Mark Fortescue @ 2007-07-29 18:26 UTC (permalink / raw) To: Krzysztof Helt; +Cc: sparclinux, linux-mm, linux-kernel On Sun, 29 Jul 2007, Krzysztof Helt wrote: > On Sun, 29 Jul 2007 00:21:06 +0100 (BST) > Mark Fortescue <mark@mtfhpc.demon.co.uk> wrote: > >> Hi Krzysztof, >> >> There have been lots of changes to the DMA system (git bisect is not >> viable form my working 2.6.22 kernel as the dma changes kill the build for >> over half the posible commits to check). It could be a side effect of >> these changes. >> > > It is not DMA I suppose. It does not happen in any specific place. It is easy to trigger by loading > and unloading the sunlance module, but it hangs linux in other places (init process, console login). > > It happens only in SMP. If it happens in the sunlance module it happens in sparc_lance_probe_one() > (in probing function). I thought it is due to openprom accesses so I commented them out (and put > hardcoded values there). No real change. It is always in the probe_one method before any DMA is > started. > > Sometimes it drops me to the prom prompt. I am not very experienced so I was able only to find (ctrace) that > the prompt was called in the method spwin_bad_ustack_from_kernel() which got there from mna_handler > (misaligned access) through kernel_unaligned_trap(). I don't know which function triggered the > unaligned access. The %o register values sent to the kernel_unaligned_trap() are outside addresses > from System.map and outside addresses of loaded (or just loaded the sunlance) modules. > > This is where I need help. How can I find where the misaligned access happened? > The is a memory corruption issue on Sparc32 - sun4c (I am going to try and track it done over the next few days). It sounds like it may affect more than just sun4c issue. Try going back to v2.6.22 and then appling f61698e6489f229f9fcfe29e68f228389a772993 - memset.S error, 196bffa5dc3181897bd32e41415ec0db8dbab5e7 - entry.S delay loops, f3c681c028846bd5d39f563909409832a295ca69 - Serial Console Locking (My last working kernel is v2.6.22 Commit eb6bf6bfb580afaf1e1a1d30cba17a078530cf4 with the first of the above two patches applied and some additional ones that fix verious sun partition/UFS filing sustem issues). I am going to try to cherry pick a set of commits to see if I can't get a better idear of where the memory corruption on sun4c is coming from. Build problems sue to the DMA changes make git bisecting un-usable untill I have found out which patches fix the DMA build issues. > Regards, > Krzysztof > - > To unsubscribe from this list: send the line "unsubscribe sparclinux" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: Sparc32 not working:2.6.23-rc1 (git commit 2007-07-29 18:26 ` Mark Fortescue (?) @ 2007-07-29 20:56 ` Adrian Bunk -1 siblings, 0 replies; 27+ messages in thread From: Adrian Bunk @ 2007-07-29 20:56 UTC (permalink / raw) To: Mark Fortescue; +Cc: Krzysztof Helt, sparclinux, linux-mm, linux-kernel On Sun, Jul 29, 2007 at 07:26:29PM +0100, Mark Fortescue wrote: >... > I am going to try to cherry pick a set of commits to see if I can't get a > better idear of where the memory corruption on sun4c is coming from. Build > problems sue to the DMA changes make git bisecting un-usable untill I have > found out which patches fix the DMA build issues. You have any known-good kernel? Boot back into this kernel for bisecting and compiling the kernels for bisecting there. cu Adrian -- "Is there not promise of rain?" Ling Tan asked suddenly out of the darkness. There had been need of rain for many days. "Only a promise," Lao Er said. Pearl S. Buck - Dragon Seed ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: Sparc32 not working:2.6.23-rc1 (git commit 1e4dcd22efa7d24f637ab2ea3a77dd65774eb005) @ 2007-07-29 20:56 ` Adrian Bunk 0 siblings, 0 replies; 27+ messages in thread From: Adrian Bunk @ 2007-07-29 20:56 UTC (permalink / raw) To: Mark Fortescue; +Cc: Krzysztof Helt, sparclinux, linux-mm, linux-kernel On Sun, Jul 29, 2007 at 07:26:29PM +0100, Mark Fortescue wrote: >... > I am going to try to cherry pick a set of commits to see if I can't get a > better idear of where the memory corruption on sun4c is coming from. Build > problems sue to the DMA changes make git bisecting un-usable untill I have > found out which patches fix the DMA build issues. You have any known-good kernel? Boot back into this kernel for bisecting and compiling the kernels for bisecting there. cu Adrian -- "Is there not promise of rain?" Ling Tan asked suddenly out of the darkness. There had been need of rain for many days. "Only a promise," Lao Er said. Pearl S. Buck - Dragon Seed -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: Sparc32 not working:2.6.23-rc1 (git commit 1e4dcd22efa7d24f637ab2ea3a77dd65774eb005) @ 2007-07-29 20:56 ` Adrian Bunk 0 siblings, 0 replies; 27+ messages in thread From: Adrian Bunk @ 2007-07-29 20:56 UTC (permalink / raw) To: Mark Fortescue; +Cc: Krzysztof Helt, sparclinux, linux-mm, linux-kernel On Sun, Jul 29, 2007 at 07:26:29PM +0100, Mark Fortescue wrote: >... > I am going to try to cherry pick a set of commits to see if I can't get a > better idear of where the memory corruption on sun4c is coming from. Build > problems sue to the DMA changes make git bisecting un-usable untill I have > found out which patches fix the DMA build issues. You have any known-good kernel? Boot back into this kernel for bisecting and compiling the kernels for bisecting there. cu Adrian -- "Is there not promise of rain?" Ling Tan asked suddenly out of the darkness. There had been need of rain for many days. "Only a promise," Lao Er said. Pearl S. Buck - Dragon Seed ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: Sparc32 not working:2.6.23-rc1 (git commit 2007-07-29 20:56 ` Adrian Bunk (?) @ 2007-07-29 22:01 ` Mark Fortescue -1 siblings, 0 replies; 27+ messages in thread From: Mark Fortescue @ 2007-07-29 22:01 UTC (permalink / raw) To: Adrian Bunk; +Cc: Krzysztof Helt, sparclinux, linux-mm, linux-kernel On Sun, 29 Jul 2007, Adrian Bunk wrote: > On Sun, Jul 29, 2007 at 07:26:29PM +0100, Mark Fortescue wrote: >> ... >> I am going to try to cherry pick a set of commits to see if I can't get a >> better idear of where the memory corruption on sun4c is coming from. Build >> problems sue to the DMA changes make git bisecting un-usable untill I have >> found out which patches fix the DMA build issues. > > You have any known-good kernel? > > Boot back into this kernel for bisecting and compiling the kernels for > bisecting there. > As I said, bisecting does not work if you can't build the kernel because of un-defined symbols spanning most of the revisions you are interested in. I have isolated the revisions that do not build so I should be able to cerry pick a commit/commits that fixes the build issues. Once done, I will be able to investigate the original issue. If it were practical to do a build test on all supported platforms before submitting patches then this would not be so much of an issue but ... > cu > Adrian > > -- > > "Is there not promise of rain?" Ling Tan asked suddenly out > of the darkness. There had been need of rain for many days. > "Only a promise," Lao Er said. > Pearl S. Buck - Dragon Seed > > - > To unsubscribe from this list: send the line "unsubscribe sparclinux" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: Sparc32 not working:2.6.23-rc1 (git commit 1e4dcd22efa7d24f637ab2ea3a77dd65774eb005) @ 2007-07-29 22:01 ` Mark Fortescue 0 siblings, 0 replies; 27+ messages in thread From: Mark Fortescue @ 2007-07-29 22:01 UTC (permalink / raw) To: Adrian Bunk; +Cc: Krzysztof Helt, sparclinux, linux-mm, linux-kernel On Sun, 29 Jul 2007, Adrian Bunk wrote: > On Sun, Jul 29, 2007 at 07:26:29PM +0100, Mark Fortescue wrote: >> ... >> I am going to try to cherry pick a set of commits to see if I can't get a >> better idear of where the memory corruption on sun4c is coming from. Build >> problems sue to the DMA changes make git bisecting un-usable untill I have >> found out which patches fix the DMA build issues. > > You have any known-good kernel? > > Boot back into this kernel for bisecting and compiling the kernels for > bisecting there. > As I said, bisecting does not work if you can't build the kernel because of un-defined symbols spanning most of the revisions you are interested in. I have isolated the revisions that do not build so I should be able to cerry pick a commit/commits that fixes the build issues. Once done, I will be able to investigate the original issue. If it were practical to do a build test on all supported platforms before submitting patches then this would not be so much of an issue but ... > cu > Adrian > > -- > > "Is there not promise of rain?" Ling Tan asked suddenly out > of the darkness. There had been need of rain for many days. > "Only a promise," Lao Er said. > Pearl S. Buck - Dragon Seed > > - > To unsubscribe from this list: send the line "unsubscribe sparclinux" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: Sparc32 not working:2.6.23-rc1 (git commit 1e4dcd22efa7d24f637ab2ea3a77dd65774eb005) @ 2007-07-29 22:01 ` Mark Fortescue 0 siblings, 0 replies; 27+ messages in thread From: Mark Fortescue @ 2007-07-29 22:01 UTC (permalink / raw) To: Adrian Bunk; +Cc: Krzysztof Helt, sparclinux, linux-mm, linux-kernel On Sun, 29 Jul 2007, Adrian Bunk wrote: > On Sun, Jul 29, 2007 at 07:26:29PM +0100, Mark Fortescue wrote: >> ... >> I am going to try to cherry pick a set of commits to see if I can't get a >> better idear of where the memory corruption on sun4c is coming from. Build >> problems sue to the DMA changes make git bisecting un-usable untill I have >> found out which patches fix the DMA build issues. > > You have any known-good kernel? > > Boot back into this kernel for bisecting and compiling the kernels for > bisecting there. > As I said, bisecting does not work if you can't build the kernel because of un-defined symbols spanning most of the revisions you are interested in. I have isolated the revisions that do not build so I should be able to cerry pick a commit/commits that fixes the build issues. Once done, I will be able to investigate the original issue. If it were practical to do a build test on all supported platforms before submitting patches then this would not be so much of an issue but ... > cu > Adrian > > -- > > "Is there not promise of rain?" Ling Tan asked suddenly out > of the darkness. There had been need of rain for many days. > "Only a promise," Lao Er said. > Pearl S. Buck - Dragon Seed > > - > To unsubscribe from this list: send the line "unsubscribe sparclinux" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: Sparc32 not working:2.6.23-rc1 (git commit 2007-07-28 18:18 Sparc32 not working:2.6.23-rc1 (git commit 1e4dcd22efa7d24f637ab2ea3a77dd65774eb005) Mark Fortescue ` (7 preceding siblings ...) 2007-07-29 15:45 ` Sparc32 not working:2.6.23-rc1 (git commit Krzysztof Helt @ 2007-07-29 20:56 ` Krzysztof Helt 2007-07-29 21:54 ` Mark Fortescue ` (5 subsequent siblings) 14 siblings, 0 replies; 27+ messages in thread From: Krzysztof Helt @ 2007-07-29 20:56 UTC (permalink / raw) To: sparclinux On Sun, 29 Jul 2007 17:45:35 +0200 Krzysztof Helt <krzysztof.h1@wp.pl> wrote: > It is not DMA I suppose. It does not happen in any specific place. It is easy to trigger by loading > and unloading the sunlance module, but it hangs linux in other places (init process, console login). > > It happens only in SMP. If it happens in the sunlance module it happens in sparc_lance_probe_one() > (in probing function). I thought it is due to openprom accesses so I commented them out (and put > hardcoded values there). No real change. It is always in the probe_one method before any DMA is > started. > I was able to find out that it is definitely prom related. When I removed also prom_node_has_property() call, there is no bug any more. It locks inside prom_XXX access functions (e.g. __prom_nextprop or prom_getproplen). The old prom system was working so I think the new openprom patches created this bug. How does the new system access the prom? Is the old prom lock is taken into consideration? Regards, Krzysztof ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: Sparc32 not working:2.6.23-rc1 (git commit 2007-07-28 18:18 Sparc32 not working:2.6.23-rc1 (git commit 1e4dcd22efa7d24f637ab2ea3a77dd65774eb005) Mark Fortescue ` (8 preceding siblings ...) 2007-07-29 20:56 ` Sparc32 not working:2.6.23-rc1 (git commit Krzysztof Helt @ 2007-07-29 21:54 ` Mark Fortescue 2007-07-30 14:19 ` Mark Fortescue ` (4 subsequent siblings) 14 siblings, 0 replies; 27+ messages in thread From: Mark Fortescue @ 2007-07-29 21:54 UTC (permalink / raw) To: sparclinux On Sun, 29 Jul 2007, Krzysztof Helt wrote: > On Sun, 29 Jul 2007 17:45:35 +0200 > Krzysztof Helt <krzysztof.h1@wp.pl> wrote: > >> It is not DMA I suppose. It does not happen in any specific place. It is easy to trigger by loading >> and unloading the sunlance module, but it hangs linux in other places (init process, console login). >> >> It happens only in SMP. If it happens in the sunlance module it happens in sparc_lance_probe_one() >> (in probing function). I thought it is due to openprom accesses so I commented them out (and put >> hardcoded values there). No real change. It is always in the probe_one method before any DMA is >> started. >> > > I was able to find out that it is definitely prom related. When I removed also prom_node_has_property() call, > there is no bug any more. It locks inside prom_XXX access functions (e.g. __prom_nextprop or prom_getproplen). > > The old prom system was working so I think the new openprom patches created this bug. > > How does the new system access the prom? Is the old prom lock is taken into consideration? The lock is taken into consideration however, looking at the code, there seems to be an issue with the new code for Sparc32. It does not seem tie up with the code used before!!!. If this is rearly the case then this would explain the memory corruption I am seeing as the functions in tree.c that call the openprom to not match the previous working versions. I will try to workout what has happened. > > Regards, > Krzysztof > > ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: Sparc32 not working:2.6.23-rc1 (git commit 2007-07-28 18:18 Sparc32 not working:2.6.23-rc1 (git commit 1e4dcd22efa7d24f637ab2ea3a77dd65774eb005) Mark Fortescue ` (9 preceding siblings ...) 2007-07-29 21:54 ` Mark Fortescue @ 2007-07-30 14:19 ` Mark Fortescue 2007-07-30 18:16 ` Krzysztof Helt ` (3 subsequent siblings) 14 siblings, 0 replies; 27+ messages in thread From: Mark Fortescue @ 2007-07-30 14:19 UTC (permalink / raw) To: sparclinux [-- Attachment #1: Type: TEXT/PLAIN, Size: 2050 bytes --] Hi Krzysztof, On Sun, 29 Jul 2007, Mark Fortescue wrote: > > > On Sun, 29 Jul 2007, Krzysztof Helt wrote: > >> On Sun, 29 Jul 2007 17:45:35 +0200 >> Krzysztof Helt <krzysztof.h1@wp.pl> wrote: >> >>> It is not DMA I suppose. It does not happen in any specific place. It is >>> easy to trigger by loading >>> and unloading the sunlance module, but it hangs linux in other places >>> (init process, console login). >>> >>> It happens only in SMP. If it happens in the sunlance module it happens in >>> sparc_lance_probe_one() >>> (in probing function). I thought it is due to openprom accesses so I >>> commented them out (and put >>> hardcoded values there). No real change. It is always in the probe_one >>> method before any DMA is >>> started. >>> >> >> I was able to find out that it is definitely prom related. When I removed >> also prom_node_has_property() call, >> there is no bug any more. It locks inside prom_XXX access functions (e.g. >> __prom_nextprop or prom_getproplen). >> >> The old prom system was working so I think the new openprom patches created >> this bug. >> >> How does the new system access the prom? Is the old prom lock is taken into >> consideration? > > The lock is taken into consideration however, looking at the code, there > seems to be an issue with the new code for Sparc32. It does not seem tie up > with the code used before!!!. If this is rearly the case then this would > explain the memory corruption I am seeing as the functions in tree.c that > call the openprom to not match the previous working versions. > > I will try to workout what has happened. > I have found a commit that messes up sun4c. On removal of this commit I have a working kernel so if there are any problems in the prom code, they do not show up on my SS1 clone (V0 Prom) or SS2 (V2 Prom). I have attached the commit that I have had to temporally back out incase it is a general issue for Sparc32. Could you do a test for me with your test code but with the attached patch backed out? Regards Mark Fortescue. [-- Attachment #2: Type: TEXT/PLAIN, Size: 43581 bytes --] diff --git a/arch/ia64/ia32/binfmt_elf32.c b/arch/ia64/ia32/binfmt_elf32.c index 6f4d3d0..e1189ba 100644 --- a/arch/ia64/ia32/binfmt_elf32.c +++ b/arch/ia64/ia32/binfmt_elf32.c @@ -195,62 +195,27 @@ ia64_elf32_init (struct pt_regs *regs) ia32_load_state(current); } +/* + * Undo the override of setup_arg_pages() without this ia32_setup_arg_pages() + * will suffer infinite self recursion. + */ +#undef setup_arg_pages + int ia32_setup_arg_pages (struct linux_binprm *bprm, int executable_stack) { - unsigned long stack_base; - struct vm_area_struct *mpnt; - struct mm_struct *mm = current->mm; - int i, ret; - - stack_base = IA32_STACK_TOP - MAX_ARG_PAGES*PAGE_SIZE; - mm->arg_start = bprm->p + stack_base; - - bprm->p += stack_base; - if (bprm->loader) - bprm->loader += stack_base; - bprm->exec += stack_base; - - mpnt = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL); - if (!mpnt) - return -ENOMEM; - - down_write(¤t->mm->mmap_sem); - { - mpnt->vm_mm = current->mm; - mpnt->vm_start = PAGE_MASK & (unsigned long) bprm->p; - mpnt->vm_end = IA32_STACK_TOP; - if (executable_stack == EXSTACK_ENABLE_X) - mpnt->vm_flags = VM_STACK_FLAGS | VM_EXEC; - else if (executable_stack == EXSTACK_DISABLE_X) - mpnt->vm_flags = VM_STACK_FLAGS & ~VM_EXEC; - else - mpnt->vm_flags = VM_STACK_FLAGS; - mpnt->vm_page_prot = (mpnt->vm_flags & VM_EXEC)? - PAGE_COPY_EXEC: PAGE_COPY; - if ((ret = insert_vm_struct(current->mm, mpnt))) { - up_write(¤t->mm->mmap_sem); - kmem_cache_free(vm_area_cachep, mpnt); - return ret; - } - current->mm->stack_vm = current->mm->total_vm = vma_pages(mpnt); + int ret; + + ret = setup_arg_pages(bprm, IA32_STACK_TOP, executable_stack); + if (!ret) { + /* + * Can't do it in ia64_elf32_init(). Needs to be done before + * calls to elf32_map() + */ + current->thread.ppl = ia32_init_pp_list(); } - for (i = 0 ; i < MAX_ARG_PAGES ; i++) { - struct page *page = bprm->page[i]; - if (page) { - bprm->page[i] = NULL; - install_arg_page(mpnt, page, stack_base); - } - stack_base += PAGE_SIZE; - } - up_write(¤t->mm->mmap_sem); - - /* Can't do it in ia64_elf32_init(). Needs to be done before calls to - elf32_map() */ - current->thread.ppl = ia32_init_pp_list(); - - return 0; + return ret; } static void diff --git a/arch/x86_64/ia32/ia32_aout.c b/arch/x86_64/ia32/ia32_aout.c index fe83edb..0878137 100644 --- a/arch/x86_64/ia32/ia32_aout.c +++ b/arch/x86_64/ia32/ia32_aout.c @@ -404,7 +404,7 @@ beyond_if: set_brk(current->mm->start_brk, current->mm->brk); - retval = ia32_setup_arg_pages(bprm, IA32_STACK_TOP, EXSTACK_DEFAULT); + retval = setup_arg_pages(bprm, IA32_STACK_TOP, EXSTACK_DEFAULT); if (retval < 0) { /* Someone check-me: is this error path enough? */ send_sig(SIGKILL, current, 0); diff --git a/arch/x86_64/ia32/ia32_binfmt.c b/arch/x86_64/ia32/ia32_binfmt.c index 185399b..ed56a88 100644 --- a/arch/x86_64/ia32/ia32_binfmt.c +++ b/arch/x86_64/ia32/ia32_binfmt.c @@ -232,9 +232,6 @@ do { \ #define load_elf_binary load_elf32_binary #define ELF_PLAT_INIT(r, load_addr) elf32_init(r) -#define setup_arg_pages(bprm, stack_top, exec_stack) \ - ia32_setup_arg_pages(bprm, stack_top, exec_stack) -int ia32_setup_arg_pages(struct linux_binprm *bprm, unsigned long stack_top, int executable_stack); #undef start_thread #define start_thread(regs,new_rip,new_rsp) do { \ @@ -286,61 +283,6 @@ static void elf32_init(struct pt_regs *regs) me->thread.es = __USER_DS; } -int ia32_setup_arg_pages(struct linux_binprm *bprm, unsigned long stack_top, - int executable_stack) -{ - unsigned long stack_base; - struct vm_area_struct *mpnt; - struct mm_struct *mm = current->mm; - int i, ret; - - stack_base = stack_top - MAX_ARG_PAGES * PAGE_SIZE; - mm->arg_start = bprm->p + stack_base; - - bprm->p += stack_base; - if (bprm->loader) - bprm->loader += stack_base; - bprm->exec += stack_base; - - mpnt = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL); - if (!mpnt) - return -ENOMEM; - - down_write(&mm->mmap_sem); - { - mpnt->vm_mm = mm; - mpnt->vm_start = PAGE_MASK & (unsigned long) bprm->p; - mpnt->vm_end = stack_top; - if (executable_stack == EXSTACK_ENABLE_X) - mpnt->vm_flags = VM_STACK_FLAGS | VM_EXEC; - else if (executable_stack == EXSTACK_DISABLE_X) - mpnt->vm_flags = VM_STACK_FLAGS & ~VM_EXEC; - else - mpnt->vm_flags = VM_STACK_FLAGS; - mpnt->vm_page_prot = (mpnt->vm_flags & VM_EXEC) ? - PAGE_COPY_EXEC : PAGE_COPY; - if ((ret = insert_vm_struct(mm, mpnt))) { - up_write(&mm->mmap_sem); - kmem_cache_free(vm_area_cachep, mpnt); - return ret; - } - mm->stack_vm = mm->total_vm = vma_pages(mpnt); - } - - for (i = 0 ; i < MAX_ARG_PAGES ; i++) { - struct page *page = bprm->page[i]; - if (page) { - bprm->page[i] = NULL; - install_arg_page(mpnt, page, stack_base); - } - stack_base += PAGE_SIZE; - } - up_write(&mm->mmap_sem); - - return 0; -} -EXPORT_SYMBOL(ia32_setup_arg_pages); - #ifdef CONFIG_SYSCTL /* Register vsyscall32 into the ABI table */ #include <linux/sysctl.h> diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index a27e42b..295cbaa 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -148,6 +148,7 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec, elf_addr_t *elf_info; int ei_index = 0; struct task_struct *tsk = current; + struct vm_area_struct *vma; /* * If this architecture has a platform capability string, copy it @@ -234,6 +235,15 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec, sp = (elf_addr_t __user *)bprm->p; #endif + + /* + * Grow the stack manually; some architectures have a limit on how + * far ahead a user-space access may be in order to grow the stack. + */ + vma = find_extend_vma(current->mm, bprm->p); + if (!vma) + return -EFAULT; + /* Now, let's put argc (and argv, envp if appropriate) on the stack */ if (__put_user(argc, sp++)) return -EFAULT; @@ -254,8 +264,8 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec, size_t len; if (__put_user((elf_addr_t)p, argv++)) return -EFAULT; - len = strnlen_user((void __user *)p, PAGE_SIZE*MAX_ARG_PAGES); - if (!len || len > PAGE_SIZE*MAX_ARG_PAGES) + len = strnlen_user((void __user *)p, MAX_ARG_STRLEN); + if (!len || len > MAX_ARG_STRLEN) return 0; p += len; } @@ -266,8 +276,8 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec, size_t len; if (__put_user((elf_addr_t)p, envp++)) return -EFAULT; - len = strnlen_user((void __user *)p, PAGE_SIZE*MAX_ARG_PAGES); - if (!len || len > PAGE_SIZE*MAX_ARG_PAGES) + len = strnlen_user((void __user *)p, MAX_ARG_STRLEN); + if (!len || len > MAX_ARG_STRLEN) return 0; p += len; } @@ -826,10 +836,6 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs) } /* OK, This is the point of no return */ - current->mm->start_data = 0; - current->mm->end_data = 0; - current->mm->end_code = 0; - current->mm->mmap = NULL; current->flags &= ~PF_FORKNOEXEC; current->mm->def_flags = def_flags; @@ -1051,9 +1057,13 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs) compute_creds(bprm); current->flags &= ~PF_FORKNOEXEC; - create_elf_tables(bprm, &loc->elf_ex, + retval = create_elf_tables(bprm, &loc->elf_ex, (interpreter_type == INTERPRETER_AOUT), load_addr, interp_load_addr); + if (retval < 0) { + send_sig(SIGKILL, current, 0); + goto out; + } /* N.B. passed_fileno might not be initialized? */ if (interpreter_type == INTERPRETER_AOUT) current->mm->arg_start += strlen(passed_fileno) + 1; diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c index 9d62fba..4739506 100644 --- a/fs/binfmt_elf_fdpic.c +++ b/fs/binfmt_elf_fdpic.c @@ -621,8 +621,8 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm, p = (char __user *) current->mm->arg_start; for (loop = bprm->argc; loop > 0; loop--) { __put_user((elf_caddr_t) p, argv++); - len = strnlen_user(p, PAGE_SIZE * MAX_ARG_PAGES); - if (!len || len > PAGE_SIZE * MAX_ARG_PAGES) + len = strnlen_user(p, MAX_ARG_STRLEN); + if (!len || len > MAX_ARG_STRLEN) return -EINVAL; p += len; } @@ -633,8 +633,8 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm, current->mm->env_start = (unsigned long) p; for (loop = bprm->envc; loop > 0; loop--) { __put_user((elf_caddr_t)(unsigned long) p, envp++); - len = strnlen_user(p, PAGE_SIZE * MAX_ARG_PAGES); - if (!len || len > PAGE_SIZE * MAX_ARG_PAGES) + len = strnlen_user(p, MAX_ARG_STRLEN); + if (!len || len > MAX_ARG_STRLEN) return -EINVAL; p += len; } diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c index 330fd3f..42e94b3 100644 --- a/fs/binfmt_misc.c +++ b/fs/binfmt_misc.c @@ -126,7 +126,9 @@ static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs) goto _ret; if (!(fmt->flags & MISC_FMT_PRESERVE_ARGV0)) { - remove_arg_zero(bprm); + retval = remove_arg_zero(bprm); + if (retval) + goto _ret; } if (fmt->flags & MISC_FMT_OPEN_BINARY) { diff --git a/fs/binfmt_script.c b/fs/binfmt_script.c index 304c885..4d0e0f6 100644 --- a/fs/binfmt_script.c +++ b/fs/binfmt_script.c @@ -67,7 +67,9 @@ static int load_script(struct linux_binprm *bprm,struct pt_regs *regs) * This is done in reverse order, because of how the * user environment and arguments are stored. */ - remove_arg_zero(bprm); + retval = remove_arg_zero(bprm); + if (retval) + return retval; retval = copy_strings_kernel(1, &bprm->interp, bprm); if (retval < 0) return retval; bprm->argc++; diff --git a/fs/compat.c b/fs/compat.c index 4db6216..15078ce 100644 --- a/fs/compat.c +++ b/fs/compat.c @@ -1257,6 +1257,7 @@ static int compat_copy_strings(int argc, compat_uptr_t __user *argv, { struct page *kmapped_page = NULL; char *kaddr = NULL; + unsigned long kpos = 0; int ret; while (argc-- > 0) { @@ -1265,92 +1266,84 @@ static int compat_copy_strings(int argc, compat_uptr_t __user *argv, unsigned long pos; if (get_user(str, argv+argc) || - !(len = strnlen_user(compat_ptr(str), bprm->p))) { + !(len = strnlen_user(compat_ptr(str), MAX_ARG_STRLEN))) { ret = -EFAULT; goto out; } - if (bprm->p < len) { + if (len > MAX_ARG_STRLEN) { ret = -E2BIG; goto out; } - bprm->p -= len; - /* XXX: add architecture specific overflow check here. */ + /* We're going to work our way backwords. */ pos = bprm->p; + str += len; + bprm->p -= len; while (len > 0) { - int i, new, err; int offset, bytes_to_copy; - struct page *page; offset = pos % PAGE_SIZE; - i = pos/PAGE_SIZE; - page = bprm->page[i]; - new = 0; - if (!page) { - page = alloc_page(GFP_HIGHUSER); - bprm->page[i] = page; - if (!page) { - ret = -ENOMEM; + if (offset == 0) + offset = PAGE_SIZE; + + bytes_to_copy = offset; + if (bytes_to_copy > len) + bytes_to_copy = len; + + offset -= bytes_to_copy; + pos -= bytes_to_copy; + str -= bytes_to_copy; + len -= bytes_to_copy; + + if (!kmapped_page || kpos != (pos & PAGE_MASK)) { + struct page *page; + +#ifdef CONFIG_STACK_GROWSUP + ret = expand_stack_downwards(bprm->vma, pos); + if (ret < 0) { + /* We've exceed the stack rlimit. */ + ret = -E2BIG; + goto out; + } +#endif + ret = get_user_pages(current, bprm->mm, pos, + 1, 1, 1, &page, NULL); + if (ret <= 0) { + /* We've exceed the stack rlimit. */ + ret = -E2BIG; goto out; } - new = 1; - } - if (page != kmapped_page) { - if (kmapped_page) + if (kmapped_page) { + flush_kernel_dcache_page(kmapped_page); kunmap(kmapped_page); + put_page(kmapped_page); + } kmapped_page = page; kaddr = kmap(kmapped_page); + kpos = pos & PAGE_MASK; + flush_cache_page(bprm->vma, kpos, + page_to_pfn(kmapped_page)); } - if (new && offset) - memset(kaddr, 0, offset); - bytes_to_copy = PAGE_SIZE - offset; - if (bytes_to_copy > len) { - bytes_to_copy = len; - if (new) - memset(kaddr+offset+len, 0, - PAGE_SIZE-offset-len); - } - err = copy_from_user(kaddr+offset, compat_ptr(str), - bytes_to_copy); - if (err) { + if (copy_from_user(kaddr+offset, compat_ptr(str), + bytes_to_copy)) { ret = -EFAULT; goto out; } - - pos += bytes_to_copy; - str += bytes_to_copy; - len -= bytes_to_copy; } } ret = 0; out: - if (kmapped_page) + if (kmapped_page) { + flush_kernel_dcache_page(kmapped_page); kunmap(kmapped_page); - return ret; -} - -#ifdef CONFIG_MMU - -#define free_arg_pages(bprm) do { } while (0) - -#else - -static inline void free_arg_pages(struct linux_binprm *bprm) -{ - int i; - - for (i = 0; i < MAX_ARG_PAGES; i++) { - if (bprm->page[i]) - __free_page(bprm->page[i]); - bprm->page[i] = NULL; + put_page(kmapped_page); } + return ret; } -#endif /* CONFIG_MMU */ - /* * compat_do_execve() is mostly a copy of do_execve(), with the exception * that it processes 32 bit argv and envp pointers. @@ -1363,7 +1356,6 @@ int compat_do_execve(char * filename, struct linux_binprm *bprm; struct file *file; int retval; - int i; retval = -ENOMEM; bprm = kzalloc(sizeof(*bprm), GFP_KERNEL); @@ -1377,24 +1369,19 @@ int compat_do_execve(char * filename, sched_exec(); - bprm->p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *); bprm->file = file; bprm->filename = filename; bprm->interp = filename; - bprm->mm = mm_alloc(); - retval = -ENOMEM; - if (!bprm->mm) - goto out_file; - retval = init_new_context(current, bprm->mm); - if (retval < 0) - goto out_mm; + retval = bprm_mm_init(bprm); + if (retval) + goto out_file; - bprm->argc = compat_count(argv, bprm->p / sizeof(compat_uptr_t)); + bprm->argc = compat_count(argv, MAX_ARG_STRINGS); if ((retval = bprm->argc) < 0) goto out_mm; - bprm->envc = compat_count(envp, bprm->p / sizeof(compat_uptr_t)); + bprm->envc = compat_count(envp, MAX_ARG_STRINGS); if ((retval = bprm->envc) < 0) goto out_mm; @@ -1421,8 +1408,6 @@ int compat_do_execve(char * filename, retval = search_binary_handler(bprm, regs); if (retval >= 0) { - free_arg_pages(bprm); - /* execve success */ security_bprm_free(bprm); acct_update_integrals(current); @@ -1431,19 +1416,12 @@ int compat_do_execve(char * filename, } out: - /* Something went wrong, return the inode and free the argument pages*/ - for (i = 0 ; i < MAX_ARG_PAGES ; i++) { - struct page * page = bprm->page[i]; - if (page) - __free_page(page); - } - if (bprm->security) security_bprm_free(bprm); out_mm: if (bprm->mm) - mmdrop(bprm->mm); + mmput(bprm->mm); out_file: if (bprm->file) { diff --git a/fs/exec.c b/fs/exec.c index 2e3f795..498f2b3 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -54,6 +54,7 @@ #include <asm/uaccess.h> #include <asm/mmu_context.h> +#include <asm/tlb.h> #ifdef CONFIG_KMOD #include <linux/kmod.h> @@ -178,6 +179,207 @@ exit: goto out; } +#ifdef CONFIG_MMU + +static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos, + int write) +{ + struct page *page; + int ret; + +#ifdef CONFIG_STACK_GROWSUP + if (write) { + ret = expand_stack_downwards(bprm->vma, pos); + if (ret < 0) + return NULL; + } +#endif + ret = get_user_pages(current, bprm->mm, pos, + 1, write, 1, &page, NULL); + if (ret <= 0) + return NULL; + + if (write) { + struct rlimit *rlim = current->signal->rlim; + unsigned long size = bprm->vma->vm_end - bprm->vma->vm_start; + + /* + * Limit to 1/4-th the stack size for the argv+env strings. + * This ensures that: + * - the remaining binfmt code will not run out of stack space, + * - the program will have a reasonable amount of stack left + * to work from. + */ + if (size > rlim[RLIMIT_STACK].rlim_cur / 4) { + put_page(page); + return NULL; + } + } + + return page; +} + +static void put_arg_page(struct page *page) +{ + put_page(page); +} + +static void free_arg_page(struct linux_binprm *bprm, int i) +{ +} + +static void free_arg_pages(struct linux_binprm *bprm) +{ +} + +static void flush_arg_page(struct linux_binprm *bprm, unsigned long pos, + struct page *page) +{ + flush_cache_page(bprm->vma, pos, page_to_pfn(page)); +} + +static int __bprm_mm_init(struct linux_binprm *bprm) +{ + int err = -ENOMEM; + struct vm_area_struct *vma = NULL; + struct mm_struct *mm = bprm->mm; + + bprm->vma = vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL); + if (!vma) + goto err; + + down_write(&mm->mmap_sem); + vma->vm_mm = mm; + + /* + * Place the stack at the largest stack address the architecture + * supports. Later, we'll move this to an appropriate place. We don't + * use STACK_TOP because that can depend on attributes which aren't + * configured yet. + */ + vma->vm_end = STACK_TOP_MAX; + vma->vm_start = vma->vm_end - PAGE_SIZE; + + vma->vm_flags = VM_STACK_FLAGS; + vma->vm_page_prot = protection_map[vma->vm_flags & 0x7]; + err = insert_vm_struct(mm, vma); + if (err) { + up_write(&mm->mmap_sem); + goto err; + } + + mm->stack_vm = mm->total_vm = 1; + up_write(&mm->mmap_sem); + + bprm->p = vma->vm_end - sizeof(void *); + + return 0; + +err: + if (vma) { + bprm->vma = NULL; + kmem_cache_free(vm_area_cachep, vma); + } + + return err; +} + +static bool valid_arg_len(struct linux_binprm *bprm, long len) +{ + return len <= MAX_ARG_STRLEN; +} + +#else + +static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos, + int write) +{ + struct page *page; + + page = bprm->page[pos / PAGE_SIZE]; + if (!page && write) { + page = alloc_page(GFP_HIGHUSER|__GFP_ZERO); + if (!page) + return NULL; + bprm->page[pos / PAGE_SIZE] = page; + } + + return page; +} + +static void put_arg_page(struct page *page) +{ +} + +static void free_arg_page(struct linux_binprm *bprm, int i) +{ + if (bprm->page[i]) { + __free_page(bprm->page[i]); + bprm->page[i] = NULL; + } +} + +static void free_arg_pages(struct linux_binprm *bprm) +{ + int i; + + for (i = 0; i < MAX_ARG_PAGES; i++) + free_arg_page(bprm, i); +} + +static void flush_arg_page(struct linux_binprm *bprm, unsigned long pos, + struct page *page) +{ +} + +static int __bprm_mm_init(struct linux_binprm *bprm) +{ + bprm->p = PAGE_SIZE * MAX_ARG_PAGES - sizeof(void *); + return 0; +} + +static bool valid_arg_len(struct linux_binprm *bprm, long len) +{ + return len <= bprm->p; +} + +#endif /* CONFIG_MMU */ + +/* + * Create a new mm_struct and populate it with a temporary stack + * vm_area_struct. We don't have enough context at this point to set the stack + * flags, permissions, and offset, so we use temporary values. We'll update + * them later in setup_arg_pages(). + */ +int bprm_mm_init(struct linux_binprm *bprm) +{ + int err; + struct mm_struct *mm = NULL; + + bprm->mm = mm = mm_alloc(); + err = -ENOMEM; + if (!mm) + goto err; + + err = init_new_context(current, mm); + if (err) + goto err; + + err = __bprm_mm_init(bprm); + if (err) + goto err; + + return 0; + +err: + if (mm) { + bprm->mm = NULL; + mmdrop(mm); + } + + return err; +} + /* * count() counts the number of strings in array ARGV. */ @@ -203,15 +405,16 @@ static int count(char __user * __user * argv, int max) } /* - * 'copy_strings()' copies argument/environment strings from user - * memory to free pages in kernel mem. These are in a format ready - * to be put directly into the top of new user memory. + * 'copy_strings()' copies argument/environment strings from the old + * processes's memory to the new process's stack. The call to get_user_pages() + * ensures the destination page is created and not swapped out. */ static int copy_strings(int argc, char __user * __user * argv, struct linux_binprm *bprm) { struct page *kmapped_page = NULL; char *kaddr = NULL; + unsigned long kpos = 0; int ret; while (argc-- > 0) { @@ -220,69 +423,69 @@ static int copy_strings(int argc, char __user * __user * argv, unsigned long pos; if (get_user(str, argv+argc) || - !(len = strnlen_user(str, bprm->p))) { + !(len = strnlen_user(str, MAX_ARG_STRLEN))) { ret = -EFAULT; goto out; } - if (bprm->p < len) { + if (!valid_arg_len(bprm, len)) { ret = -E2BIG; goto out; } - bprm->p -= len; - /* XXX: add architecture specific overflow check here. */ + /* We're going to work our way backwords. */ pos = bprm->p; + str += len; + bprm->p -= len; while (len > 0) { - int i, new, err; int offset, bytes_to_copy; - struct page *page; offset = pos % PAGE_SIZE; - i = pos/PAGE_SIZE; - page = bprm->page[i]; - new = 0; - if (!page) { - page = alloc_page(GFP_HIGHUSER); - bprm->page[i] = page; + if (offset == 0) + offset = PAGE_SIZE; + + bytes_to_copy = offset; + if (bytes_to_copy > len) + bytes_to_copy = len; + + offset -= bytes_to_copy; + pos -= bytes_to_copy; + str -= bytes_to_copy; + len -= bytes_to_copy; + + if (!kmapped_page || kpos != (pos & PAGE_MASK)) { + struct page *page; + + page = get_arg_page(bprm, pos, 1); if (!page) { - ret = -ENOMEM; + ret = -E2BIG; goto out; } - new = 1; - } - if (page != kmapped_page) { - if (kmapped_page) + if (kmapped_page) { + flush_kernel_dcache_page(kmapped_page); kunmap(kmapped_page); + put_arg_page(kmapped_page); + } kmapped_page = page; kaddr = kmap(kmapped_page); + kpos = pos & PAGE_MASK; + flush_arg_page(bprm, kpos, kmapped_page); } - if (new && offset) - memset(kaddr, 0, offset); - bytes_to_copy = PAGE_SIZE - offset; - if (bytes_to_copy > len) { - bytes_to_copy = len; - if (new) - memset(kaddr+offset+len, 0, - PAGE_SIZE-offset-len); - } - err = copy_from_user(kaddr+offset, str, bytes_to_copy); - if (err) { + if (copy_from_user(kaddr+offset, str, bytes_to_copy)) { ret = -EFAULT; goto out; } - - pos += bytes_to_copy; - str += bytes_to_copy; - len -= bytes_to_copy; } } ret = 0; out: - if (kmapped_page) + if (kmapped_page) { + flush_kernel_dcache_page(kmapped_page); kunmap(kmapped_page); + put_arg_page(kmapped_page); + } return ret; } @@ -298,181 +501,172 @@ int copy_strings_kernel(int argc,char ** argv, struct linux_binprm *bprm) set_fs(oldfs); return r; } - EXPORT_SYMBOL(copy_strings_kernel); #ifdef CONFIG_MMU + /* - * This routine is used to map in a page into an address space: needed by - * execve() for the initial stack and environment pages. + * During bprm_mm_init(), we create a temporary stack at STACK_TOP_MAX. Once + * the binfmt code determines where the new stack should reside, we shift it to + * its final location. The process proceeds as follows: * - * vma->vm_mm->mmap_sem is held for writing. + * 1) Use shift to calculate the new vma endpoints. + * 2) Extend vma to cover both the old and new ranges. This ensures the + * arguments passed to subsequent functions are consistent. + * 3) Move vma's page tables to the new range. + * 4) Free up any cleared pgd range. + * 5) Shrink the vma to cover only the new range. */ -void install_arg_page(struct vm_area_struct *vma, - struct page *page, unsigned long address) +static int shift_arg_pages(struct vm_area_struct *vma, unsigned long shift) { struct mm_struct *mm = vma->vm_mm; - pte_t * pte; - spinlock_t *ptl; + unsigned long old_start = vma->vm_start; + unsigned long old_end = vma->vm_end; + unsigned long length = old_end - old_start; + unsigned long new_start = old_start - shift; + unsigned long new_end = old_end - shift; + struct mmu_gather *tlb; - if (unlikely(anon_vma_prepare(vma))) - goto out; + BUG_ON(new_start > new_end); - flush_dcache_page(page); - pte = get_locked_pte(mm, address, &ptl); - if (!pte) - goto out; - if (!pte_none(*pte)) { - pte_unmap_unlock(pte, ptl); - goto out; + /* + * ensure there are no vmas between where we want to go + * and where we are + */ + if (vma != find_vma(mm, new_start)) + return -EFAULT; + + /* + * cover the whole range: [new_start, old_end) + */ + vma_adjust(vma, new_start, old_end, vma->vm_pgoff, NULL); + + /* + * move the page tables downwards, on failure we rely on + * process cleanup to remove whatever mess we made. + */ + if (length != move_page_tables(vma, old_start, + vma, new_start, length)) + return -ENOMEM; + + lru_add_drain(); + tlb = tlb_gather_mmu(mm, 0); + if (new_end > old_start) { + /* + * when the old and new regions overlap clear from new_end. + */ + free_pgd_range(&tlb, new_end, old_end, new_end, + vma->vm_next ? vma->vm_next->vm_start : 0); + } else { + /* + * otherwise, clean from old_start; this is done to not touch + * the address space in [new_end, old_start) some architectures + * have constraints on va-space that make this illegal (IA64) - + * for the others its just a little faster. + */ + free_pgd_range(&tlb, old_start, old_end, new_end, + vma->vm_next ? vma->vm_next->vm_start : 0); } - inc_mm_counter(mm, anon_rss); - lru_cache_add_active(page); - set_pte_at(mm, address, pte, pte_mkdirty(pte_mkwrite(mk_pte( - page, vma->vm_page_prot)))); - page_add_new_anon_rmap(page, vma, address); - pte_unmap_unlock(pte, ptl); - - /* no need for flush_tlb */ - return; -out: - __free_page(page); - force_sig(SIGKILL, current); + tlb_finish_mmu(tlb, new_end, old_end); + + /* + * shrink the vma to just the new range. + */ + vma_adjust(vma, new_start, new_end, vma->vm_pgoff, NULL); + + return 0; } #define EXTRA_STACK_VM_PAGES 20 /* random */ +/* + * Finalizes the stack vm_area_struct. The flags and permissions are updated, + * the stack is optionally relocated, and some extra space is added. + */ int setup_arg_pages(struct linux_binprm *bprm, unsigned long stack_top, int executable_stack) { - unsigned long stack_base; - struct vm_area_struct *mpnt; + unsigned long ret; + unsigned long stack_shift; struct mm_struct *mm = current->mm; - int i, ret; - long arg_size; + struct vm_area_struct *vma = bprm->vma; + struct vm_area_struct *prev = NULL; + unsigned long vm_flags; + unsigned long stack_base; #ifdef CONFIG_STACK_GROWSUP - /* Move the argument and environment strings to the bottom of the - * stack space. - */ - int offset, j; - char *to, *from; - - /* Start by shifting all the pages down */ - i = 0; - for (j = 0; j < MAX_ARG_PAGES; j++) { - struct page *page = bprm->page[j]; - if (!page) - continue; - bprm->page[i++] = page; - } - - /* Now move them within their pages */ - offset = bprm->p % PAGE_SIZE; - to = kmap(bprm->page[0]); - for (j = 1; j < i; j++) { - memmove(to, to + offset, PAGE_SIZE - offset); - from = kmap(bprm->page[j]); - memcpy(to + PAGE_SIZE - offset, from, offset); - kunmap(bprm->page[j - 1]); - to = from; - } - memmove(to, to + offset, PAGE_SIZE - offset); - kunmap(bprm->page[j - 1]); - /* Limit stack size to 1GB */ stack_base = current->signal->rlim[RLIMIT_STACK].rlim_max; if (stack_base > (1 << 30)) stack_base = 1 << 30; - stack_base = PAGE_ALIGN(stack_top - stack_base); - /* Adjust bprm->p to point to the end of the strings. */ - bprm->p = stack_base + PAGE_SIZE * i - offset; + /* Make sure we didn't let the argument array grow too large. */ + if (vma->vm_end - vma->vm_start > stack_base) + return -ENOMEM; - mm->arg_start = stack_base; - arg_size = i << PAGE_SHIFT; + stack_base = PAGE_ALIGN(stack_top - stack_base); - /* zero pages that were copied above */ - while (i < MAX_ARG_PAGES) - bprm->page[i++] = NULL; + stack_shift = vma->vm_start - stack_base; + mm->arg_start = bprm->p - stack_shift; + bprm->p = vma->vm_end - stack_shift; #else - stack_base = arch_align_stack(stack_top - MAX_ARG_PAGES*PAGE_SIZE); - stack_base = PAGE_ALIGN(stack_base); - bprm->p += stack_base; + stack_top = arch_align_stack(stack_top); + stack_top = PAGE_ALIGN(stack_top); + stack_shift = vma->vm_end - stack_top; + + bprm->p -= stack_shift; mm->arg_start = bprm->p; - arg_size = stack_top - (PAGE_MASK & (unsigned long) mm->arg_start); #endif - arg_size += EXTRA_STACK_VM_PAGES * PAGE_SIZE; - if (bprm->loader) - bprm->loader += stack_base; - bprm->exec += stack_base; - - mpnt = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL); - if (!mpnt) - return -ENOMEM; + bprm->loader -= stack_shift; + bprm->exec -= stack_shift; down_write(&mm->mmap_sem); - { - mpnt->vm_mm = mm; -#ifdef CONFIG_STACK_GROWSUP - mpnt->vm_start = stack_base; - mpnt->vm_end = stack_base + arg_size; -#else - mpnt->vm_end = stack_top; - mpnt->vm_start = mpnt->vm_end - arg_size; -#endif - /* Adjust stack execute permissions; explicitly enable - * for EXSTACK_ENABLE_X, disable for EXSTACK_DISABLE_X - * and leave alone (arch default) otherwise. */ - if (unlikely(executable_stack == EXSTACK_ENABLE_X)) - mpnt->vm_flags = VM_STACK_FLAGS | VM_EXEC; - else if (executable_stack == EXSTACK_DISABLE_X) - mpnt->vm_flags = VM_STACK_FLAGS & ~VM_EXEC; - else - mpnt->vm_flags = VM_STACK_FLAGS; - mpnt->vm_flags |= mm->def_flags; - mpnt->vm_page_prot = protection_map[mpnt->vm_flags & 0x7]; - if ((ret = insert_vm_struct(mm, mpnt))) { + vm_flags = vma->vm_flags; + + /* + * Adjust stack execute permissions; explicitly enable for + * EXSTACK_ENABLE_X, disable for EXSTACK_DISABLE_X and leave alone + * (arch default) otherwise. + */ + if (unlikely(executable_stack == EXSTACK_ENABLE_X)) + vm_flags |= VM_EXEC; + else if (executable_stack == EXSTACK_DISABLE_X) + vm_flags &= ~VM_EXEC; + vm_flags |= mm->def_flags; + + ret = mprotect_fixup(vma, &prev, vma->vm_start, vma->vm_end, + vm_flags); + if (ret) + goto out_unlock; + BUG_ON(prev != vma); + + /* Move stack pages down in memory. */ + if (stack_shift) { + ret = shift_arg_pages(vma, stack_shift); + if (ret) { up_write(&mm->mmap_sem); - kmem_cache_free(vm_area_cachep, mpnt); return ret; } - mm->stack_vm = mm->total_vm = vma_pages(mpnt); } - for (i = 0 ; i < MAX_ARG_PAGES ; i++) { - struct page *page = bprm->page[i]; - if (page) { - bprm->page[i] = NULL; - install_arg_page(mpnt, page, stack_base); - } - stack_base += PAGE_SIZE; - } +#ifdef CONFIG_STACK_GROWSUP + stack_base = vma->vm_end + EXTRA_STACK_VM_PAGES * PAGE_SIZE; +#else + stack_base = vma->vm_start - EXTRA_STACK_VM_PAGES * PAGE_SIZE; +#endif + ret = expand_stack(vma, stack_base); + if (ret) + ret = -EFAULT; + +out_unlock: up_write(&mm->mmap_sem); - return 0; } - EXPORT_SYMBOL(setup_arg_pages); -#define free_arg_pages(bprm) do { } while (0) - -#else - -static inline void free_arg_pages(struct linux_binprm *bprm) -{ - int i; - - for (i = 0; i < MAX_ARG_PAGES; i++) { - if (bprm->page[i]) - __free_page(bprm->page[i]); - bprm->page[i] = NULL; - } -} - #endif /* CONFIG_MMU */ struct file *open_exec(const char *name) @@ -1000,43 +1194,42 @@ EXPORT_SYMBOL(compute_creds); * points to; chop off the first by relocating brpm->p to right after * the first '\0' encountered. */ -void remove_arg_zero(struct linux_binprm *bprm) +int remove_arg_zero(struct linux_binprm *bprm) { - if (bprm->argc) { - char ch; + int ret = 0; + unsigned long offset; + char *kaddr; + struct page *page; - do { - unsigned long offset; - unsigned long index; - char *kaddr; - struct page *page; - - offset = bprm->p & ~PAGE_MASK; - index = bprm->p >> PAGE_SHIFT; + if (!bprm->argc) + return 0; - page = bprm->page[index]; - kaddr = kmap_atomic(page, KM_USER0); + do { + offset = bprm->p & ~PAGE_MASK; + page = get_arg_page(bprm, bprm->p, 0); + if (!page) { + ret = -EFAULT; + goto out; + } + kaddr = kmap_atomic(page, KM_USER0); - /* run through page until we reach end or find NUL */ - do { - ch = *(kaddr + offset); + for (; offset < PAGE_SIZE && kaddr[offset]; + offset++, bprm->p++) + ; - /* discard that character... */ - bprm->p++; - offset++; - } while (offset < PAGE_SIZE && ch != '\0'); + kunmap_atomic(kaddr, KM_USER0); + put_arg_page(page); - kunmap_atomic(kaddr, KM_USER0); + if (offset == PAGE_SIZE) + free_arg_page(bprm, (bprm->p >> PAGE_SHIFT) - 1); + } while (offset == PAGE_SIZE); - /* free the old page */ - if (offset == PAGE_SIZE) { - __free_page(page); - bprm->page[index] = NULL; - } - } while (ch != '\0'); + bprm->p++; + bprm->argc--; + ret = 0; - bprm->argc--; - } +out: + return ret; } EXPORT_SYMBOL(remove_arg_zero); @@ -1062,7 +1255,7 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs) fput(bprm->file); bprm->file = NULL; - loader = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *); + loader = bprm->vma->vm_end - sizeof(void *); file = open_exec("/sbin/loader"); retval = PTR_ERR(file); @@ -1156,7 +1349,6 @@ int do_execve(char * filename, struct file *file; unsigned long env_p; int retval; - int i; retval = -ENOMEM; bprm = kzalloc(sizeof(*bprm), GFP_KERNEL); @@ -1170,25 +1362,19 @@ int do_execve(char * filename, sched_exec(); - bprm->p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *); - bprm->file = file; bprm->filename = filename; bprm->interp = filename; - bprm->mm = mm_alloc(); - retval = -ENOMEM; - if (!bprm->mm) - goto out_file; - retval = init_new_context(current, bprm->mm); - if (retval < 0) - goto out_mm; + retval = bprm_mm_init(bprm); + if (retval) + goto out_file; - bprm->argc = count(argv, bprm->p / sizeof(void *)); + bprm->argc = count(argv, MAX_ARG_STRINGS); if ((retval = bprm->argc) < 0) goto out_mm; - bprm->envc = count(envp, bprm->p / sizeof(void *)); + bprm->envc = count(envp, MAX_ARG_STRINGS); if ((retval = bprm->envc) < 0) goto out_mm; @@ -1217,9 +1403,8 @@ int do_execve(char * filename, retval = search_binary_handler(bprm,regs); if (retval >= 0) { - free_arg_pages(bprm); - /* execve success */ + free_arg_pages(bprm); security_bprm_free(bprm); acct_update_integrals(current); kfree(bprm); @@ -1227,26 +1412,19 @@ int do_execve(char * filename, } out: - /* Something went wrong, return the inode and free the argument pages*/ - for (i = 0 ; i < MAX_ARG_PAGES ; i++) { - struct page * page = bprm->page[i]; - if (page) - __free_page(page); - } - + free_arg_pages(bprm); if (bprm->security) security_bprm_free(bprm); out_mm: if (bprm->mm) - mmdrop(bprm->mm); + mmput (bprm->mm); out_file: if (bprm->file) { allow_write_access(bprm->file); fput(bprm->file); } - out_kfree: kfree(bprm); diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index a0b209c..91c8c07 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h @@ -6,11 +6,13 @@ struct pt_regs; /* - * MAX_ARG_PAGES defines the number of pages allocated for arguments - * and envelope for the new program. 32 should suffice, this gives - * a maximum env+arg of 128kB w/4KB pages! + * These are the maximum length and maximum number of strings passed to the + * execve() system call. MAX_ARG_STRLEN is essentially random but serves to + * prevent the kernel from being unduly impacted by misaddressed pointers. + * MAX_ARG_STRINGS is chosen to fit in a signed 32-bit integer. */ -#define MAX_ARG_PAGES 32 +#define MAX_ARG_STRLEN (PAGE_SIZE * 32) +#define MAX_ARG_STRINGS 0x7FFFFFFF /* sizeof(linux_binprm->buf) */ #define BINPRM_BUF_SIZE 128 @@ -24,7 +26,12 @@ struct pt_regs; */ struct linux_binprm{ char buf[BINPRM_BUF_SIZE]; +#ifdef CONFIG_MMU + struct vm_area_struct *vma; +#else +# define MAX_ARG_PAGES 32 struct page *page[MAX_ARG_PAGES]; +#endif struct mm_struct *mm; unsigned long p; /* current top of mem */ int sh_bang; @@ -69,7 +76,7 @@ extern int register_binfmt(struct linux_binfmt *); extern int unregister_binfmt(struct linux_binfmt *); extern int prepare_binprm(struct linux_binprm *); -extern void remove_arg_zero(struct linux_binprm *); +extern int __must_check remove_arg_zero(struct linux_binprm *); extern int search_binary_handler(struct linux_binprm *,struct pt_regs *); extern int flush_old_exec(struct linux_binprm * bprm); @@ -86,6 +93,7 @@ extern int suid_dumpable; extern int setup_arg_pages(struct linux_binprm * bprm, unsigned long stack_top, int executable_stack); +extern int bprm_mm_init(struct linux_binprm *bprm); extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm); extern void compute_creds(struct linux_binprm *binprm); extern int do_coredump(long signr, int exit_code, struct pt_regs * regs); diff --git a/include/linux/mm.h b/include/linux/mm.h index 50a0ed1..c456c3a 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -808,7 +808,6 @@ static inline int handle_mm_fault(struct mm_struct *mm, extern int make_pages_present(unsigned long addr, unsigned long end); extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); -void install_arg_page(struct vm_area_struct *, struct page *, unsigned long); int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start, int len, int write, int force, struct page **pages, struct vm_area_struct **vmas); @@ -825,9 +824,15 @@ int FASTCALL(set_page_dirty(struct page *page)); int set_page_dirty_lock(struct page *page); int clear_page_dirty_for_io(struct page *page); +extern unsigned long move_page_tables(struct vm_area_struct *vma, + unsigned long old_addr, struct vm_area_struct *new_vma, + unsigned long new_addr, unsigned long len); extern unsigned long do_mremap(unsigned long addr, unsigned long old_len, unsigned long new_len, unsigned long flags, unsigned long new_addr); +extern int mprotect_fixup(struct vm_area_struct *vma, + struct vm_area_struct **pprev, unsigned long start, + unsigned long end, unsigned long newflags); /* * A callback you can register to apply pressure to ageable caches. @@ -1159,6 +1164,8 @@ extern int expand_stack(struct vm_area_struct *vma, unsigned long address); #ifdef CONFIG_IA64 extern int expand_upwards(struct vm_area_struct *vma, unsigned long address); #endif +extern int expand_stack_downwards(struct vm_area_struct *vma, + unsigned long address); /* Look up the first VMA which satisfies addr < vm_end, NULL if none. */ extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr); diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 535586f..145cbb7 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c @@ -843,7 +843,7 @@ static void audit_log_execve_info(struct audit_buffer *ab, return; /* execve failed, no additional info */ for (i = 0; i < axi->argc; i++, p += len) { - len = strnlen_user(p, MAX_ARG_PAGES*PAGE_SIZE); + len = strnlen_user(p, MAX_ARG_STRLEN); /* * We just created this mm, if we can't find the strings * we just copied into it something is _very_ wrong. Similar diff --git a/mm/mmap.c b/mm/mmap.c index 724f342..7afc7a7 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1571,33 +1571,11 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address) } #endif /* CONFIG_STACK_GROWSUP || CONFIG_IA64 */ -#ifdef CONFIG_STACK_GROWSUP -int expand_stack(struct vm_area_struct *vma, unsigned long address) -{ - return expand_upwards(vma, address); -} - -struct vm_area_struct * -find_extend_vma(struct mm_struct *mm, unsigned long addr) -{ - struct vm_area_struct *vma, *prev; - - addr &= PAGE_MASK; - vma = find_vma_prev(mm, addr, &prev); - if (vma && (vma->vm_start <= addr)) - return vma; - if (!prev || expand_stack(prev, addr)) - return NULL; - if (prev->vm_flags & VM_LOCKED) { - make_pages_present(addr, prev->vm_end); - } - return prev; -} -#else /* * vma is the first one with address < vma->vm_start. Have to extend vma. */ -int expand_stack(struct vm_area_struct *vma, unsigned long address) +static inline int expand_downwards(struct vm_area_struct *vma, + unsigned long address) { int error; @@ -1634,6 +1612,38 @@ int expand_stack(struct vm_area_struct *vma, unsigned long address) return error; } +int expand_stack_downwards(struct vm_area_struct *vma, unsigned long address) +{ + return expand_downwards(vma, address); +} + +#ifdef CONFIG_STACK_GROWSUP +int expand_stack(struct vm_area_struct *vma, unsigned long address) +{ + return expand_upwards(vma, address); +} + +struct vm_area_struct * +find_extend_vma(struct mm_struct *mm, unsigned long addr) +{ + struct vm_area_struct *vma, *prev; + + addr &= PAGE_MASK; + vma = find_vma_prev(mm, addr, &prev); + if (vma && (vma->vm_start <= addr)) + return vma; + if (!prev || expand_stack(prev, addr)) + return NULL; + if (prev->vm_flags & VM_LOCKED) + make_pages_present(addr, prev->vm_end); + return prev; +} +#else +int expand_stack(struct vm_area_struct *vma, unsigned long address) +{ + return expand_downwards(vma, address); +} + struct vm_area_struct * find_extend_vma(struct mm_struct * mm, unsigned long addr) { @@ -1651,9 +1661,8 @@ find_extend_vma(struct mm_struct * mm, unsigned long addr) start = vma->vm_start; if (expand_stack(vma, addr)) return NULL; - if (vma->vm_flags & VM_LOCKED) { + if (vma->vm_flags & VM_LOCKED) make_pages_present(addr, start); - } return vma; } #endif diff --git a/mm/mprotect.c b/mm/mprotect.c index 3b8f3c0..e8346c3 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c @@ -128,7 +128,7 @@ static void change_protection(struct vm_area_struct *vma, flush_tlb_range(vma, start, end); } -static int +int mprotect_fixup(struct vm_area_struct *vma, struct vm_area_struct **pprev, unsigned long start, unsigned long end, unsigned long newflags) { diff --git a/mm/mremap.c b/mm/mremap.c index bc7c52e..8ea5c24 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -120,7 +120,7 @@ static void move_ptes(struct vm_area_struct *vma, pmd_t *old_pmd, #define LATENCY_LIMIT (64 * PAGE_SIZE) -static unsigned long move_page_tables(struct vm_area_struct *vma, +unsigned long move_page_tables(struct vm_area_struct *vma, unsigned long old_addr, struct vm_area_struct *new_vma, unsigned long new_addr, unsigned long len) { ^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: Sparc32 not working:2.6.23-rc1 (git commit 2007-07-28 18:18 Sparc32 not working:2.6.23-rc1 (git commit 1e4dcd22efa7d24f637ab2ea3a77dd65774eb005) Mark Fortescue ` (10 preceding siblings ...) 2007-07-30 14:19 ` Mark Fortescue @ 2007-07-30 18:16 ` Krzysztof Helt 2007-07-31 1:22 ` David Miller ` (2 subsequent siblings) 14 siblings, 0 replies; 27+ messages in thread From: Krzysztof Helt @ 2007-07-30 18:16 UTC (permalink / raw) To: sparclinux On Mon, 30 Jul 2007 15:19:51 +0100 (BST) Mark Fortescue <mark@mtfhpc.demon.co.uk> wrote: > Hi Krzysztof, > > I have found a commit that messes up sun4c. On removal of this commit I > have a working kernel so if there are any problems in the prom code, they > do not show up on my SS1 clone (V0 Prom) or SS2 (V2 Prom). > > I have attached the commit that I have had to temporally back out incase > it is a general issue for Sparc32. Could you do a test for me with your > test code but with the attached patch backed out? > It does not help with my problem (hang/crash inside prom functions). I applied the commit you sent (with -R) and on the new kernel I can still reproduce the bug I had. Regards, Krzysztof ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: Sparc32 not working:2.6.23-rc1 (git commit 2007-07-28 18:18 Sparc32 not working:2.6.23-rc1 (git commit 1e4dcd22efa7d24f637ab2ea3a77dd65774eb005) Mark Fortescue ` (11 preceding siblings ...) 2007-07-30 18:16 ` Krzysztof Helt @ 2007-07-31 1:22 ` David Miller 2007-07-31 3:05 ` Mark Fortescue 2007-07-31 16:57 ` Krzysztof Helt 14 siblings, 0 replies; 27+ messages in thread From: David Miller @ 2007-07-31 1:22 UTC (permalink / raw) To: sparclinux From: Mark Fortescue <mark@mtfhpc.demon.co.uk> Date: Sun, 29 Jul 2007 22:54:46 +0100 (BST) > The lock is taken into consideration however, looking at the code, there > seems to be an issue with the new code for Sparc32. It does not seem tie > up with the code used before!!!. If this is rearly the case then this > would explain the memory corruption I am seeing as the functions in tree.c > that call the openprom to not match the previous working versions. > > I will try to workout what has happened. I would suggest that, for now, we address the bug itself by merely converting sunlance over to the of_*() interfaces. The patch below is what I'm going to check in upstream. If you find anything interesting in arch/sparc/prom/tree.c et al. please let me know. diff --git a/drivers/net/sunlance.c b/drivers/net/sunlance.c index 053b7cb..68e4f66 100644 --- a/drivers/net/sunlance.c +++ b/drivers/net/sunlance.c @@ -99,8 +99,7 @@ static char lancestr[] = "LANCE"; #include <asm/byteorder.h> /* Used by the checksum routines */ #include <asm/idprom.h> #include <asm/sbus.h> -#include <asm/openprom.h> -#include <asm/oplib.h> +#include <asm/prom.h> #include <asm/auxio.h> /* For tpe-link-test? setting */ #include <asm/irq.h> @@ -1326,6 +1325,7 @@ static int __devinit sparc_lance_probe_one(struct sbus_dev *sdev, struct sbus_dev *lebuffer) { static unsigned version_printed; + struct device_node *dp = sdev->ofdev.node; struct net_device *dev; struct lance_private *lp; int i; @@ -1389,54 +1389,46 @@ static int __devinit sparc_lance_probe_one(struct sbus_dev *sdev, lp->rx = lance_rx_dvma; lp->tx = lance_tx_dvma; } - lp->busmaster_regval = prom_getintdefault(sdev->prom_node, - "busmaster-regval", - (LE_C3_BSWP | LE_C3_ACON | - LE_C3_BCON)); + lp->busmaster_regval = of_getintprop_default(dp, "busmaster-regval", + (LE_C3_BSWP | + LE_C3_ACON | + LE_C3_BCON)); lp->name = lancestr; lp->ledma = ledma; lp->burst_sizes = 0; if (lp->ledma) { - char prop[6]; + struct device_node *ledma_dp = ledma->sdev->ofdev.node; + const char *prop; unsigned int sbmask; u32 csr; /* Find burst-size property for ledma */ - lp->burst_sizes = prom_getintdefault(ledma->sdev->prom_node, - "burst-sizes", 0); + lp->burst_sizes = of_getintprop_default(ledma_dp, + "burst-sizes", 0); /* ledma may be capable of fast bursts, but sbus may not. */ - sbmask = prom_getintdefault(ledma->sdev->bus->prom_node, - "burst-sizes", DMA_BURSTBITS); + sbmask = of_getintprop_default(ledma_dp, "burst-sizes", + DMA_BURSTBITS); lp->burst_sizes &= sbmask; /* Get the cable-selection property */ - memset(prop, 0, sizeof(prop)); - prom_getstring(ledma->sdev->prom_node, "cable-selection", - prop, sizeof(prop)); - if (prop[0] = 0) { - int topnd, nd; + prop = of_get_property(ledma_dp, "cable-selection", NULL); + if (!prop || prop[0] = '\0') { + struct device_node *nd; - printk(KERN_INFO "SunLance: using auto-carrier-detection.\n"); + printk(KERN_INFO "SunLance: using " + "auto-carrier-detection.\n"); - /* Is this found at /options .attributes in all - * Prom versions? XXX - */ - topnd = prom_getchild(prom_root_node); - - nd = prom_searchsiblings(topnd, "options"); + nd = of_find_node_by_path("/options"); if (!nd) goto no_link_test; - if (!prom_node_has_property(nd, "tpe-link-test?")) + prop = of_get_property(nd, "tpe-link-test?", NULL); + if (!prop) goto no_link_test; - memset(prop, 0, sizeof(prop)); - prom_getstring(nd, "tpe-link-test?", prop, - sizeof(prop)); - if (strcmp(prop, "true")) { printk(KERN_NOTICE "SunLance: warning: overriding option " "'tpe-link-test?'\n"); ^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: Sparc32 not working:2.6.23-rc1 (git commit 2007-07-28 18:18 Sparc32 not working:2.6.23-rc1 (git commit 1e4dcd22efa7d24f637ab2ea3a77dd65774eb005) Mark Fortescue ` (12 preceding siblings ...) 2007-07-31 1:22 ` David Miller @ 2007-07-31 3:05 ` Mark Fortescue 2007-07-31 16:57 ` Krzysztof Helt 14 siblings, 0 replies; 27+ messages in thread From: Mark Fortescue @ 2007-07-31 3:05 UTC (permalink / raw) To: sparclinux Hi All, > > I would suggest that, for now, we address the bug itself by > merely converting sunlance over to the of_*() interfaces. > > The patch below is what I'm going to check in upstream. > > If you find anything interesting in arch/sparc/prom/tree.c et al. > please let me know. > I has a look through it but since it works for both my SS1 and SS2, it would seem that this is a problem that is specific to the SMP system. In some Solaris source I found on the web, there are some odd comments about the OBP locking to an specific processor, resulting in prom calls from other processors entering a never ending spin-lock. Maybe it could be related to this. Regards Mark Fortescue. ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: Sparc32 not working:2.6.23-rc1 (git commit 2007-07-28 18:18 Sparc32 not working:2.6.23-rc1 (git commit 1e4dcd22efa7d24f637ab2ea3a77dd65774eb005) Mark Fortescue ` (13 preceding siblings ...) 2007-07-31 3:05 ` Mark Fortescue @ 2007-07-31 16:57 ` Krzysztof Helt 14 siblings, 0 replies; 27+ messages in thread From: Krzysztof Helt @ 2007-07-31 16:57 UTC (permalink / raw) To: sparclinux On Mon, 30 Jul 2007 18:22:13 -0700 (PDT) David Miller <davem@davemloft.net> wrote: > > I would suggest that, for now, we address the bug itself by > merely converting sunlance over to the of_*() interfaces. > > The patch below is what I'm going to check in upstream. > The patch is working, the module no longer crashes or hangs. I'll try tracking this down further to find what is going on. As a side note. I would do the patch if you ask for checking this direction. You are too valuable resource too do all the work (especially with patches like this). Try offload the work. We need you to solve problems impossible to solve (as every wizard from the highest knowledge ring you can do impossible things, just they take you more time than making miracles ;-) Regards, Krzysztof ^ permalink raw reply [flat|nested] 27+ messages in thread
end of thread, other threads:[~2007-07-31 16:57 UTC | newest] Thread overview: 27+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2007-07-28 18:18 Sparc32 not working:2.6.23-rc1 (git commit 1e4dcd22efa7d24f637ab2ea3a77dd65774eb005) Mark Fortescue 2007-07-28 21:48 ` Sparc32 not working:2.6.23-rc1 (git commit Krzysztof Helt 2007-07-28 22:38 ` Krzysztof Helt 2007-07-28 23:21 ` Mark Fortescue 2007-07-29 5:40 ` David Miller 2007-07-29 8:29 ` Mark Fortescue 2007-07-29 9:05 ` David Miller 2007-07-29 9:57 ` Mark Fortescue 2007-07-29 14:44 ` Mark Fortescue 2007-07-29 14:44 ` Sparc32 not working:2.6.23-rc1 (git commit 1e4dcd22efa7d24f637ab2ea3a77dd65774eb005) Mark Fortescue 2007-07-29 15:45 ` Sparc32 not working:2.6.23-rc1 (git commit Krzysztof Helt 2007-07-29 18:26 ` Mark Fortescue 2007-07-29 18:26 ` Sparc32 not working:2.6.23-rc1 (git commit 1e4dcd22efa7d24f637ab2ea3a77dd65774eb005) Mark Fortescue 2007-07-29 18:26 ` Mark Fortescue 2007-07-29 20:56 ` Sparc32 not working:2.6.23-rc1 (git commit Adrian Bunk 2007-07-29 20:56 ` Sparc32 not working:2.6.23-rc1 (git commit 1e4dcd22efa7d24f637ab2ea3a77dd65774eb005) Adrian Bunk 2007-07-29 20:56 ` Adrian Bunk 2007-07-29 22:01 ` Sparc32 not working:2.6.23-rc1 (git commit Mark Fortescue 2007-07-29 22:01 ` Sparc32 not working:2.6.23-rc1 (git commit 1e4dcd22efa7d24f637ab2ea3a77dd65774eb005) Mark Fortescue 2007-07-29 22:01 ` Mark Fortescue 2007-07-29 20:56 ` Sparc32 not working:2.6.23-rc1 (git commit Krzysztof Helt 2007-07-29 21:54 ` Mark Fortescue 2007-07-30 14:19 ` Mark Fortescue 2007-07-30 18:16 ` Krzysztof Helt 2007-07-31 1:22 ` David Miller 2007-07-31 3:05 ` Mark Fortescue 2007-07-31 16:57 ` Krzysztof Helt
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.