From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46464) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZxGAb-00011A-Js for qemu-devel@nongnu.org; Fri, 13 Nov 2015 10:21:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZxGAY-0003TU-EE for qemu-devel@nongnu.org; Fri, 13 Nov 2015 10:21:45 -0500 Date: Fri, 13 Nov 2015 13:21:35 -0200 From: Eduardo Habkost Message-ID: <20151113152135.GS4180@thinpad.lan.raisama.net> References: <1446456403-29909-1-git-send-email-haozhong.zhang@intel.com> <1446456403-29909-2-git-send-email-haozhong.zhang@intel.com> <20151111141609.GF20436@thinpad.lan.raisama.net> <20151111142757.GA3160@hzzhang-OptiPlex-9020.sh.intel.com> <20151113022354.GC26153@hzzhang-OptiPlex-9020.sh.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151113022354.GC26153@hzzhang-OptiPlex-9020.sh.intel.com> Subject: Re: [Qemu-devel] [PATCH v3 1/3] target-i386: add a subsection for migrating vcpu's TSC rate List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, "Dr. David Alan Gilbert" , Peter Maydell , James Hogan , kvm@vger.kernel.org, "Michael S. Tsirkin" , Marcelo Tosatti , Alexander Graf , Christian Borntraeger , qemu-ppc@nongnu.org, Cornelia Huck , Paolo Bonzini , Leon Alrae , Aurelien Jarno , Richard Henderson On Fri, Nov 13, 2015 at 10:23:54AM +0800, Haozhong Zhang wrote: > On 11/11/15 22:27, Haozhong Zhang wrote: > > On 11/11/15 12:16, Eduardo Habkost wrote: > [...] > > > > diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c > > > > index 2f8f396..858ed69 100644 > > > > --- a/hw/i386/pc_q35.c > > > > +++ b/hw/i386/pc_q35.c > > > > @@ -385,6 +385,7 @@ static void pc_q35_2_4_machine_options(MachineClass *m) > > > > pc_q35_2_5_machine_options(m); > > > > m->alias = NULL; > > > > pcmc->broken_reserved_end = true; > > > > + pcmc->save_tsc_khz = false; > > > > > > I had suggested the PCMachineClass field, but now I've been thinking: > > > all other fields related to tsc_khz are in X86CPU, so I believe this > > > belongs to X86CPU too. It could be a simple X86CPU property set by > > > PC_COMPAT_2_4. > > > > > > > Reasonable, will update in the next version. > > Or maybe no ... > > I think there is still a problem to set a X86CPU property in > PC_COMPAT_2_4: > > if I create a property for save_tsc_khz by adding > DEFINE_PROP_BOOL("save-tsc-freq", X86CPU, save_tsc_khz, true) > in x86_cpu_properties and add > { > .driver = TYPE_X86_CPU, > .property = "save-tsc-freq", > .value = "off", > } > in PC_COMPAT_2_4, then "save-tsc-freq" will also become a > user-visible cpu option. But we agreed on keeping it as an > internal flag in the previous discussion. > > Any other ways to set a property in PC_COMPAT_* while keeping that > property internal? I don't think making it internal is a requirement. It just make things simpler because it allowed us to postpone decisions about the user-visible parts. ...which seems to be a good reason to keep it on PCMachineClass by now, if you prefer it that way. The subsection code is already on machine.c and not on cpu.c, anyway. -- Eduardo