From patchwork Mon Sep 27 13:16:16 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 212312 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8RDGicC020815 for ; Mon, 27 Sep 2010 13:16:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759316Ab0I0NQV (ORCPT ); Mon, 27 Sep 2010 09:16:21 -0400 Received: from tx2ehsobe002.messaging.microsoft.com ([65.55.88.12]:11948 "EHLO TX2EHSOBE004.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759268Ab0I0NQT (ORCPT ); Mon, 27 Sep 2010 09:16:19 -0400 Received: from mail152-tx2-R.bigfish.com (10.9.14.253) by TX2EHSOBE004.bigfish.com (10.9.40.24) with Microsoft SMTP Server id 8.1.340.0; Mon, 27 Sep 2010 13:16:19 +0000 Received: from mail152-tx2 (localhost.localdomain [127.0.0.1]) by mail152-tx2-R.bigfish.com (Postfix) with ESMTP id 567FCB3057F; Mon, 27 Sep 2010 13:16:19 +0000 (UTC) X-SpamScore: 3 X-BigFish: VS3(zzzz1202hzz8275bh92fbjz32i87h2a8h62h) X-Spam-TCS-SCL: 1:0 X-FB-DOMAIN-IP-MATCH: fail Received: from mail152-tx2 (localhost.localdomain [127.0.0.1]) by mail152-tx2 (MessageSwitch) id 1285593379114913_23461; Mon, 27 Sep 2010 13:16:19 +0000 (UTC) Received: from TX2EHSMHS013.bigfish.com (unknown [10.9.14.242]) by mail152-tx2.bigfish.com (Postfix) with ESMTP id 1899418D004F; Mon, 27 Sep 2010 13:16:19 +0000 (UTC) Received: from ausb3extmailp02.amd.com (163.181.251.22) by TX2EHSMHS013.bigfish.com (10.9.99.113) with Microsoft SMTP Server (TLS) id 14.0.482.44; Mon, 27 Sep 2010 13:16:18 +0000 Received: from ausb3twp01.amd.com (ausb3twp01.amd.com [163.181.250.37]) by ausb3extmailp02.amd.com (Switch-3.2.7/Switch-3.2.7) with SMTP id o8RDJnCJ013565; Mon, 27 Sep 2010 08:19:52 -0500 X-WSS-ID: 0L9EQ6Y-01-B3U-02 X-M-MSG: Received: from sausexhtp02.amd.com (sausexhtp02.amd.com [163.181.3.152]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by ausb3twp01.amd.com (Tumbleweed MailGate 3.7.2) with ESMTP id 254DC1028516; Mon, 27 Sep 2010 08:16:10 -0500 (CDT) Received: from storexhtp01.amd.com (172.24.4.3) by sausexhtp02.amd.com (163.181.3.152) with Microsoft SMTP Server (TLS) id 8.3.83.0; Mon, 27 Sep 2010 08:16:14 -0500 Received: from gwo.osrc.amd.com (165.204.16.204) by storexhtp01.amd.com (172.24.4.3) with Microsoft SMTP Server id 8.3.83.0; Mon, 27 Sep 2010 09:16:13 -0400 Received: from lemmy.osrc.amd.com (lemmy.osrc.amd.com [165.204.15.93]) by gwo.osrc.amd.com (Postfix) with ESMTP id B3E8649C1FF; Mon, 27 Sep 2010 14:16:12 +0100 (BST) Received: by lemmy.osrc.amd.com (Postfix, from userid 1000) id 7DF799FFC5; Mon, 27 Sep 2010 15:16:30 +0200 (CEST) From: Joerg Roedel To: Avi Kivity , Marcelo Tosatti CC: Alexander Graf , , , Joerg Roedel Subject: [PATCH 2/3] Set cpuid definition to 0 before initializing it Date: Mon, 27 Sep 2010 15:16:16 +0200 Message-ID: <1285593377-1754-3-git-send-email-joerg.roedel@amd.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1285593377-1754-1-git-send-email-joerg.roedel@amd.com> References: <1285593377-1754-1-git-send-email-joerg.roedel@amd.com> MIME-Version: 1.0 X-Reverse-DNS: ausb3extmailp02.amd.com Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 27 Sep 2010 13:16:44 +0000 (UTC) diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c index 04ba8d5..3fcf78f 100644 --- a/target-i386/cpuid.c +++ b/target-i386/cpuid.c @@ -788,6 +788,8 @@ int cpu_x86_register (CPUX86State *env, const char *cpu_model) { x86_def_t def1, *def = &def1; + memset(def, 0, sizeof(*def)); + if (cpu_x86_find_by_name(def, cpu_model) < 0) return -1; if (def->vendor1) {