From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eduardo Habkost Subject: [PATCH 0/3] target-i386: kvm: Use env->mcg_cap when setting up MCE Date: Wed, 25 Nov 2015 13:49:46 -0200 Message-ID: <1448466589-9407-1-git-send-email-ehabkost@redhat.com> Cc: Marcelo Tosatti , Paolo Bonzini , kvm@vger.kernel.org, ying.huang@intel.com, Borislav Petkov , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Richard Henderson To: qemu-devel@nongnu.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:48962 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752048AbbKYPuD (ORCPT ); Wed, 25 Nov 2015 10:50:03 -0500 Sender: kvm-owner@vger.kernel.org List-ID: Instead of overwriting env->mcg_cap, make kvm_arch_init_vcpu(), use the value already set at the CPU object when initializing MCE. Except for the new "unsupported MCG_CAPS bits" warning, this patch doesn't change any of the existing QEMU behavior. The previous code set env->mcg_cap to: (MCE_CAP_DEF & ioctl(KVM_X86_GET_MCE_CAP_SUPPORTED)) | MCE_BANKS_DEF and the new code still keeps it exactly the same, as env->mcg_cap is already initialized as MCE_CAP_DEF|MCE_BANKS_DEF at mce_init(). This will allow us to change mce_init() in the future, to implement different defaults depending on CPU model, machine-type or command-line parameters. Eduardo Habkost (3): target-i386: kvm: Abort if MCE bank count is not supported by host target-i386: kvm: Use env->mcg_cap when setting up MCE target-i386: kvm: Print warning when clearing mcg_cap bits target-i386/cpu.h | 2 ++ target-i386/kvm.c | 22 ++++++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) -- 2.1.0