From mboxrd@z Thu Jan 1 00:00:00 1970 From: Haozhong Zhang Subject: Re: [PATCH v4 2/3] target-i386: add migration support for Intel LMCE Date: Thu, 16 Jun 2016 18:55:29 +0800 Message-ID: <20160616105529.dpmjjeqsdnf5cdnm@hz-desktop> References: <20160616060621.30422-1-haozhong.zhang@intel.com> <20160616060621.30422-3-haozhong.zhang@intel.com> <1d2312d2-4dd3-6a73-d0d7-84b4e8c749e2@redhat.com> <20160616102918.7geiaomeitldj7jy@hz-desktop> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: qemu-devel@nongnu.org, Richard Henderson , Eduardo Habkost , "Michael S . Tsirkin" , Marcelo Tosatti , kvm@vger.kernel.org, Boris Petkov , Tony Luck , Andi Kleen , rkrcmar@redhat.com, Ashok Raj To: Paolo Bonzini Return-path: Received: from mga03.intel.com ([134.134.136.65]:10727 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751681AbcFPKzd (ORCPT ); Thu, 16 Jun 2016 06:55:33 -0400 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 06/16/16 12:41, Paolo Bonzini wrote: > > > On 16/06/2016 12:29, Haozhong Zhang wrote: > > On 06/16/16 11:51, Paolo Bonzini wrote: > >> > >> > >> On 16/06/2016 08:06, Haozhong Zhang wrote: > >>> Migration is only allowed between VCPUs with the same lmce option. > >>> > >>> Signed-off-by: Haozhong Zhang > >>> --- > >>> target-i386/machine.c | 25 +++++++++++++++++++++++++ > >>> 1 file changed, 25 insertions(+) > >>> > >>> diff --git a/target-i386/machine.c b/target-i386/machine.c > >>> index cb9adf2..00375a3 100644 > >>> --- a/target-i386/machine.c > >>> +++ b/target-i386/machine.c > >>> @@ -347,6 +347,12 @@ static int cpu_post_load(void *opaque, int version_id) > >>> return -EINVAL; > >>> } > >>> > >>> + if (!cpu->enable_lmce && (env->mcg_cap & MCG_LMCE_P)) { > >>> + error_report("Config mismatch: VCPU has LMCE enabled, " > >>> + "but \"lmce\" option is disabled"); > >>> + return -EINVAL; > >>> + } > >>> + > >> > >> I think this is unnecessary. Apart from this, the patch is good and can > >> be squashed in patch 1 for v5. > >> > > > > Without this check, the migration from LMCE enabled QEMU to LMCE > > disabled QEMU will not fail. Is such configuration change considered > > be error? If not, I will remove the error report and return, but add a > > fix to remove MCG_LMCE_P from env->mcg_cap in this check. > > It's considered a user error. You can skip the "if" completely. > Eduardo said nice for this part in previous version [1], so we may wait for his comments? [1] http://lists.nongnu.org/archive/html/qemu-devel/2016-06/msg01992.html Thanks, Haozhong From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49567) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDUxU-0006EB-Gk for qemu-devel@nongnu.org; Thu, 16 Jun 2016 06:55:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDUxQ-0007Ns-OB for qemu-devel@nongnu.org; Thu, 16 Jun 2016 06:55:35 -0400 Received: from mga14.intel.com ([192.55.52.115]:60507) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDUxQ-0007Nn-Gf for qemu-devel@nongnu.org; Thu, 16 Jun 2016 06:55:32 -0400 Date: Thu, 16 Jun 2016 18:55:29 +0800 From: Haozhong Zhang Message-ID: <20160616105529.dpmjjeqsdnf5cdnm@hz-desktop> References: <20160616060621.30422-1-haozhong.zhang@intel.com> <20160616060621.30422-3-haozhong.zhang@intel.com> <1d2312d2-4dd3-6a73-d0d7-84b4e8c749e2@redhat.com> <20160616102918.7geiaomeitldj7jy@hz-desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v4 2/3] target-i386: add migration support for Intel LMCE List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, Richard Henderson , Eduardo Habkost , "Michael S . Tsirkin" , Marcelo Tosatti , kvm@vger.kernel.org, Boris Petkov , Tony Luck , Andi Kleen , rkrcmar@redhat.com, Ashok Raj On 06/16/16 12:41, Paolo Bonzini wrote: > > > On 16/06/2016 12:29, Haozhong Zhang wrote: > > On 06/16/16 11:51, Paolo Bonzini wrote: > >> > >> > >> On 16/06/2016 08:06, Haozhong Zhang wrote: > >>> Migration is only allowed between VCPUs with the same lmce option. > >>> > >>> Signed-off-by: Haozhong Zhang > >>> --- > >>> target-i386/machine.c | 25 +++++++++++++++++++++++++ > >>> 1 file changed, 25 insertions(+) > >>> > >>> diff --git a/target-i386/machine.c b/target-i386/machine.c > >>> index cb9adf2..00375a3 100644 > >>> --- a/target-i386/machine.c > >>> +++ b/target-i386/machine.c > >>> @@ -347,6 +347,12 @@ static int cpu_post_load(void *opaque, int version_id) > >>> return -EINVAL; > >>> } > >>> > >>> + if (!cpu->enable_lmce && (env->mcg_cap & MCG_LMCE_P)) { > >>> + error_report("Config mismatch: VCPU has LMCE enabled, " > >>> + "but \"lmce\" option is disabled"); > >>> + return -EINVAL; > >>> + } > >>> + > >> > >> I think this is unnecessary. Apart from this, the patch is good and can > >> be squashed in patch 1 for v5. > >> > > > > Without this check, the migration from LMCE enabled QEMU to LMCE > > disabled QEMU will not fail. Is such configuration change considered > > be error? If not, I will remove the error report and return, but add a > > fix to remove MCG_LMCE_P from env->mcg_cap in this check. > > It's considered a user error. You can skip the "if" completely. > Eduardo said nice for this part in previous version [1], so we may wait for his comments? [1] http://lists.nongnu.org/archive/html/qemu-devel/2016-06/msg01992.html Thanks, Haozhong