From patchwork Mon Apr 8 10:32:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bharat Bhushan X-Patchwork-Id: 2407281 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 B538CDFB78 for ; Mon, 8 Apr 2013 10:32:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935099Ab3DHKcE (ORCPT ); Mon, 8 Apr 2013 06:32:04 -0400 Received: from co1ehsobe001.messaging.microsoft.com ([216.32.180.184]:14485 "EHLO co1outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934750Ab3DHKcC (ORCPT ); Mon, 8 Apr 2013 06:32:02 -0400 Received: from mail47-co1-R.bigfish.com (10.243.78.234) by CO1EHSOBE024.bigfish.com (10.243.66.87) with Microsoft SMTP Server id 14.1.225.23; Mon, 8 Apr 2013 10:32:01 +0000 Received: from mail47-co1 (localhost [127.0.0.1]) by mail47-co1-R.bigfish.com (Postfix) with ESMTP id 9B07A34009A; Mon, 8 Apr 2013 10:32:01 +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 mail47-co1 (localhost.localdomain [127.0.0.1]) by mail47-co1 (MessageSwitch) id 1365417119861201_1942; Mon, 8 Apr 2013 10:31:59 +0000 (UTC) Received: from CO1EHSMHS002.bigfish.com (unknown [10.243.78.231]) by mail47-co1.bigfish.com (Postfix) with ESMTP id CF50C40004D; Mon, 8 Apr 2013 10:31:59 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CO1EHSMHS002.bigfish.com (10.243.66.12) with Microsoft SMTP Server (TLS) id 14.1.225.23; Mon, 8 Apr 2013 10:31:59 +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:31:58 +0000 Received: from freescale.com ([10.232.15.72]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with SMTP id r38AVr9j005837; Mon, 8 Apr 2013 03:31:54 -0700 Received: by freescale.com (sSMTP sendmail emulation); Mon, 08 Apr 2013 16:02:35 +0530 From: Bharat Bhushan To: , , , CC: Bharat Bhushan Subject: [PATCH 3/7 v3] KVM: extend EMULATE_EXIT_USER to support different exit reasons Date: Mon, 8 Apr 2013 16:02:14 +0530 Message-ID: <1365417138-8202-4-git-send-email-Bharat.Bhushan@freescale.com> X-Mailer: git-send-email 1.5.6.5 In-Reply-To: <1365417138-8202-3-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> 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 Currently the instruction emulator code returns EMULATE_EXIT_USER and common code initializes the "run->exit_reason = .." and "vcpu->arch.hcall_needed = .." with one fixed reason. But there can be different reasons when emulator need to exit to user space. To support that the "run->exit_reason = .." and "vcpu->arch.hcall_needed = .." initialization is moved a level up to emulator. Signed-off-by: Bharat Bhushan --- arch/powerpc/kvm/book3s_emulate.c | 2 ++ arch/powerpc/kvm/book3s_pr.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kvm/book3s_emulate.c b/arch/powerpc/kvm/book3s_emulate.c index cdd19d6..1f6344c 100644 --- a/arch/powerpc/kvm/book3s_emulate.c +++ b/arch/powerpc/kvm/book3s_emulate.c @@ -194,6 +194,8 @@ int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu, run->papr_hcall.args[i] = gpr; } + run->exit_reason = KVM_EXIT_PAPR_HCALL; + vcpu->arch.hcall_needed = 1; emulated = EMULATE_EXIT_USER; break; } diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c index b960faf..c1cffa8 100644 --- a/arch/powerpc/kvm/book3s_pr.c +++ b/arch/powerpc/kvm/book3s_pr.c @@ -763,8 +763,6 @@ program_interrupt: r = RESUME_HOST_NV; break; case EMULATE_EXIT_USER: - run->exit_reason = KVM_EXIT_PAPR_HCALL; - vcpu->arch.hcall_needed = 1; r = RESUME_HOST_NV; break; default: