From nobody@FreeBSD.org  Sun Jul 24 18:18:20 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id CC10716A41F
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 24 Jul 2005 18:18:20 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 6D26C43D45
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 24 Jul 2005 18:18:20 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j6OIIKNA036863
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 24 Jul 2005 18:18:20 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j6OIIKdL036862;
	Sun, 24 Jul 2005 18:18:20 GMT
	(envelope-from nobody)
Message-Id: <200507241818.j6OIIKdL036862@www.freebsd.org>
Date: Sun, 24 Jul 2005 18:18:20 GMT
From: Sergey Gluschenko <deen@freebsd.org.ua>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Buildkernel is broken with 'options CPU_DISABLE_SSE' in kernel conf file
X-Send-Pr-Version: www-2.3

>Number:         84010
>Category:       i386
>Synopsis:       Buildkernel is broken with 'options CPU_DISABLE_SSE' in kernel conf file
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-i386
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jul 24 18:20:16 GMT 2005
>Closed-Date:    Thu Aug 04 14:40:51 CEST 2005
>Last-Modified:  Thu Aug 04 14:40:51 CEST 2005
>Originator:     Sergey Gluschenko
>Release:        FreeBSD 6.0-BETA1
>Organization:
SevNTU
>Environment:
FreeBSD xlab.hostel 6.0-BETA1 FreeBSD 6.0-BETA1 #2: Thu Jul 21 23:49:49 EEST 200                                 5     deen@xlab.hostel:/usr/obj/usr/src/sys/X  i386
>Description:
 Buildkernel is broken with 'options CPU_DISABLE_SSE' in kernel conf file. Here is the error:
linking kernel.debug
ptrace_machdep.o(.text+0x17): In function `cpu_ptrace':
/usr/src/sys/i386/i386/ptrace_machdep.c:48: undefined reference to `cpu_fxsr'
*** Error code 1
Stop in /usr/obj/usr/src/sys/X.
*** Error code 1
Stop in /usr/src.
*** Error code 1
Stop in /usr/src.

Here is the conf file:

machine     i386
cpu         I686_CPU
ident       X

# To statically compile in device wiring instead of /boot/device.hints
#hints      "GENERIC.hints"     # Default places to look for devices.

makeoptions DEBUG=-g        # Build kernel with gdb(1) debug symbols
makeoptions NO_MODULES=yes


options     CPU_PPRO2CELERON
options     CPU_L2_LATENCY=4
options     CPU_FASTER_5X86_FPU
options     CPU_UPGRADE_HW_CACHE
options     CPU_DISABLE_SSE
options     TCP_DROP_SYNFIN     #drop TCP packets with SYN+FIN
options     IPFIREWALL      #firewall
options     IPFIREWALL_VERBOSE  #enable logging to syslogd(8)
options     IPFIREWALL_VERBOSE_LIMIT=100    #limit verbosity
options     IPFIREWALL_DEFAULT_TO_ACCEPT    #allow everything by default
options     IPFIREWALL_FORWARD  #packet destination changes
options     IPFIREWALL_FORWARD_EXTENDED #all packet dest changes
options     IPDIVERT

options     SCHED_ULE       # ULE scheduler
#options    SCHED_4BSD      # 4BSD scheduler
options     PREEMPTION      # Enable kernel thread preemption
options     INET            # InterNETworking
options     FFS         # Berkeley Fast Filesystem
options     SOFTUPDATES     # Enable FFS soft updates support
options     UFS_ACL         # Support for access control lists
options     UFS_DIRHASH     # Improve performance on big directories
options     MD_ROOT         # MD is a potential root device
options     MSDOSFS         # MSDOS Filesystem
options     CD9660          # ISO 9660 Filesystem
options     PROCFS          # Process filesystem (requires PSEUDOFS)
options     PSEUDOFS        # Pseudo-filesystem framework
options     GEOM_GPT        # GUID Partition Tables.
options     COMPAT_43       # Compatible with BSD 4.3 [KEEP THIS!]
options     COMPAT_FREEBSD4     # Compatible with FreeBSD4
options     KTRACE          # ktrace(1) support
options     SYSVSHM         # SYSV-style shared memory
options     SYSVMSG         # SYSV-style message queues
options     SYSVSEM         # SYSV-style semaphores
options     _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
options     KBD_INSTALL_CDEV    # install a CDEV entry in /dev
options     AHC_REG_PRETTY_PRINT    # Print register bitfields in debug
                    # output.  Adds ~128k to driver.
options     AHD_REG_PRETTY_PRINT    # Print register bitfields in debug
                    # output.  Adds ~215k to driver.
options     ADAPTIVE_GIANT      # Giant mutex is adaptive.

# Debugging for use in -current
options     KDB         # Enable kernel debugger support.
options     DDB         # Support DDB.
#options    GDB         # Support remote GDB.
#options    INVARIANTS      # Enable calls of extra sanity checking
#options    INVARIANT_SUPPORT   # Extra sanity checks of internal structures, required by INVARIANTS
#options    WITNESS         # Enable checks to detect deadlocks and cycles
#options    WITNESS_SKIPSPIN    # Don't run witness on spinlocks for speed

# Bus support.  Do not remove isa, even if you have no isa slots
device      isa
device      eisa
device      pci

# Floppy drives
device      fdc

# ATA and ATAPI devices
device      ata
device      atadisk     # ATA disk drives
device      atapicd     # ATAPI CDROM drives
device      atapifd     # ATAPI floppy drives
options     ATA_STATIC_ID   # Static device numbering

# atkbdc0 controls both the keyboard and the PS/2 mouse
device      atkbdc      # AT keyboard controller
device      atkbd       # AT keyboard
device      psm     # PS/2 mouse

device      vga     # VGA video card driver

# syscons is the default console driver, resembling an SCO console
device      sc

# Floating point support - do not disable.
device      npx

# Power management support (see NOTES for more options)
#device     apm
# Add suspend/resume support for the i8254.
device      pmtimer

# Serial (COM) ports
device      sio     # 8250, 16[45]50 based serial ports

# Parallel port
device      ppc
device      ppbus       # Parallel port bus (required)
device      lpt     # Printer
device      plip        # TCP/IP over parallel
device      ppi     # Parallel port interface device
#device     vpo     # Requires scbus and da

device      miibus      # MII bus support
device      rl      # RealTek 8129/8139

# Pseudo devices.
device      loop        # Network loopback
device      mem     # Memory and kernel memory devices
device      io      # I/O device
device      random      # Entropy device
device      ether       # Ethernet support
device      sl      # Kernel SLIP
device      ppp     # Kernel PPP
device      tun     # Packet tunnel.
device      pty     # Pseudo-ttys (telnet etc)
device      md      # Memory "disks"
device      gif     # IPv6 and IPv4 tunneling

# The `bpf' device enables the Berkeley Packet Filter.
# Be aware of the administrative consequences of enabling this!
# Note that 'bpf' is required for DHCP.
device      bpf     # Berkeley packet filter


>How-To-Repeat:
      
>Fix:
      
>Release-Note:
>Audit-Trail:

From: =?ISO-8859-1?Q?Bj=F6rn_K=F6nig?= <bkoenig@cs.tu-berlin.de>
To: Sergey Gluschenko <deen@freebsd.org.ua>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: i386/84010: Buildkernel is broken with 'options CPU_DISABLE_SSE'
 in	kernel conf file
Date: Sun, 24 Jul 2005 22:56:42 +0200

 Sergey Gluschenko wrote:
 
 >>Environment:
 > 
 > FreeBSD xlab.hostel 6.0-BETA1 FreeBSD 6.0-BETA1 #2: Thu Jul 21 23:49:49 EEST 200                                 5     deen@xlab.hostel:/usr/obj/usr/src/sys/X  i386
 > 
 >>Description:
 > 
 >  Buildkernel is broken with 'options CPU_DISABLE_SSE' in kernel conf file. Here is the error:
 > linking kernel.debug
 > ptrace_machdep.o(.text+0x17): In function `cpu_ptrace':
 > /usr/src/sys/i386/i386/ptrace_machdep.c:48: undefined reference to `cpu_fxsr'
 > [...]
 
 This should not happen... obviously. ;-) Delete the directory 
 /usr/obj/usr/src/sys/X and try again.
 
 Bjrn

From: Sergey Gluschenko <deen@freebsd.org.ua>
To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-i386@FreeBSD.org
Cc: delphij@frontfree.net
Subject: Re: i386/84010: Buildkernel is broken with 'options
 CPU_DISABLE_SSE' in kernel conf file
Date: Mon, 25 Jul 2005 04:37:03 +0300

 According to this patch: 
 	http://freebsd.rambler.ru/bsdmail/freebsd-arch_2005/msg00626.html
 we need to clean up all CPU_ENABLE_SSE in kernel, as Ruslan said:
 	http://freebsd.rambler.ru/bsdmail/freebsd-arch_2005/msg00627.html
 But we need working "options CPU_DISABLE_SSE", so I decided to replace
 all "#ifdef CPU_ENABLE_SSE" to "#ifndef CPU_DISABLE_SSE" and
 all "#if defined(CPU_ENABLE_SSE)" to "#if !defined(CPU_DISABLE_SSE)"
 
 Also, #include "opt_cpu.h" was missing in sys/i386/i386/ptrace_machdep.c
 
 After all this changes the reported problem is gone.
 
 Here the patches:
 	http://xlab.users.sevsky.net/freebsd/sys_i386_i386_initcpu.c.diff
 	http://xlab.users.sevsky.net/freebsd/sys_i386_i386_machdep.c.diff
 	http://xlab.users.sevsky.net/freebsd/sys_i386_i386_pmap.c.diff
 	http://xlab.users.sevsky.net/freebsd/sys_i386_i386_ptrace_machdep.c.diff
 	http://xlab.users.sevsky.net/freebsd/sys_i386_isa_npx.c.diff
 	http://xlab.users.sevsky.net/freebsd/sys_i386_linux_linux_ptrace.c.diff (not tested!)
 	http://xlab.users.sevsky.net/freebsd/sys_pc98_pc98_machdep.c.diff (not tested!)
 
 
 --
 Sergey Gluschenko
 
 
State-Changed-From-To: open->closed 
State-Changed-By: tobez 
State-Changed-When: Thu Aug 4 14:39:51 CEST 2005 
State-Changed-Why:  
A simpler fix obtained from the originator via IRC committed in HEAD, 
thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=84010 
>Unformatted:
