From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDmO3-0007kj-Bd for qemu-devel@nongnu.org; Fri, 17 Jun 2016 01:32:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDmO0-0002uD-7L for qemu-devel@nongnu.org; Fri, 17 Jun 2016 01:32:11 -0400 Received: from mx6-phx2.redhat.com ([209.132.183.39]:36217) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDmNz-0002u6-Vc for qemu-devel@nongnu.org; Fri, 17 Jun 2016 01:32:08 -0400 Date: Fri, 17 Jun 2016 01:32:03 -0400 (EDT) From: Paolo Bonzini Message-ID: <607161709.23546274.1466141523872.JavaMail.zimbra@redhat.com> In-Reply-To: <20160617005103.ipyoz7p3eh2z6odu@hz-desktop> References: <20160616114924.21765-1-haozhong.zhang@intel.com> <0e97a342-152e-1823-6d65-3e1703cf2ef0@redhat.com> <20160617005103.ipyoz7p3eh2z6odu@hz-desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] fw/msr_feature_control: add support to set MSR_IA32_FEATURE_CONTROL List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Haozhong Zhang Cc: seabios@seabios.org, qemu-devel@nongnu.org > > > diff --git a/src/fw/msr_feature_control.c b/src/fw/msr_feature_control.c > > > new file mode 100644 > > > index 0000000..35d4ab8 > > > --- /dev/null > > > +++ b/src/fw/msr_feature_control.c > > > @@ -0,0 +1,16 @@ > > > +#include "util.h" // msr_feature_control_setup > > > +#include "x86.h" // wrmsr > > > +#include "romfile.h" // romfile_find > > > + > > > +u64 feature_control_bits; > > > + > > > +void msr_feature_control_setup(void) > > > +{ > > > + struct romfile_s *f = romfile_find("etc/msr_feature_control"); > > > + if (!f) > > > + return; > > > + > > > + f->copy(f, &feature_control_bits, sizeof(feature_control_bits)); > > > + if (feature_control_bits) > > > + wrmsr(MSR_IA32_FEATURE_CONTROL, feature_control_bits); > > > > You can use wrmsr_smp and avoid the change below to handle_smp(). It > > also removes the need for the feature_control_bits global variable. > > > > Good idea. I think I should also rename smp_mtrr and smp_mtrr_count to > something like smp_msr and smp_msr_count, because they will not be used > only for MTRR. Yes, pleaase do! Thanks, Paolo