From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32860) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Url9L-0003ki-MM for qemu-devel@nongnu.org; Wed, 26 Jun 2013 04:32:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Url9J-0005EC-9h for qemu-devel@nongnu.org; Wed, 26 Jun 2013 04:32:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:19960) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Url9J-0005Dn-01 for qemu-devel@nongnu.org; Wed, 26 Jun 2013 04:32:21 -0400 Date: Wed, 26 Jun 2013 10:32:18 +0200 From: Igor Mammedov Message-ID: <20130626103218.69e5e2f1@nial.usersys.redhat.com> In-Reply-To: <20130624170943.GL13956@otherpad.lan.raisama.net> References: <1370438326-27054-1-git-send-email-imammedo@redhat.com> <1370438326-27054-9-git-send-email-imammedo@redhat.com> <20130624170943.GL13956@otherpad.lan.raisama.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 08/15] target-i386: cpu: convert 'tsc-frequency' to static property List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: qemu-devel@nongnu.org, afaerber@suse.de On Mon, 24 Jun 2013 14:09:43 -0300 Eduardo Habkost wrote: > On Wed, Jun 05, 2013 at 03:18:39PM +0200, Igor Mammedov wrote: > > Signed-off-by: Igor Mammedov > > --- > > target-i386/cpu.c | 12 +++++++++--- > > 1 files changed, 9 insertions(+), 3 deletions(-) > > > > diff --git a/target-i386/cpu.c b/target-i386/cpu.c > > index 9f6fe06..ec6d33f 100644 > > --- a/target-i386/cpu.c > > +++ b/target-i386/cpu.c > > @@ -1427,6 +1427,14 @@ static void x86_cpuid_set_tsc_freq(Object *obj, Visitor *v, void *opaque, > > cpu->env.tsc_khz = value / 1000; > > } > > > > +static PropertyInfo qdev_prop_tsc_freq = { > > + .name = "int64", > > What about making it "uint64" instead of keeping it signed? We already > reject negative values. > > As this patch just converts the current code/semantics to use static > properties, and the change to uint64 could be done in a separate patch: Yes, purpose of patch is to make conversion and nothing else, so it would be easy to review. > > Reviewed-by: Eduardo Habkost > > > > + .get = x86_cpuid_get_tsc_freq, > > + .set = x86_cpuid_set_tsc_freq, > > +}; > > +#define DEFINE_PROP_TSC_FREQ(_n) \ > > + DEFINE_PROP(_n, X86CPU, env.tsc_khz, qdev_prop_tsc_freq, int32_t) > > + > > static void x86_cpuid_get_apic_id(Object *obj, Visitor *v, void *opaque, > > const char *name, Error **errp) > > { > > @@ -1509,6 +1517,7 @@ static Property cpu_x86_properties[] = { > > DEFINE_PROP_UINT32("xlevel", X86CPU, env.cpuid_xlevel, 0), > > DEFINE_PROP_VENDOR("vendor"), > > DEFINE_PROP_MODEL_ID("model-id"), > > + DEFINE_PROP_TSC_FREQ("tsc-frequency"), > > DEFINE_PROP_END_OF_LIST(), > > }; > > > > @@ -2488,9 +2497,6 @@ static void x86_cpu_initfn(Object *obj) > > cs->env_ptr = env; > > cpu_exec_init(env); > > > > - object_property_add(obj, "tsc-frequency", "int", > > - x86_cpuid_get_tsc_freq, > > - x86_cpuid_set_tsc_freq, NULL, NULL, NULL); > > object_property_add(obj, "apic-id", "int", > > x86_cpuid_get_apic_id, > > x86_cpuid_set_apic_id, NULL, NULL, NULL); > > -- > > 1.7.1 > > > > >