From patchwork Fri Feb 8 12:17:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Borislav Petkov X-Patchwork-Id: 219126 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D97122C0090 for ; Fri, 8 Feb 2013 23:18:08 +1100 (EST) Received: from localhost ([::1]:53673 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3mu7-00024f-02 for incoming@patchwork.ozlabs.org; Fri, 08 Feb 2013 07:18:07 -0500 Received: from eggs.gnu.org ([208.118.235.92]:33856) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3mtw-00023W-HY for qemu-devel@nongnu.org; Fri, 08 Feb 2013 07:17:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U3mtr-0007XY-Fw for qemu-devel@nongnu.org; Fri, 08 Feb 2013 07:17:54 -0500 Received: from mail.skyhub.de ([2a01:4f8:120:8448::d00d]:33743) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3mtr-0007XL-3y for qemu-devel@nongnu.org; Fri, 08 Feb 2013 07:17:51 -0500 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alien8.de; s=alien8; t=1360325869; bh=MeYp9vEcDVlIw4YqIsvuDJkZTOYULVOSx0ZGtap+Fok=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Transfer-Encoding:In-Reply-To; b=HO4kPRsCY8Xq 8rAKoGwl+U/wJQ59J4EDwKta+M2Fy4XQUiy6ZUzDPi5+7zgGILv8UNYSahy0+ze6YVZ IlbQkZB6RZbwmWONzTQCboGMLy6G7gz7REUB6QJhUCr6wlcJLG5i5Ra85uLmCPL7Kpy 2SKQGQkB+QkMBH4iD86jVvghI= Received: from mail.skyhub.de ([127.0.0.1]) by localhost (door.skyhub.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 6fKpEBgDaMxJ; Fri, 8 Feb 2013 13:17:49 +0100 (CET) Received: from liondog.tnic (p5B32D188.dip.t-dialin.net [91.50.209.136]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id BE6C31D9DC9; Fri, 8 Feb 2013 13:17:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alien8.de; s=alien8; t=1360325869; bh=MeYp9vEcDVlIw4YqIsvuDJkZTOYULVOSx0ZGtap+Fok=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Transfer-Encoding:In-Reply-To; b=HO4kPRsCY8Xq 8rAKoGwl+U/wJQ59J4EDwKta+M2Fy4XQUiy6ZUzDPi5+7zgGILv8UNYSahy0+ze6YVZ IlbQkZB6RZbwmWONzTQCboGMLy6G7gz7REUB6QJhUCr6wlcJLG5i5Ra85uLmCPL7Kpy 2SKQGQkB+QkMBH4iD86jVvghI= Received: by liondog.tnic (Postfix, from userid 1000) id ED4C8101BF5; Fri, 8 Feb 2013 13:17:43 +0100 (CET) Date: Fri, 8 Feb 2013 13:17:43 +0100 From: Borislav Petkov To: Andreas =?utf-8?Q?F=C3=A4rber?= Message-ID: <20130208121743.GD14526@pd.tnic> References: <1360315802-959-1-git-send-email-bp@alien8.de> <5114E39B.50209@suse.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <5114E39B.50209@suse.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a01:4f8:120:8448::d00d Cc: Eduardo Habkost , qemu-devel@nongnu.org, "H. Peter Anvin" , Igor Mammedov , Borislav Petkov , Richard Henderson Subject: Re: [Qemu-devel] [PATCH] target-i386: n270 can MOVBE X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Hi Andreas, On Fri, Feb 08, 2013 at 12:38:03PM +0100, Andreas Färber wrote: > Am 08.02.2013 10:30, schrieb Borislav Petkov: > > From: Borislav Petkov > > > > The Atom core (cpu name "n270" in QEMU speak) supports MOVBE. This is > > needed when booting 3.8 and later linux kernels built with the MATOM > > target because we require MOVBE in order to boot properly now. > > > > Cc: "H. Peter Anvin" > > Cc: Richard Henderson > > Signed-off-by: Borislav Petkov > > Please CC me on cpu.c changes (cf. MAINTAINERS). Wow, qemu has get_maintainer.pl too: $ git show HEAD | ./scripts/get_maintainer.pl "Andreas Färber" (supporter:CPU) qemu-devel@nongnu.org (odd fixer:X86 :-) Ok, fixed. > > .ext_features = CPUID_EXT_SSE3 | CPUID_EXT_MONITOR | CPUID_EXT_SSSE3 | > > - CPUID_EXT_DSCPL | CPUID_EXT_EST | CPUID_EXT_TM2 | CPUID_EXT_XTPR, > > + CPUID_EXT_DSCPL | CPUID_EXT_EST | CPUID_EXT_TM2 | CPUID_EXT_XTPR | > > + CPUID_EXT_MOVBE, > > Tab. Please use scripts/checkpatch.pl to verify before sending. Done. > > .ext2_features = (PPRO_FEATURES & CPUID_EXT2_AMD_ALIASES) | > > CPUID_EXT2_NX, > > .ext3_features = CPUID_EXT3_LAHF_LM, > > Otherwise if someone can ack (or if you can point me to a manual), this > looks like a good bugfix for v1.4. Right, I don't know what v1.4 is but this still needs Richard's patchset enabling MOVBE dynamic translation in qemu to go in first before enabling MOVBE for the n270 model. Anyway, fixed patch is below. > CC'ing some more CPU'ish people. Well, if you do cat /proc/cpuinfo on an Atom, you can see movbe there. Here it is from my atom box: processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 28 model name : Intel(R) Atom(TM) CPU N270 @ 1.60GHz stepping : 2 microcode : 0x208 cpu MHz : 800.000 cache size : 512 KB physical id : 0 siblings : 1 core id : 0 cpu cores : 1 apicid : 0 initial apicid : 0 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe constant_tsc arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 xtpr pdcm movbe lahf_lm dtherm bogomips : 3192.01 clflush size : 64 cache_alignment : 64 address sizes : 32 bits physical, 32 bits virtual power management: Or, more cpu vendor-y, do CPUID.EAX(1) on an n270 and bit 22 in ECX is set. Here is a full base cpuid leafs dump: $ ./dump_cpuid max base function: 0x0000000a CPUID.EAX=0x00000000 EAX=0x0000000a, EBX=0x756e6547, ECX=0x6c65746e, EDX=0x49656e69 CPUID.EAX=0x00000001 EAX=0x000106c2, EBX=0x01020800, ECX=0x0040c39d, EDX=0xbfe9fbff ^^^^^ bit 22 here is MOVBE presence. CPUID.EAX=0x00000002 EAX=0x4fba5901, EBX=0x0e3080c0, ECX=0x00000000, EDX=0x00000000 CPUID.EAX=0x00000003 EAX=0x00000000, EBX=0x00000000, ECX=0x00000000, EDX=0x00000000 CPUID.EAX=0x00000004 EAX=0x00004121, EBX=0x0140003f, ECX=0x0000003f, EDX=0x00000001 CPUID.EAX=0x00000005 EAX=0x00000040, EBX=0x00000040, ECX=0x00000003, EDX=0x00020220 CPUID.EAX=0x00000006 EAX=0x00000001, EBX=0x00000002, ECX=0x00000001, EDX=0x00000000 CPUID.EAX=0x00000007 EAX=0x00000000, EBX=0x00000000, ECX=0x00000000, EDX=0x00000000 CPUID.EAX=0x00000008 EAX=0x00000000, EBX=0x00000000, ECX=0x00000000, EDX=0x00000000 CPUID.EAX=0x00000009 EAX=0x00000000, EBX=0x00000000, ECX=0x00000000, EDX=0x00000000 CPUID.EAX=0x0000000a EAX=0x07280203, EBX=0x00000000, ECX=0x00000000, EDX=0x00002501 And the official document is this one here: http://www.intel.com/content/www/us/en/processors/processor-identification-cpuid-instruction-note.html Table 5-5 Feature Flags Reported in the ECX Register (Sheet 1 of 2). HTH. --- From 5371732b65fbb9a873b52c67a260ffcaf7caf88d Mon Sep 17 00:00:00 2001 From: Borislav Petkov Date: Fri, 8 Feb 2013 10:19:44 +0100 Subject: [PATCH] target-i386: n270 can MOVBE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Atom core (cpu name "n270" in QEMU speak) supports MOVBE. This is needed when booting 3.8 and later linux kernels built with the MATOM target because we require MOVBE in order to boot properly now. Cc: "H. Peter Anvin" Cc: Richard Henderson Cc: "Andreas Färber" Signed-off-by: Borislav Petkov --- target-i386/cpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 4a516e1f9e25..36a133462a8d 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -620,7 +620,8 @@ static x86_def_t builtin_x86_defs[] = { CPUID_ACPI | CPUID_SS | CPUID_HT | CPUID_TM | CPUID_PBE, /* Some CPUs got no CPUID_SEP */ .ext_features = CPUID_EXT_SSE3 | CPUID_EXT_MONITOR | CPUID_EXT_SSSE3 | - CPUID_EXT_DSCPL | CPUID_EXT_EST | CPUID_EXT_TM2 | CPUID_EXT_XTPR, + CPUID_EXT_DSCPL | CPUID_EXT_EST | CPUID_EXT_TM2 | CPUID_EXT_XTPR | + CPUID_EXT_MOVBE, .ext2_features = (PPRO_FEATURES & CPUID_EXT2_AMD_ALIASES) | CPUID_EXT2_NX, .ext3_features = CPUID_EXT3_LAHF_LM,