From patchwork Wed Feb 11 08:32:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Auger X-Patchwork-Id: 5811141 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DA732BF440 for ; Wed, 11 Feb 2015 08:45:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2313D20218 for ; Wed, 11 Feb 2015 08:45:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 524E320211 for ; Wed, 11 Feb 2015 08:45:25 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YLSsT-0001dp-IS; Wed, 11 Feb 2015 08:42:33 +0000 Received: from mail-ig0-f171.google.com ([209.85.213.171]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YLSm8-0002IS-8i for linux-arm-kernel@lists.infradead.org; Wed, 11 Feb 2015 08:36:00 +0000 Received: by mail-ig0-f171.google.com with SMTP id h15so29192508igd.4 for ; Wed, 11 Feb 2015 00:35:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ay/thstedXfxJopGbX98u4uRorv5t4+V1EKh4stoX1k=; b=ZL2qiIVNgH3NaQwQflTX6Y6kB35ogPUOWwVxki8MxBq212acc96fC/C4pO/vRUmp/0 Hj7U6F5UGBpRZGs4NLeCGzZmTGLQrpSWrmdayAj6cA9QnPUp983QLu5KdsYwEX97oMIe /Z+h3YAXpBZ+Za+UQXKPorpp7c9SnXHJQgb/3XQOVCTd/iuvZAfpXLMds0/Olg6lPCm+ F/8xwMv3v/JTOjQkmSADYA32r1/U6yD0YLGciLrW6L7iEiaShF3tm+kaWWBk02NQFw1U bkz9W4mix/EBVnM7Vp/mUtuNR7Akxbkg5FvBJnuVdQCh4GsUiTrQupUPMcOZ/f341Ayq NhPg== X-Gm-Message-State: ALoCoQmNR2RtHGALCJyp90ySRu6ZmlzUSjFD83VtoNAuLZ2lIhECKr8slHUhXX8GquUSJz1U/nvc X-Received: by 10.50.222.70 with SMTP id qk6mr28155184igc.47.1423643739012; Wed, 11 Feb 2015 00:35:39 -0800 (PST) Received: from gnx2579.solutionip.com ([113.28.134.59]) by mx.google.com with ESMTPSA id m38sm62189ioi.39.2015.02.11.00.35.33 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Feb 2015 00:35:38 -0800 (PST) From: Eric Auger To: eric.auger@st.com, eric.auger@linaro.org, christoffer.dall@linaro.org, marc.zyngier@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, alex.williamson@redhat.com, feng.wu@intel.com Subject: [RFC v4 10/13] kvm: introduce kvm_arch_halt_guest and kvm_arch_resume_guest Date: Wed, 11 Feb 2015 09:32:20 +0100 Message-Id: <1423643543-24409-11-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1423643543-24409-1-git-send-email-eric.auger@linaro.org> References: <1423643543-24409-1-git-send-email-eric.auger@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150211_003600_387585_65473BE6 X-CRM114-Status: UNSURE ( 7.32 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: b.reynal@virtualopensystems.com, patches@linaro.org, gleb@kernel.org, andre.przywara@arm.com, a.rigo@virtualopensystems.com, pbonzini@redhat.com, a.motakis@virtualopensystems.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This API allows to - exit the guest and avoid re-entering it - resume the guest execution Signed-off-by: Eric Auger --- include/linux/kvm_host.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 7f5858d..81c93de 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -1057,6 +1057,18 @@ void kvm_unregister_device_ops(u32 type); extern struct kvm_device_ops kvm_mpic_ops; extern struct kvm_device_ops kvm_xics_ops; +#ifdef __KVM_HAVE_ARCH_HALT_GUEST + +void kvm_arch_halt_guest(struct kvm *kvm); +void kvm_arch_resume_guest(struct kvm *kvm); + +#else + +inline void kvm_arch_halt_guest(struct kvm *kvm) {} +inline void kvm_arch_resume_guest(struct kvm *kvm) {} + +#endif + #ifdef CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT static inline void kvm_vcpu_set_in_spin_loop(struct kvm_vcpu *vcpu, bool val)