From patchwork Mon Dec 10 22:59:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 205051 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 15ED72C031E for ; Tue, 11 Dec 2012 10:00:03 +1100 (EST) Received: from localhost ([::1]:47956 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiCKP-0007pp-5M for incoming@patchwork.ozlabs.org; Mon, 10 Dec 2012 18:00:01 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiCKD-0007k2-2U for qemu-devel@nongnu.org; Mon, 10 Dec 2012 17:59:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TiCKA-0000Vx-RQ for qemu-devel@nongnu.org; Mon, 10 Dec 2012 17:59:49 -0500 Received: from cantor2.suse.de ([195.135.220.15]:48343 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiCKA-0000Vk-Ht for qemu-devel@nongnu.org; Mon, 10 Dec 2012 17:59:46 -0500 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id EB11CA50F4; Mon, 10 Dec 2012 23:59:45 +0100 (CET) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Mon, 10 Dec 2012 23:59:32 +0100 Message-Id: <1355180372-6525-3-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1355180372-6525-1-git-send-email-afaerber@suse.de> References: <1355180372-6525-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 195.135.220.15 Cc: blauwirbel@gmail.com, imammedo@redhat.com, ehabkost@redhat.com, anthony@codemonkey.ws, =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [RFC qom-cpu v2 2/2] target-i386: Turn Haswell into subclass of SandyBridge 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 ehabkost: "When adding the Haswell CPU model, I intended to make it a superset of the features present on the SandyBridge model" Inherit from SandyBridge to keep only the delta for Haswell. Signed-off-by: Andreas Färber Cc: Eduardo Habkost --- target-i386/cpu.c | 24 ++---------------------- 1 Datei geändert, 2 Zeilen hinzugefügt(+), 22 Zeilen entfernt(-) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index c59c6a5..ffd160a 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -814,39 +814,19 @@ static void haswell_cpu_class_init(ObjectClass *oc, void *data) { X86CPUClass *xcc = X86_CPU_CLASS(oc); - xcc->level = 0xd; - xcc->vendor1 = CPUID_VENDOR_INTEL_1; - xcc->vendor2 = CPUID_VENDOR_INTEL_2; - xcc->vendor3 = CPUID_VENDOR_INTEL_3; - xcc->family = 6; xcc->model = 60; - xcc->stepping = 1; - xcc->features = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX | - CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV | CPUID_MCA | - CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 | - CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE | - CPUID_DE | CPUID_FP87; - xcc->ext_features = CPUID_EXT_AVX | CPUID_EXT_XSAVE | CPUID_EXT_AES | - CPUID_EXT_POPCNT | CPUID_EXT_X2APIC | CPUID_EXT_SSE42 | - CPUID_EXT_SSE41 | CPUID_EXT_CX16 | CPUID_EXT_SSSE3 | - CPUID_EXT_PCLMULQDQ | CPUID_EXT_SSE3 | - CPUID_EXT_TSC_DEADLINE_TIMER | CPUID_EXT_FMA | CPUID_EXT_MOVBE | - CPUID_EXT_PCID; - xcc->ext2_features = CPUID_EXT2_LM | CPUID_EXT2_RDTSCP | CPUID_EXT2_NX | - CPUID_EXT2_SYSCALL; - xcc->ext3_features = CPUID_EXT3_LAHF_LM; + xcc->ext_features |= CPUID_EXT_FMA | CPUID_EXT_MOVBE | CPUID_EXT_PCID; xcc->cpuid_7_0_ebx_features = CPUID_7_0_EBX_FSGSBASE | CPUID_7_0_EBX_BMI1 | CPUID_7_0_EBX_HLE | CPUID_7_0_EBX_AVX2 | CPUID_7_0_EBX_SMEP | CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_ERMS | CPUID_7_0_EBX_INVPCID | CPUID_7_0_EBX_RTM; - xcc->xlevel = 0x8000000A; pstrcpy(xcc->model_id, sizeof(xcc->model_id), "Intel Core Processor (Haswell)"); } static const TypeInfo haswell_cpu_type_info = { .name = TYPE("Haswell"), - .parent = TYPE_X86_CPU, + .parent = TYPE("SandyBridge"), .class_init = haswell_cpu_class_init, };