From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J1CRN-0005wf-Hx for qemu-devel@nongnu.org; Sat, 08 Dec 2007 22:02:49 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J1CRM-0005vu-Jk for qemu-devel@nongnu.org; Sat, 08 Dec 2007 22:02:49 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J1CRM-0005vl-Ev for qemu-devel@nongnu.org; Sat, 08 Dec 2007 22:02:48 -0500 Received: from relay01.mx.bawue.net ([193.7.176.67]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1J1CRL-0000xU-V2 for qemu-devel@nongnu.org; Sat, 08 Dec 2007 22:02:48 -0500 Date: Sun, 9 Dec 2007 03:02:44 +0000 From: Thiemo Seufer Subject: Re: [Qemu-devel] [PATCH] Allow setting the vendor_id string with x86's -cpu option Message-ID: <20071209030244.GC12436@networkno.de> References: <20071125132334.GA9555@karma.qumranet.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20071125132334.GA9555@karma.qumranet.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dan Kenigsberg Cc: qemu-devel@nongnu.org Dan Kenigsberg wrote: > Having AuthenticAMD hard-coded is nice, but allowing the user to impersonate > whatever CPU she wants is even nicer. > > Also, an English typo (due to me) is corrected. > > Dan. > > --- a/target-i386/helper2.c > +++ b/target-i386/helper2.c > @@ -254,8 +254,17 @@ static int cpu_x86_find_by_name(x86_def_t *x86_cpu_def, const char *cpu_model) > goto error; > } > x86_cpu_def->stepping = stepping; > + } else if (!strcmp(featurestr, "vendor")) { > + if (strlen(val) != 12) { > + fprintf(stderr, "vendor string must be 12 chars long\n"); > + x86_cpu_def = 0; > + goto error; > + } > + x86_cpu_def->vendor1 = *(uint32_t *)val; > + x86_cpu_def->vendor2 = *(uint32_t *)(val + 4); > + x86_cpu_def->vendor3 = *(uint32_t *)(val + 8); Endianness bug. Thiemo