From owner-freebsd-hackers Thu Nov 15 14:12:47 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mail6.speakeasy.net (mail6.speakeasy.net [216.254.0.206]) by hub.freebsd.org (Postfix) with ESMTP id A2FF937B417 for ; Thu, 15 Nov 2001 14:12:34 -0800 (PST) Received: (qmail 14733 invoked from network); 15 Nov 2001 22:12:04 -0000 Received: from unknown (HELO laptop.baldwin.cx) ([64.81.54.73]) (envelope-sender ) by mail6.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 15 Nov 2001 22:12:04 -0000 Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200111152156.XAA79972@ipcard.iptcom.net> Date: Thu, 15 Nov 2001 14:12:32 -0800 (PST) From: John Baldwin To: Maxim Sobolev Subject: RE: Using bit 21 of EFLAGS in user-mode [was: Re: sigreturn: efl Cc: hackers@FreeBSD.org, freebsd-ports@FreeBSD.org, marcus@marcuscom.com Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 15-Nov-01 Maxim Sobolev wrote: > That explains... After a quick glance at png code I found that > the only place where EFLAGS is altered is CPUID code, where > the library flips bit 21 of EFLAGS in order to ensure that the > CPUID instruction is supported (otherwise it will get SIGILL > on older processors). Unfortunately, for some reason FreeBSB > kernel considers bit 21 of EFLAGS as one that should not be > altered in the user mode, thus making it illegal to use standard > user-mode processor-detection routines based around that bit. > AFAIK, it is a bug in FreeBSD, because there is actually nothing > wrong with altering bit 21 in the user mode - it doesn't have > any side effects and pretty much any of the currently available > on the i386 OSes allows it. Agreed, patch looks good to me. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message