From: Mukesh Rathor Subject: [PATCH] pvh: add a call to pit_init to init spinlock Date: Fri, 7 Mar 2014 18:28:38 -0800 Message-ID: <1394245718-6791-2-git-send-email-mukesh.rathor@oracle.com> References: <1394245718-6791-1-git-send-email-mukesh.rathor@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WM70S-000188-Mp for xen-devel@lists.xenproject.org; Sat, 08 Mar 2014 02:28:56 +0000 In-Reply-To: <1394245718-6791-1-git-send-email-mukesh.rathor@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: George.Dunlap@eu.citrix.com, keir.xen@gmail.com, JBeulich@suse.com List-Id: xen-devel@lists.xenproject.org During halt of a pvh guest, the guest may do speaker shutdown. This results in call to handle_speaker_io in xen. It will hang on the vpit spin lock because it has not been initialized via pit_init, which is called for both pv and hvm. This patch adds a call to it for pvh. Signed-off-by: Mukesh Rathor --- xen/arch/x86/hvm/hvm.c | 3 +++ xen/arch/x86/hvm/i8254.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 9e85c13..07e44f6 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -1299,6 +1299,9 @@ int hvm_vcpu_initialise(struct vcpu *v) v->arch.hvm_vcpu.hcall_64bit = 1; /* PVH 32bitfixme. */ /* This is for hvm_long_mode_enabled(v). */ v->arch.hvm_vcpu.guest_efer = EFER_SCE | EFER_LMA | EFER_LME; + + if ( v->vcpu_id == 0 ) + pit_init(v, cpu_khz); return 0; } diff --git a/xen/arch/x86/hvm/i8254.c b/xen/arch/x86/hvm/i8254.c index c0d6bc2..08325b5 100644 --- a/xen/arch/x86/hvm/i8254.c +++ b/xen/arch/x86/hvm/i8254.c @@ -454,6 +454,9 @@ void pit_init(struct vcpu *v, unsigned long cpu_khz) spin_lock_init(&pit->lock); + if ( is_pvh_vcpu(v) ) + return; + if ( is_hvm_domain(d) ) { register_portio_handler(d, PIT_BASE, 4, handle_pit_io); -- 1.8.3.1