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: Igor Mammedov
Subject: Re: [Qemu-devel] [PATCH v2 01/15] target-i386: Fix x86_cpuid_set_model_id()
Date: Tue, 24 Apr 2012 13:32:06 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1

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
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?

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

--
-----
 Igor



reply via email to

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