From owner-freebsd-hackers@freebsd.org Sat Apr 8 14:02:38 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53184D13EFC for ; Sat, 8 Apr 2017 14:02:38 +0000 (UTC) (envelope-from wjw@digiware.nl) Received: from smtp.digiware.nl (smtp.digiware.nl [IPv6:2001:4cb8:90:ffff::3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DD2AB08; Sat, 8 Apr 2017 14:02:37 +0000 (UTC) (envelope-from wjw@digiware.nl) Received: from router.digiware.nl (localhost.digiware.nl [127.0.0.1]) by smtp.digiware.nl (Postfix) with ESMTP id 0ACEE3DBA1; Sat, 8 Apr 2017 16:02:34 +0200 (CEST) X-Virus-Scanned: amavisd-new at digiware.com Received: from smtp.digiware.nl ([127.0.0.1]) by router.digiware.nl (router.digiware.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ahgnGl4OtpyH; Sat, 8 Apr 2017 16:02:33 +0200 (CEST) Received: from [192.168.10.67] (opteron [192.168.10.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.digiware.nl (Postfix) with ESMTPSA id 1EB2A3DB9F; Sat, 8 Apr 2017 16:02:33 +0200 (CEST) Subject: Re: Source of QEMU woes: CPUTYPE To: Dimitry Andric , Eric McCorkle References: Cc: "freebsd-hackers@freebsd.org" From: Willem Jan Withagen Message-ID: Date: Sat, 8 Apr 2017 16:02:31 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Apr 2017 14:02:38 -0000 On 4-4-2017 20:31, Dimitry Andric wrote: > On 4 Apr 2017, at 14:34, Eric McCorkle wrote: >> >> A while ago I posted on here about some problems I'd had with testing >> boot loader modifications on QEMU, and which also showed up on an >> unmodified HEAD. >> >> I ultimately tracked down the source of the problem: I had >> CPUTYPE?=native set in my /etc/make.conf. As my CPU is relatively >> recent, this caused some instructions that QEMU doesn't support to be >> generated in various places (most notoriously, in strlen), which would >> trigger illegal instruction exceptions. > > Out of interest, what does "llvm-tblgen -version | grep 'Host CPU'" > show? (This is a simple way to see what LLVM auto-detects.) > > >> I'm posting this here, as it's somewhat non-obvious, and probably ought >> to be documented somewhere. > > I usually find it clearer to specify the exact CPU type myself, for > example CPUTYPE?=core-avx2 (which is an alias for "haswell"). You can > also specify a lower CPUTYPE to build the world that you are going to > run inside QEMU. So what does: Host CPU: bdver1 tell me? It actually is a: CPU: AMD FX-8370 Eight-Core Processor (4013.71-MHz K8-class CPU) Origin="AuthenticAMD" Id=0x600f20 Family=0x15 Model=0x2 Stepping=0 Features=0x178bfbff Features2=0x3e98320b AMD Features=0x2e500800 AMD Features2=0x1ebbfff Structured Extended Features=0x8 SVM: Features=0x1cff,PauseFilterThreshold> Revision=1, ASIDs=65536 --WjW