All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Wheeler <kvm@lists.ewheeler.net>
To: kvm@vger.kernel.org
Cc: stable@vger.kernel.org, "Paolo Bonzini" <pbonzini@redhat.com>,
	"Haozhong Zhang" <haozhong.zhang@intel.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	"Gleb Natapov" <gleb@kernel.org>
Subject: [BISECT 4.1.y] [PATCH] regression: kvm: migration hangs guest
Date: Wed, 25 Jan 2017 15:50:38 -0800 (PST)	[thread overview]
Message-ID: <alpine.LRH.2.11.1701251535220.13235@mail.ewheeler.net> (raw)

Hello All,

We discovered guests hanging when using the 4.1.y kernel after 4.1.16 with 
live migration after CentOS applied this patch to the latest version of 
qemu-kvm user space:
	https://git.centos.org/blob/rpms!!qemu-kvm.git/34b32196890e2c41b0aee042e600ba422f29db17/SOURCES!kvm-target-i386-get-put-MSR_TSC_AUX-across-reset-and-mig.patch

Please also see this Bugzilla entry: 
	https://bugzilla.redhat.com/show_bug.cgi?id=1408333

After a bisect, We found this commit to be causing the hang: 
	8a3185c54d650a86dafc8d8bcafa124b50944315 KVM: x86: expose MSR_TSC_AUX to userspace

It turns out that this is not actually the problem, but rather these 
commits need to be pulled in as well to support the 8a31 commit:
	609e36d372a KVM: x86: pass host_initiated to functions that read MSRs
	81b1b9ca6d5 KVM: VMX: Fix host initiated access to guest MSR_TSC_AUX

Thus, we need to either:
	1. Revert commit 8a3185c54d650a86dafc8d8bcafa124b50944315
		- or - 
	2. Merge commits 609e36d372a and 81b1b9ca6d5 into 4.1.y.

If you choose the latter options, then please see below for the backport
patch of 81b1b9ca6d5 (609e36d372a cherry-picks just fine).

What do you believe would be best?

--
Eric Wheeler



>From 788baceebe8a7bbfab4da82caebbca8cdf188e1a Mon Sep 17 00:00:00 2001
From: Haozhong Zhang <haozhong.zhang@intel.com>
Date: Mon, 14 Dec 2015 23:13:38 +0800
Subject: [PATCH] KVM: VMX: Fix host initiated access to guest MSR_TSC_AUX

The current handling of accesses to guest MSR_TSC_AUX returns error if
vcpu does not support rdtscp, though those accesses are initiated by
host. This can result in the reboot failure of some versions of
QEMU. This patch fixes this issue by passing those host initiated
accesses for further handling instead.

Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Conflicts:
	arch/x86/kvm/vmx.c
---
 arch/x86/kvm/vmx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 341ea55..6b219a7 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -2697,7 +2697,7 @@ static int vmx_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata)
 		data = vcpu->arch.ia32_xss;
 		break;
 	case MSR_TSC_AUX:
-		if (!to_vmx(vcpu)->rdtscp_enabled)
+		if (!to_vmx(vcpu)->rdtscp_enabled && !msr_info->host_initiated)
 			return 1;
 		/* Otherwise falls through */
 	default:
@@ -2804,7 +2804,7 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
 			clear_atomic_switch_msr(vmx, MSR_IA32_XSS);
 		break;
 	case MSR_TSC_AUX:
-		if (!vmx->rdtscp_enabled)
+		if (!vmx->rdtscp_enabled && !msr_info->host_initiated)
 			return 1;
 		/* Check reserved bit, higher 32 bits should be zero */
 		if ((data >> 32) != 0)
-- 
1.8.3.1


             reply	other threads:[~2017-01-25 23:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-25 23:50 Eric Wheeler [this message]
2017-01-25 23:58 ` [BISECT 4.1.y] [PATCH] regression: kvm: migration hangs guest Paolo Bonzini
2017-01-26 23:29   ` Eric Wheeler
2017-01-27  6:21     ` Philipp Hahn
2017-02-09 21:34       ` Eric Wheeler
2017-02-15 18:36         ` Eric Wheeler
2017-03-06 19:11 ` Ben Hutchings

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=alpine.LRH.2.11.1701251535220.13235@mail.ewheeler.net \
    --to=kvm@lists.ewheeler.net \
    --cc=gleb@kernel.org \
    --cc=haozhong.zhang@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=stable@vger.kernel.org \
    /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.