From patchwork Mon Apr 8 10:32:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bharat Bhushan X-Patchwork-Id: 2407301 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id E0F49DFB78 for ; Mon, 8 Apr 2013 10:32:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935137Ab3DHKcO (ORCPT ); Mon, 8 Apr 2013 06:32:14 -0400 Received: from co1ehsobe002.messaging.microsoft.com ([216.32.180.185]:41267 "EHLO co1outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935136Ab3DHKcN (ORCPT ); Mon, 8 Apr 2013 06:32:13 -0400 Received: from mail195-co1-R.bigfish.com (10.243.78.252) by CO1EHSOBE021.bigfish.com (10.243.66.84) with Microsoft SMTP Server id 14.1.225.23; Mon, 8 Apr 2013 10:32:12 +0000 Received: from mail195-co1 (localhost [127.0.0.1]) by mail195-co1-R.bigfish.com (Postfix) with ESMTP id B5468CC0192; Mon, 8 Apr 2013 10:32:12 +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: 3 X-BigFish: VS3(zzzz1f42h1fc6h1ee6h1de0h1fdah1202h1e76h1d1ah1d2ah1082kzz8275bhz2dh2a8h668h839he5bhf0ah107ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1155h) Received: from mail195-co1 (localhost.localdomain [127.0.0.1]) by mail195-co1 (MessageSwitch) id 1365417130397806_30043; Mon, 8 Apr 2013 10:32:10 +0000 (UTC) Received: from CO1EHSMHS020.bigfish.com (unknown [10.243.78.246]) by mail195-co1.bigfish.com (Postfix) with ESMTP id 5E1B5A8005D; Mon, 8 Apr 2013 10:32:10 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CO1EHSMHS020.bigfish.com (10.243.66.30) with Microsoft SMTP Server (TLS) id 14.1.225.23; Mon, 8 Apr 2013 10:32:10 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server (TLS) id 14.2.328.11; Mon, 8 Apr 2013 10:32:09 +0000 Received: from freescale.com ([10.232.15.72]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with SMTP id r38AW4eH005923; Mon, 8 Apr 2013 03:32:06 -0700 Received: by freescale.com (sSMTP sendmail emulation); Mon, 08 Apr 2013 16:02:47 +0530 From: Bharat Bhushan To: , , , CC: Bharat Bhushan Subject: [PATCH 5/7 v3] KVM: PPC: exit to user space on "ehpriv" instruction Date: Mon, 8 Apr 2013 16:02:16 +0530 Message-ID: <1365417138-8202-6-git-send-email-Bharat.Bhushan@freescale.com> X-Mailer: git-send-email 1.5.6.5 In-Reply-To: <1365417138-8202-5-git-send-email-Bharat.Bhushan@freescale.com> References: <1365417138-8202-1-git-send-email-Bharat.Bhushan@freescale.com> <1365417138-8202-2-git-send-email-Bharat.Bhushan@freescale.com> <1365417138-8202-3-git-send-email-Bharat.Bhushan@freescale.com> <1365417138-8202-4-git-send-email-Bharat.Bhushan@freescale.com> <1365417138-8202-5-git-send-email-Bharat.Bhushan@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Bharat Bhushan "ehpriv" instruction is used for setting software breakpoints by user space. This patch adds support to exit to user space with "run->debug" have relevant information. Signed-off-by: Bharat Bhushan --- arch/powerpc/kvm/e500_emulate.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/kvm/e500_emulate.c b/arch/powerpc/kvm/e500_emulate.c index e78f353..cefdd38 100644 --- a/arch/powerpc/kvm/e500_emulate.c +++ b/arch/powerpc/kvm/e500_emulate.c @@ -26,6 +26,7 @@ #define XOP_TLBRE 946 #define XOP_TLBWE 978 #define XOP_TLBILX 18 +#define XOP_EHPRIV 270 #ifdef CONFIG_KVM_E500MC static int dbell2prio(ulong param) @@ -130,6 +131,15 @@ int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu, emulated = kvmppc_e500_emul_tlbivax(vcpu, ea); break; + case XOP_EHPRIV: + run->exit_reason = KVM_EXIT_DEBUG; + run->debug.arch.address = vcpu->arch.pc; + run->debug.arch.status = 0; + kvmppc_account_exit(vcpu, DEBUG_EXITS); + emulated = EMULATE_EXIT_USER; + *advance = 0; + break; + default: emulated = EMULATE_FAIL; }