Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MobzZ-0007nk-4X for qemu-devel@nongnu.org; Fri, 18 Sep 2009 07:51:09 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MobzT-0007n2-QR for qemu-devel@nongnu.org; Fri, 18 Sep 2009 07:51:08 -0400 Received: from [199.232.76.173] (port=38450 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MobzT-0007mz-ML for qemu-devel@nongnu.org; Fri, 18 Sep 2009 07:51:03 -0400 Received: from va3ehsobe005.messaging.microsoft.com ([216.32.180.15]:6613 helo=VA3EHSOBE005.bigfish.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_MD5:16) (Exim 4.60) (envelope-from ) id 1MobzT-0003JB-Ap for qemu-devel@nongnu.org; Fri, 18 Sep 2009 07:51:03 -0400 Received: from mail181-va3 (localhost.localdomain [127.0.0.1]) by mail181-va3-R.bigfish.com (Postfix) with ESMTP id 8AD67F831A for ; Fri, 18 Sep 2009 11:50:59 +0000 (UTC) Received: from svlb1extmailp02.amd.com (unknown [139.95.251.11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail181-va3.bigfish.com (Postfix) with ESMTP id C39B52E0056 for ; Fri, 18 Sep 2009 11:50:57 +0000 (UTC) Received: from svlb1twp01.amd.com ([139.95.250.34]) by svlb1extmailp02.amd.com (Switch-3.2.7/Switch-3.2.7) with ESMTP id n8IBopQH032252 for ; Fri, 18 Sep 2009 04:50:54 -0700 Received: from SSVLEXBH1.amd.com (ssvlexbh1.amd.com [139.95.53.182]) by svlb1twp01.amd.com (Tumbleweed MailGate 3.7.0) with ESMTP id 2D7D119A0145 for ; Fri, 18 Sep 2009 04:50:49 -0700 (PDT) From: Andre Przywara Date: Fri, 18 Sep 2009 13:47:53 +0200 Message-ID: <1253274494-13244-1-git-send-email-andre.przywara@amd.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH v2 00/21] cpuid: cleanup, fixes and some enhancements List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi, an updated version of my last week's series. Changes from v1 -> v2: - fix build for non-i386 targets (thanks Anthony for spotting this) - replace strtok() with QEMU's get_opt_name() (inspired by Amit Shah) (please see the notes below) - fix multicore setup on Intel (thanks Dietmar Maurer for spotting this) - removed unnecessary header file inclusions from cpuid.c - fix and add various CPU models - add kvm32 CPU model (for 32bit only migration) - always expose all CPU models (regardless of the bitness) ---------------- The following patchset cleans up CPUID bit handling and adds some smaller features. The most prominent change is to move all CPUID related functions to a separate file. About 40% of helper.c was actually CPUID related, so say hello to cpuid.c. While at it, I fixed some formatting issues. (Patch 1-5) Patch 6 replaces the awkward strtok() with the better get_opt_name(). Please note: This renders the gotos useless. Shall they be removed? Second note: I pulled get_opt_name() from qemu-option.h into the file, because it did not work with linux-user due to a name clash: linux-user/mmap.c:qemu_malloc() and qemu-malloc.c:qemu_malloc() If anyone has a better solution, I am all ears. Patch 7 & 8 add the CPUID feature flag names to the output of -cpu ?. Patch 9 & 10 simplifies some code. Patch 11 allows more CPUID leafs to be propagated to guests when -cpu host is used, this should now reflect the host CPU's cache size. Patch 12 fixes a bug with the multicore injection to the guest, where the Linux kernel on Intel hosts would not recognize multiple cores. Patch 13 adds a trimming feature (similar to KVM) to QEMU/TCG. The goal is to describe CPU models more precisely by reflecting the feature bits of the real hardware. Features that QEMU does not support are then masked. If we add features to QEMU, we only need to adjust it in one location. Patch 14 adjusts the size of the L2 cache described by leaf 4 to a more conservative value of one megabyte. This prevents guests assuming too large caches if they use optimized algorithms. Patch 15-19 changes the CPU models to describe the actual CPUID bits of the real silicon (checked with actual machines, x86info examples and datasheets). Unsupported features will be masked. Patch 20 adds a kvm32 CPU model, which is useful for migration. Patch 21 finally exposes both the 32- and 64-bit CPU model also to QEMU32, since the LM bit will be masked out. Please review, comment and apply! Thanks and Regards, Andre. -- Andre Przywara AMD-Operating System Research Center (OSRC), Dresden, Germany Tel: +49 351 448 3567 12 ----to satisfy European Law for business letters: Advanced Micro Devices GmbH Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Andrew Bowd; Thomas M. McCoy; Giuliano Meroni Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632