From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751953AbbLNQhq (ORCPT ); Mon, 14 Dec 2015 11:37:46 -0500 Received: from mx2.suse.de ([195.135.220.15]:35114 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751336AbbLNQhp (ORCPT ); Mon, 14 Dec 2015 11:37:45 -0500 Date: Mon, 14 Dec 2015 17:37:38 +0100 From: Borislav Petkov To: Eduardo Habkost Cc: Ashok Raj , kvm@vger.kernel.org, Tony Luck , Gong Chen , Gleb Natapov , linux-kernel@vger.kernel.org, qemu-devel@nongnu.org, Andi Kleen , Paolo Bonzini Subject: Re: [Qemu-devel] [Patch V2 1/2] x86, mce: Basic support to add LMCE support to QEMU Message-ID: <20151214163738.GJ11630@pd.tnic> References: <1449776482-26070-1-git-send-email-ashok.raj@intel.com> <20151214162356.GA5314@thinpad.lan.raisama.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20151214162356.GA5314@thinpad.lan.raisama.net> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 14, 2015 at 02:23:56PM -0200, Eduardo Habkost wrote: > > -#define MCE_CAP_DEF (MCG_CTL_P|MCG_SER_P) > > +#define MCE_CAP_DEF (MCG_CTL_P|MCG_SER_P|MCG_LMCE_P) > > This makes mcg_cap change when upgrading QEMU. > > VMs with MCG_LMCE_P enabled shouldn't be migratable to hosts > running older kernels, or the guest may try to read or write > MSR_IA32_MCG_EXT_CTL after miration and get a #GP. That means: > > 1) Older machine-types (pc-2.5 and older) should keep the > old (MCG_CTL_P|MCG_SER_P) default. > 2) We can't make pc-2.6 enable LMCE by default, either, because > QEMU guarantees that just changing the machine-type shouldn't > introduce new host requirements (see: > http://article.gmane.org/gmane.comp.emulators.qemu/346651) > > It looks like we need a new -cpu option to enable the feature, > then. At least until we raise the minimum kernel version > requirements of QEMU. ... and obviously LMCE is vendor-specific so it cannot be enabled on !Intel guests with a define like that. mce_init() in qemu should check vendor too. The same mistake was done with SER_P but that's much harder to change, as we discussed previously. -- Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) --