From owner-freebsd-questions@FreeBSD.ORG Wed Oct 23 18:23:06 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A46F5514; Wed, 23 Oct 2013 18:23:06 +0000 (UTC) (envelope-from tijl@coosemans.org) Received: from mailrelay006.isp.belgacom.be (mailrelay006.isp.belgacom.be [195.238.6.172]) by mx1.freebsd.org (Postfix) with ESMTP id C69512364; Wed, 23 Oct 2013 18:23:05 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Al8GAGcTaFJbs4WZ/2dsb2JhbABZgwc4vyeBLRd0giUBAQU6HCMQCw4KCSUPKh4GEwmIAQEIuw6PTgeEKgOYCIEwkFiDJjo Received: from 153.133-179-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.179.133.153]) by relay.skynet.be with ESMTP; 23 Oct 2013 20:23:03 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.7/8.14.7) with ESMTP id r9NIN1LW018108; Wed, 23 Oct 2013 20:23:02 +0200 (CEST) (envelope-from tijl@coosemans.org) Date: Wed, 23 Oct 2013 20:23:00 +0200 From: Tijl Coosemans To: Torbjorn Granlund Subject: Re: MULX on haswell triggers ILLOP Message-ID: <20131023202300.7d316d29@kalimero.tijl.coosemans.org> In-Reply-To: <867gd3lw89.fsf@shell.gmplib.org> References: <86wql4onvy.fsf@shell.gmplib.org> <867gd3lw89.fsf@shell.gmplib.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: bapt@FreeBSD.org, freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 18:23:06 -0000 On Wed, 23 Oct 2013 19:42:46 +0200 Torbjorn Granlund wrote: > Torbjorn Granlund writes: > > I have an Intel Haswell system which runs Xen/NetBSD with Debian 7.2, > NetBSD 6.1.2 and FreeBSD 9.2 guests. > > The FreeBSD guest casts an ILLOP when fed with the new MULX instruction. > This is a plain integer register based instruction which should require > zero kernel support. > > MULX is part of the BMI2 extensions. > > The instruction works fine in the other guest systems. > > What is going on? How can FreeBSD reject this instruction? > > I have not tried to run FreeBSD on the bare metal, so I cannot tell if > BMI2 works as expected there. > > It turns out to be another strike of an FreeBSD m4 eval bug. > > http://www.freebsd.org/cgi/query-pr.cgi?pr=166994 > > Unfortunately, this means that GMP will not work on Haswell CPUs running > FreeBSD, where we assemble unsupported instructions using m4 macros. > That is a workaround for FreeBSD's seriously outdated binutils. Of > course, we could implement a workaround for the m4 bug, but that > workaround would be more complex than a bugfix for m4. > > My hopes that FreeBSD will fix this bug are not high, given that it has > been known for 1.5 years. A comment on that PR says that it has been fixed in http://svnweb.freebsd.org/base?view=revision&revision=228063 I don't know if it's feasible to merge this to stable/9. Committer CCed.