From patchwork Fri Jun 22 20:04:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stuart Yoder X-Patchwork-Id: 166669 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 13EB1B6FA3 for ; Sat, 23 Jun 2012 06:04:17 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932136Ab2FVUEQ (ORCPT ); Fri, 22 Jun 2012 16:04:16 -0400 Received: from ch1ehsobe004.messaging.microsoft.com ([216.32.181.184]:26354 "EHLO ch1outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932089Ab2FVUEP (ORCPT ); Fri, 22 Jun 2012 16:04:15 -0400 Received: from mail145-ch1-R.bigfish.com (10.43.68.246) by CH1EHSOBE013.bigfish.com (10.43.70.63) with Microsoft SMTP Server id 14.1.225.23; Fri, 22 Jun 2012 20:02:44 +0000 Received: from mail145-ch1 (localhost [127.0.0.1]) by mail145-ch1-R.bigfish.com (Postfix) with ESMTP id DDB10805B4; Fri, 22 Jun 2012 20:02:43 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bhz2dh2a8h668h839hd24he5bhf0ah) Received: from mail145-ch1 (localhost.localdomain [127.0.0.1]) by mail145-ch1 (MessageSwitch) id 134039536216132_31664; Fri, 22 Jun 2012 20:02:42 +0000 (UTC) Received: from CH1EHSMHS022.bigfish.com (snatpool3.int.messaging.microsoft.com [10.43.68.225]) by mail145-ch1.bigfish.com (Postfix) with ESMTP id 01EFA3E0047; Fri, 22 Jun 2012 20:02:42 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS022.bigfish.com (10.43.70.22) with Microsoft SMTP Server (TLS) id 14.1.225.23; Fri, 22 Jun 2012 20:02:41 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server (TLS) id 14.2.298.5; Fri, 22 Jun 2012 15:04:11 -0500 Received: from right.am.freescale.net (right.am.freescale.net [10.82.193.13]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id q5MK4A57013148; Fri, 22 Jun 2012 13:04:11 -0700 From: Stuart Yoder To: , , Subject: [PATCH v11 3/8] KVM: PPC: add pvinfo for hcall opcodes on e500mc/e5500 Date: Fri, 22 Jun 2012 15:04:10 -0500 Message-ID: <1340395450-10521-1-git-send-email-stuart.yoder@freescale.com> X-Mailer: git-send-email 1.7.3.4 MIME-Version: 1.0 X-OriginatorOrg: freescale.com Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org From: Stuart Yoder Signed-off-by: Liu Yu [stuart: factored this out from idle hcall support in host patch] Signed-off-by: Stuart Yoder --- -v11 -split this code out into a separate patch as per the review comments arch/powerpc/kvm/powerpc.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index a98f7e0..30cf01c 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c @@ -739,9 +739,16 @@ int kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf) static int kvm_vm_ioctl_get_pvinfo(struct kvm_ppc_pvinfo *pvinfo) { + u32 inst_nop = 0x60000000; +#ifdef CONFIG_KVM_BOOKE_HV + u32 inst_sc1 = 0x44000022; + pvinfo->hcall[0] = inst_sc1; + pvinfo->hcall[1] = inst_nop; + pvinfo->hcall[2] = inst_nop; + pvinfo->hcall[3] = inst_nop; +#else u32 inst_lis = 0x3c000000; u32 inst_ori = 0x60000000; - u32 inst_nop = 0x60000000; u32 inst_sc = 0x44000002; u32 inst_imm_mask = 0xffff; @@ -758,6 +765,7 @@ static int kvm_vm_ioctl_get_pvinfo(struct kvm_ppc_pvinfo *pvinfo) pvinfo->hcall[1] = inst_ori | (KVM_SC_MAGIC_R0 & inst_imm_mask); pvinfo->hcall[2] = inst_sc; pvinfo->hcall[3] = inst_nop; +#endif return 0; }