qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Haozhong Zhang <haozhong.zhang@intel.com>, qemu-devel@nongnu.org
Cc: Tony Luck <tony.luck@intel.com>,
	rkrcmar@redhat.com, Eduardo Habkost <ehabkost@redhat.com>,
	kvm@vger.kernel.org, "Michael S . Tsirkin" <mst@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Andi Kleen <andi.kleen@intel.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Ashok Raj <ashok.raj@intel.com>, Boris Petkov <bp@suse.de>,
	Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH v5 0/4] Add QEMU support for Intel local MCE
Date: Wed, 6 Jul 2016 10:26:08 +0200	[thread overview]
Message-ID: <9999098d-ee08-8dc3-0528-d88c93b4e313@redhat.com> (raw)
In-Reply-To: <20160622065624.25291-1-haozhong.zhang@intel.com>

On 06/22/16 08:56, Haozhong Zhang wrote:
> Changes in v5:
>  * v4 Patch 1&2 are now merged into v5 Patch 1. (Paolo Bonzini)
>  * Add a separate Patch 3 to automatically enable LMCE for "-cpu host"
>    if host does support. (Eduardo Habkost)
>  * Move the sanity check of misconfiguration of LMCE to a separate
>    Patch 4. I'm fine to drop it if it's considered to be
>    unnecessary. (Eduardo Habkost)
>  * Move check of MCG_LMCE_P capability to the existing code in
>    kvm_arch_init_vcpu(). The difference is that if LMCE is not
>    supported by host but MCG_LMCE_P is included in env->mcg_cap,
>    kvm_arch_init_vcpu() return with error instead of just reporting a
>    warning. (Eduardo Habkost)
>  * Fix setting has_msr_feature_control in kvm_arch_init_vcpu(). (Paolo
>    Bonzini)
>  * Fix the type error in fw_cfg file "etc/msr_feature_control".
> 
> Changes in v4:
>  * Abort starting QEMU if lmce option is present but host does support
>    LMCE. (Eduardo Habkost)
>  * Remove setting MSR_IA32_FEATURE_CONTROL, which should be left to
>    guest. (Radim Krčmá, Paolo Bonzini
>  * Adjust error messages in mce_init(). (Boris Petkov)
>  * Move adding option 'lmce' to patch 1. (Eduardo Habkost, Paolo Bonzini)
>  * Adjust LMCE error message in cpu_post_load(). (Eduardo Habkost)
>  * (Patch 3) Add a fw_cfg file 'etc/msr_feature_control' to advise
>    bits should be set in MSR_IA32_FEATURE_CONTROL. (Paolo Bonzini)
>  * Fix SOB chain in patch 1.
> 
> Changes in v3:
>  * LMCE can be enabled only for non-intel guests.
>  * LMCE is disabled by default and a cpu option 'lmce=on/off' is added
>    to explicitly enable/disable LMCE.
>  * LMCE is disabled if KVM does not support (even though 'lmce=on').
>  * VM on LMCE-enabled QEMU can be only migrated to LMCE-enabled QEMU.
>  * MCG_LMCE_P is not included in MCE_CAP_DEF and instead added to
>    env->mcg_cap if LMCE is enabled.
>  * Code style fix.
> 
> This QEMU patch series along with the corresponding KVM patch series
> (sent via another email with title "[PATCH v3 0/3] Add KVM support for
> Intel local MCE") enables Intel local MCE feature for guest.
> 
> Intel Local MCE (LMCE) is a feature on Intel Skylake Server CPU that
> can deliver MCE to a single processor thread instead of broadcasting
> to all threads, which can reduce software's load when processing MCE
> on machines with a large number of processor threads.
> 
> The technical details of LMCE can be found in Intel SDM Vol 3, Chapter
> "Machine-Check Architecture" (search for 'LMCE'). Basically,
>  * The capability of LMCE is indicated by bit 27 (MCG_LMCE_P) of
>    MSR_IA32_MCG_CAP.
>  * LMCE is enabled by setting bit 20 (MSR_IA32_FEATURE_CONTROL_LMCE)
>    of MSR_IA32_FEATURE_CONTROL and bit 0 (MCG_EXT_CTL_LMCE_EN) of
>    MSR_IA32_MCG_EXT_CTL.
>  * Software can determine if a MCE is local to the current processor
>    thread by checking bit 2 (MCG_STATUS_LMCE) of MSR_IA32_MCG_STATUS.
> 
> Ashok Raj (1):
>   target-i386: KVM: add basic Intel LMCE support
> 
> Haozhong Zhang (3):
>   i386: publish advised value of MSR_IA32_FEATURE_CONTROL via fw_cfg
>   target-i386: enable LMCE for '-cpu host' if supported by host
>   target-i386: abort migration if LMCE config mismatch
> 
>  hw/i386/pc.c          | 29 +++++++++++++++++++++++++++++
>  target-i386/cpu.c     | 19 ++++++++++++++++++-
>  target-i386/cpu.h     | 16 ++++++++++++++++
>  target-i386/kvm.c     | 36 +++++++++++++++++++++++++++++++++---
>  target-i386/machine.c | 25 +++++++++++++++++++++++++
>  5 files changed, 121 insertions(+), 4 deletions(-)
> 

How can I test this series?

I'm trying to satisfy the conditions in pc_build_feature_control_file(), so that "etc/msr_feature_control" is created. However, I cannot even trigger

    if (ecx & CPUID_EXT_VMX) {
        feature_control_bits |= FEATURE_CONTROL_VMXON_ENABLED_OUTSIDE_SMX;
    }

I tried various -cpu switches (with and without -enable-kvm); nothing seems to work. When I add "+vmx", QEMU always complains that vmx is not available. Any hints?

(My laptop does support VMX, and it has FEATURE_CONTROL_VMXON_ENABLED_OUTSIDE_SMX set in the corresponding host MSR.)

Thanks
Laszlo

  parent reply	other threads:[~2016-07-06  8:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-22  6:56 [Qemu-devel] [PATCH v5 0/4] Add QEMU support for Intel local MCE Haozhong Zhang
2016-06-22  6:56 ` [Qemu-devel] [PATCH v5 1/4] target-i386: KVM: add basic Intel LMCE support Haozhong Zhang
2016-07-07 17:04   ` Eduardo Habkost
2016-06-22  6:56 ` [Qemu-devel] [PATCH v5 2/4] i386: publish advised value of MSR_IA32_FEATURE_CONTROL via fw_cfg Haozhong Zhang
2016-06-22 17:08   ` Paolo Bonzini
2016-06-23  6:08     ` Haozhong Zhang
2016-06-23  6:15   ` [Qemu-devel] [RESEND PATCH " Haozhong Zhang
2016-07-07 17:06     ` Eduardo Habkost
2016-06-22  6:56 ` [Qemu-devel] [PATCH v5 3/4] target-i386: enable LMCE for '-cpu host' if supported by host Haozhong Zhang
2016-07-07 17:05   ` Eduardo Habkost
2016-06-22  6:56 ` [Qemu-devel] [PATCH v5 4/4] target-i386: abort migration if LMCE config mismatch Haozhong Zhang
2016-07-07 17:10   ` Eduardo Habkost
2016-07-08  2:41     ` Haozhong Zhang
2016-07-06  8:26 ` Laszlo Ersek [this message]
2016-07-06  8:35   ` [Qemu-devel] [PATCH v5 0/4] Add QEMU support for Intel local MCE Haozhong Zhang
2016-07-06  8:37     ` Laszlo Ersek

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=9999098d-ee08-8dc3-0528-d88c93b4e313@redhat.com \
    --to=lersek@redhat.com \
    --cc=andi.kleen@intel.com \
    --cc=ashok.raj@intel.com \
    --cc=bp@suse.de \
    --cc=ehabkost@redhat.com \
    --cc=haozhong.zhang@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rkrcmar@redhat.com \
    --cc=rth@twiddle.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).