From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33903) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b98bp-0007Sw-L2 for qemu-devel@nongnu.org; Sat, 04 Jun 2016 06:15:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b98bl-0006a0-Fb for qemu-devel@nongnu.org; Sat, 04 Jun 2016 06:15:12 -0400 Received: from mx2.suse.de ([195.135.220.15]:41928) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b98bl-0006Yo-8y for qemu-devel@nongnu.org; Sat, 04 Jun 2016 06:15:09 -0400 In-Reply-To: <20160603060944.17373-2-haozhong.zhang@intel.com> References: <20160603060944.17373-1-haozhong.zhang@intel.com> <20160603060944.17373-2-haozhong.zhang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 From: Boris Petkov Date: Sat, 04 Jun 2016 12:15:01 +0200 Message-ID: <002b2804-6969-42df-a874-a807f5c0ffde@email.android.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 1/2] target-i386: KVM: add basic Intel LMCE support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Haozhong Zhang , qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcelo Tosatti , "Michael S . Tsirkin" , kvm@vger.kernel.org, Tony Luck , Andi Kleen , Ashok Raj Haozhong Zhang wrote: >This patch adds the support to inject SRAR and SRAO as LMCE, i.e. they >will be injected to only one VCPU rather than broadcast to all >VCPUs. As KVM reports LMCE support on Intel platforms, this features is >only available on Intel platforms. > >Signed-off-by: Ashok Raj >Signed-off-by: Haozhong Zhang >--- >Cc: Paolo Bonzini >Cc: Richard Henderson >Cc: Eduardo Habkost >Cc: Marcelo Tosatti >Cc: Boris Petkov >Cc: kvm@vger.kernel.org >Cc: Tony Luck >Cc: Andi Kleen >--- > target-i386/cpu.c | 26 ++++++++++++++++++++++++++ > target-i386/cpu.h | 13 ++++++++++++- > target-i386/kvm.c | 35 +++++++++++++++++++++++++++++++---- > 3 files changed, 69 insertions(+), 5 deletions(-) ... >@@ -2786,6 +2798,20 @@ static void mce_init(X86CPU *cpu) > && (cenv->features[FEAT_1_EDX] & (CPUID_MCE | CPUID_MCA)) =3D=3D > (CPUID_MCE | CPUID_MCA)) { > cenv->mcg_cap =3D MCE_CAP_DEF | MCE_BANKS_DEF; >+ >+ if (cpu->enable_lmce) { >+ if (lmce_supported()) { >+ cenv->mcg_cap |=3D MCG_LMCE_P; >+ cenv->msr_ia32_feature_control |=3D >+ MSR_IA32_FEATURE_CONTROL_LMCE | >+ MSR_IA32_FEATURE_CONTROL_LOCKED; >+ } else { >+ error_report("Warning: KVM unavailable or not support >LMCE, " >+ "LMCE disabled"); "... or LMCE not supported..." Also, do not split the string for easier grepping. --=20 Sent from a small device: formatting sux and brevity is inevitable.=20