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: Auger Eric X-Patchwork-Id: 46046 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 08C3B21515 for ; Thu, 19 Mar 2015 14:58:51 +0000 (UTC) Received: by wivz2 with SMTP id z2sf13377286wiv.1 for ; Thu, 19 Mar 2015 07:58:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=DfIOiAnzj1afOVIiJUchWXnZ7ijhVVwVAdMzrZ7vGsk=; b=LS7tnQ64ywh1kapCxeQQQf7wA/zBXIEppTMOd0wWc2ZzMGVbsWwHoBEouFqF7BrHdI IT8WH9Xl4O40d9O8XxbCt3WzgynzroaKfrF1bU32ZPcWTnJb9QzJdw/IyvpEVjxH7gr2 18cSX0Sm4GA+QMUNYZeY8ft7W1mFT9JFKj5MjZMmpcF5Di18D67zYN9mVGNddgOrSmzf GXHTV6mj+cGaxfJ3hBoEWD/BKx47TDuTQOcppM+d1HOSnChi9jr2MLhYQs3MlKyz3OuA FELm/AF3lLSjfO/ER7JMoKSR1JVeYYvpTRgcgUyLO4XfYRd+ZYunxnDoXYo5qsIGPnF2 L8wA== X-Gm-Message-State: ALoCoQl1W6NFR1b3y94RZoDn/ZQt6+s3OnEubliIoWHiq0ER+iFtxWu/dRWPrbUVjzatMUJLiSKr X-Received: by 10.152.20.41 with SMTP id k9mr102238lae.10.1426777130341; Thu, 19 Mar 2015 07:58:50 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.42.178 with SMTP id p18ls257489lal.68.gmail; Thu, 19 Mar 2015 07:58:50 -0700 (PDT) X-Received: by 10.152.23.195 with SMTP id o3mr66849798laf.11.1426777130168; Thu, 19 Mar 2015 07:58:50 -0700 (PDT) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com. [209.85.217.174]) by mx.google.com with ESMTPS id q7si1137618lbk.136.2015.03.19.07.58.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Mar 2015 07:58:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by lbnq5 with SMTP id q5so26635611lbn.0 for ; Thu, 19 Mar 2015 07:58:50 -0700 (PDT) X-Received: by 10.152.116.65 with SMTP id ju1mr49886131lab.32.1426777130060; Thu, 19 Mar 2015 07:58:50 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.35.133 with SMTP id h5csp441568lbj; Thu, 19 Mar 2015 07:58:49 -0700 (PDT) X-Received: by 10.194.174.225 with SMTP id bv1mr15566864wjc.101.1426777123973; Thu, 19 Mar 2015 07:58:43 -0700 (PDT) Received: from mail-wg0-f49.google.com (mail-wg0-f49.google.com. [74.125.82.49]) by mx.google.com with ESMTPS id lg5si2589483wjb.181.2015.03.19.07.58.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Mar 2015 07:58:43 -0700 (PDT) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 74.125.82.49 as permitted sender) client-ip=74.125.82.49; Received: by wgbcc7 with SMTP id cc7so64737688wgb.0 for ; Thu, 19 Mar 2015 07:58:43 -0700 (PDT) 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> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: eric.auger@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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)