qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 01/15] target-i386: Fix x86_cpuid_set_model_i


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH v2 01/15] target-i386: Fix x86_cpuid_set_model_id()
Date: Tue, 24 Apr 2012 13:39:17 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120328 Thunderbird/11.0.1

Am 24.04.2012 13:32, schrieb Igor Mammedov:
> On 04/24/2012 11:33 AM, Andreas Färber wrote:
>> Don't assume zeroed cpuid_model[] fields.
>>
>> This doesn't break anything yet but QOM properties should be able to set

Should've read "didn't". I sure hope it doesn't. :)

>> the value to something else without setting an intermediate zero string.
>>
>> Signed-off-by: Andreas Färber<address@hidden>
>> Reviewed-by: Eduardo Habkost<address@hidden>
>> ---
>>   target-i386/cpu.c |    3 +++
>>   1 files changed, 3 insertions(+), 0 deletions(-)
>>
>> diff --git a/target-i386/cpu.c b/target-i386/cpu.c
>> index 3df53ca..80c1ca5 100644
>> --- a/target-i386/cpu.c
>> +++ b/target-i386/cpu.c
>> @@ -627,6 +627,9 @@ static void x86_cpuid_set_model_id(CPUX86State
>> *env, const char *model_id)
>>           model_id = "";
>>       }
>>       len = strlen(model_id);
>> +    for (i = 0; i<  12; i++) {
>> +        env->cpuid_model[i] = 0;
>> +    }
> It's not important, but why not to use memset here?

I guess I was blinded by the for loop below. ;)
Will change it for the PULL if there's no other reason to resend.

Thanks for asking,
Andreas

>>       for (i = 0; i<  48; i++) {
>>           if (i>= len) {
>>               c = '\0';

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

[Prev in Thread] Current Thread [Next in Thread]