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: 6050261 Return-Path: X-Original-To: patchwork-kvm@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 0C0B7BF90F for ; Thu, 19 Mar 2015 15:00:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3720C2051C for ; Thu, 19 Mar 2015 15:00:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 928F120527 for ; Thu, 19 Mar 2015 15:00:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756383AbbCSPA0 (ORCPT ); Thu, 19 Mar 2015 11:00:26 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:35856 "EHLO mail-wi0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756044AbbCSO6o (ORCPT ); Thu, 19 Mar 2015 10:58:44 -0400 Received: by wibg7 with SMTP id g7so120196861wib.1 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=dnxXypLEwZi2eJpnsQ1HUS7kSsUhRdZB8hQNsvxQzZRHuLz2OYpCvGya8zLj+SzjoK sqLXSZly02sAL1vUm1GqKEiYj71Qo9A1/Qztvv7V6GM3+/N534SG3JIluJudcoLHNeoh BXOBZ3h+WPXIkdiFy1RipqNjk8tc0wep2+ODRgst8NOE6RvEdraDmLfR7ZQ3GfgAcncU HbKTn+LnBXDAnhVESD3HDTgRXgyNFntDByKVl40ffIWJqhF1VDhJu7u4WQolKehGu9s7 u0qf5+EmFW4HoO/K8erEvxl5i5dR4i8alXDQjYmQC4ht7zRq6o1KRRC7i2GSL4cy1u/X EpMg== X-Gm-Message-State: ALoCoQmHQYNC8+NsiHAfhWnusdXgdea+pVwrkGs8gwQ0iY9iwjO9b2J72AW0TwC8Kd8wztZiapJK 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 Cc: linux-kernel@vger.kernel.org, patches@linaro.org, pbonzini@redhat.com, kim.phillips@freescale.com, b.reynal@virtualopensystems.com, feng.wu@intel.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> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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)