From mboxrd@z Thu Jan 1 00:00:00 1970 From: Haozhong Zhang Subject: Re: [PATCH] target-i386: check vcpu features before accessing MSR_TSC_AUX Date: Mon, 14 Dec 2015 21:54:31 +0800 Message-ID: <20151214135430.GA1526@hz-desktop.sh.intel.com> References: <1450091277-26200-1-git-send-email-haozhong.zhang@intel.com> <566EAD47.8020004@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: , Marcelo Tosatti , Richard Henderson , Eduardo Habkost To: Paolo Bonzini Return-path: Received: from mga09.intel.com ([134.134.136.24]:63454 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932586AbbLNNyv (ORCPT ); Mon, 14 Dec 2015 08:54:51 -0500 Content-Disposition: inline In-Reply-To: <566EAD47.8020004@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 12/14/15 12:51, Paolo Bonzini wrote: > > > On 14/12/2015 12:07, Haozhong Zhang wrote: > > This patch fix a bug that prevents VM rebooting on recent versions of > > KVM (from commit 9dbe6cf). > > > > kvm_get_msrs() is called to save guest MSR_TSC_AUX and other MSRs across > > rebooting. It only checks whether KVM exposes MSR_TSC_AUX to userspace. > > However, if vcpu does not support rdtscp (e.g. kvm64), current KVM will > > fail the saving and thus all other MSRs following it will fail in > > kvm_get_msrs(). As a result, from KVM commit 9dbe6cf that exposes > > MSR_TSC_AUX, VM can not successfully reboot. > > > > This patch fixes this bug by adding the missing rdtscp feature checks. > > That commit is not in any released kernel. Right, it's currently only in kvm next. But I assume it would finally come into a released kernel. > It's better if we just check > msr_info->host_initiated in vmx_get_msr and vmx_set_msr. Can you prepare > a patch? > Yes, I'll send a KVM patch later. And then this QEMU patch is not needed any more. Haozhong