From patchwork Thu Mar 19 14:55:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Auger X-Patchwork-Id: 6050561 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 5E028BF90F for ; Thu, 19 Mar 2015 15:17:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8E7CF20519 for ; Thu, 19 Mar 2015 15:17:03 +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 B6DB9203C0 for ; Thu, 19 Mar 2015 15:17:02 +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 1YYc99-0001En-0r; Thu, 19 Mar 2015 15:14:07 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YYbud-0005In-Hv for linux-arm-kernel@bombadil.infradead.org; Thu, 19 Mar 2015 14:59:07 +0000 Received: from mail-wi0-f182.google.com ([209.85.212.182]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YYbua-0001LZ-MV for linux-arm-kernel@lists.infradead.org; Thu, 19 Mar 2015 14:59:05 +0000 Received: by wibdy8 with SMTP id dy8so120199333wib.0 for ; Thu, 19 Mar 2015 07:58:43 -0700 (PDT) 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=DfIOiAnzj1afOVIiJUchWXnZ7ijhVVwVAdMzrZ7vGsk=; b=CC/oavWrQRCIrd5Zq+w4nyXjGe+JBnc9nVgXHPqKCL5IIyzxdDEehjp94X1HS94a29 UwoCRb4gVHjkNWjgdn0V4ME9afs/6PPELVn3PwYPnieZHvx+6zUqSxWq8+kMKAxeaya5 /ys1v8L+0g4D3zrnAMkfaG6Rpu8We10gsfi1bfVqgOvgLpFO1KezCdPr6ji6TanPUJ0H cECGTEnDIG3PSEmrfXteaniuM2v1McdglBNxPnyA+rOSzchI9pYQDFhwj7ij3JSiPLxa +It3mhAFyGBAF9TT4FMd7IgpRPBkHBYbKH5Ov7a32GOz1BKcbU56OkA84ukfx7eOzfmN cqgQ== X-Gm-Message-State: ALoCoQmZtlh5aW9RKuFRgymDvZfPTspwo4NfeJ+QS0caXwsov1GQGnABqkrjKdpbu3+jl3PCiXut X-Received: by 10.194.172.9 with SMTP id ay9mr151408086wjc.2.1426777123649; Thu, 19 Mar 2015 07:58:43 -0700 (PDT) Received: from gnx2579.gnb.st.com (weg38-3-78-232-41-119.fbx.proxad.net. [78.232.41.119]) by mx.google.com with ESMTPSA id a6sm1695350wiy.17.2015.03.19.07.58.41 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 19 Mar 2015 07:58:42 -0700 (PDT) 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, kvm@vger.kernel.org, alex.williamson@redhat.com Subject: [RFC v5 10/13] kvm: introduce kvm_arch_halt_guest and kvm_arch_resume_guest Date: Thu, 19 Mar 2015 15:55:48 +0100 Message-Id: <1426776951-24901-11-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1426776951-24901-1-git-send-email-eric.auger@linaro.org> References: <1426776951-24901-1-git-send-email-eric.auger@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150319_145904_787297_8F8E20CF X-CRM114-Status: UNSURE ( 9.47 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) Cc: kim.phillips@freescale.com, b.reynal@virtualopensystems.com, patches@linaro.org, linux-kernel@vger.kernel.org, pbonzini@redhat.com, feng.wu@intel.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 ae9c720..f4e1829 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -1053,6 +1053,18 @@ extern struct kvm_device_ops kvm_xics_ops; extern struct kvm_device_ops kvm_arm_vgic_v2_ops; extern struct kvm_device_ops kvm_arm_vgic_v3_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)