All of lore.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@suse.de>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: Ashok Raj <ashok.raj@intel.com>,
	kvm@vger.kernel.org, Tony Luck <tony.luck@intel.com>,
	Gong Chen <gong.chen@intel.com>, Gleb Natapov <gleb@kernel.org>,
	linux-kernel@vger.kernel.org, qemu-devel@nongnu.org,
	Andi Kleen <andi.kleen@intel.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [Patch V2 1/2] x86, mce: Basic support to add LMCE support to QEMU
Date: Mon, 14 Dec 2015 17:37:38 +0100	[thread overview]
Message-ID: <20151214163738.GJ11630@pd.tnic> (raw)
In-Reply-To: <20151214162356.GA5314@thinpad.lan.raisama.net>

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)
-- 

WARNING: multiple messages have this Message-ID (diff)
From: Borislav Petkov <bp@suse.de>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: qemu-devel@nongnu.org, Tony Luck <tony.luck@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	kvm@vger.kernel.org, Gleb Natapov <gleb@kernel.org>,
	linux-kernel@vger.kernel.org, Gong Chen <gong.chen@intel.com>,
	Andi Kleen <andi.kleen@intel.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [Patch V2 1/2] x86, mce: Basic support to add LMCE support to QEMU
Date: Mon, 14 Dec 2015 17:37:38 +0100	[thread overview]
Message-ID: <20151214163738.GJ11630@pd.tnic> (raw)
In-Reply-To: <20151214162356.GA5314@thinpad.lan.raisama.net>

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)
-- 

  reply	other threads:[~2015-12-14 16:37 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-10 19:41 [Patch V2 1/2] x86,mce: Basic support to add LMCE support to QEMU Ashok Raj
2015-12-10 19:41 ` [Qemu-devel] [Patch V2 1/2] x86, mce: " Ashok Raj
2015-12-10 19:41 ` [Patch V2 2/2] x86, mce: Need to translate GPA to HPA to inject error in guest Ashok Raj
2015-12-10 19:41   ` [Qemu-devel] " Ashok Raj
2015-12-10 19:41   ` Ashok Raj
2015-12-12  3:13   ` Chen, Gong
2015-12-12  3:13     ` [Qemu-devel] " Chen, Gong
2015-12-14 16:23 ` [Qemu-devel] [Patch V2 1/2] x86, mce: Basic support to add LMCE support to QEMU Eduardo Habkost
2015-12-14 16:23   ` Eduardo Habkost
2015-12-14 16:37   ` Borislav Petkov [this message]
2015-12-14 16:37     ` Borislav Petkov
2015-12-14 19:11     ` Raj, Ashok
2015-12-14 19:11       ` Raj, Ashok
2015-12-14 18:32       ` Eduardo Habkost
2015-12-14 18:32         ` Eduardo Habkost
2015-12-14 22:37       ` Borislav Petkov
2015-12-14 22:37         ` [Qemu-devel] " Borislav Petkov
2015-12-14 22:37         ` Borislav Petkov
2015-12-15  0:17         ` Raj, Ashok
2015-12-15  0:17           ` Raj, Ashok
2015-12-15 13:04           ` Borislav Petkov
2015-12-15 13:04             ` [Qemu-devel] " Borislav Petkov
2015-12-15 13:04             ` Borislav Petkov
2015-12-15 15:42           ` Eduardo Habkost
2015-12-15 15:42             ` Eduardo Habkost
2015-12-14 19:05   ` Raj, Ashok
2015-12-14 19:05     ` Raj, Ashok

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151214163738.GJ11630@pd.tnic \
    --to=bp@suse.de \
    --cc=andi.kleen@intel.com \
    --cc=ashok.raj@intel.com \
    --cc=ehabkost@redhat.com \
    --cc=gleb@kernel.org \
    --cc=gong.chen@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.