From patchwork Tue Jul 10 08:48:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Herrenschmidt X-Patchwork-Id: 170084 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 118862C01B4 for ; Tue, 10 Jul 2012 18:48:29 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752250Ab2GJIsY (ORCPT ); Tue, 10 Jul 2012 04:48:24 -0400 Received: from gate.crashing.org ([63.228.1.57]:58592 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751919Ab2GJIsX (ORCPT ); Tue, 10 Jul 2012 04:48:23 -0400 Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id q6A8mH7H002974; Tue, 10 Jul 2012 03:48:18 -0500 Message-ID: <1341910097.2561.19.camel@pasglop> Subject: [PATCH] powerpc/kvm: Fix "PR" KVM implementation of H_CEDE From: Benjamin Herrenschmidt To: Alexander Graf Cc: "kvm@vger.kernel.org" , "kvm-ppc@vger.kernel.org" Date: Tue, 10 Jul 2012 18:48:17 +1000 X-Mailer: Evolution 3.2.3-0ubuntu6 Mime-Version: 1.0 Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org H_CEDE should enable the vcpu's MSR:EE bit. It does on "HV" KVM (it's burried in the assembly code though) and as far as I can tell, qemu does it as well. Signed-off-by: Benjamin Herrenschmidt --- Alex, you probably want that in -now- (and maybe even in stable). Without that, bad things happen in guests, especially after Linus pulls what I'm about to send him to fix more issues with the way pseries handles H_CEDE vs. lazy IRQ disabling (it will hang in PR KVM without that fix). -- To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/powerpc/kvm/book3s_pr_papr.c b/arch/powerpc/kvm/book3s_pr_papr.c index 3ff9013..ee02b30 100644 --- a/arch/powerpc/kvm/book3s_pr_papr.c +++ b/arch/powerpc/kvm/book3s_pr_papr.c @@ -241,6 +241,7 @@ int kvmppc_h_pr(struct kvm_vcpu *vcpu, unsigned long cmd) case H_PUT_TCE: return kvmppc_h_pr_put_tce(vcpu); case H_CEDE: + vcpu->arch.shared->msr |= MSR_EE; kvm_vcpu_block(vcpu); clear_bit(KVM_REQ_UNHALT, &vcpu->requests); vcpu->stat.halt_wakeup++;