From patchwork Mon Apr 13 12:29:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Auger X-Patchwork-Id: 6208851 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DB7E19F1AC for ; Mon, 13 Apr 2015 12:44:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2475C202F8 for ; Mon, 13 Apr 2015 12:44:01 +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 34A30202D1 for ; Mon, 13 Apr 2015 12:44:00 +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 1Yhdf5-0006Ou-Lr; Mon, 13 Apr 2015 12:40:23 +0000 Received: from mail-wi0-f172.google.com ([209.85.212.172]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YhdYB-0007FF-SN for linux-arm-kernel@lists.infradead.org; Mon, 13 Apr 2015 12:33:16 +0000 Received: by wizk4 with SMTP id k4so70373173wiz.1 for ; Mon, 13 Apr 2015 05:32:56 -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=Es6s+gVcEy+gdqdV+7BmNH7vBa/JBqFI2ll3Ka1LQsJJr4XwH5alRt1uYh678/s7iG ykeGQ6zpwgluQ+i7JCUd7dD0p97OPKrqoHJ3btq4ZHGh6+NCiqxndMT0eZ1nSxuNuQi3 3mjUy25/DVCRSRIPcms5rwWlE6CISpYI073cMJU0jQQccIYNeN5jLTrSg04YrtoXhRvp 77JzvYbWoE30ky1PMC9KRzLqym9nX7rlJZZESrX/FpGM91o0KF2pYKdDhZRrwkaN4F5r VHdM9v17Kc0VDW23WRHKBE5S4Bglc87Q2cV4ZyzJucEQ73/fAJtshKLyUrHb5UDVx749 h4LA== X-Gm-Message-State: ALoCoQmjkxQPPEkZF0Rs86nJG8ojowdr4wCUDjbtUofxPs3irQjDaOqnN6T91YiczRCQJyCa/PwZ X-Received: by 10.194.5.74 with SMTP id q10mr27466436wjq.27.1428928376036; Mon, 13 Apr 2015 05:32:56 -0700 (PDT) Received: from gnx2579.gnb.st.com (LCaen-156-56-7-90.w80-11.abo.wanadoo.fr. [80.11.198.90]) by mx.google.com with ESMTPSA id fl14sm2879910wjc.11.2015.04.13.05.32.53 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 13 Apr 2015 05:32:54 -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, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, alex.williamson@redhat.com, pbonzini@redhat.com Subject: [RFC v6 13/16] kvm: introduce kvm_arch_halt_guest and kvm_arch_resume_guest Date: Mon, 13 Apr 2015 14:29:28 +0200 Message-Id: <1428928171-18884-14-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1428928171-18884-1-git-send-email-eric.auger@linaro.org> References: <1428928171-18884-1-git-send-email-eric.auger@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150413_053316_070882_56E27E7A X-CRM114-Status: UNSURE ( 7.89 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: b.reynal@virtualopensystems.com, feng.wu@intel.com, linux-kernel@vger.kernel.org, patches@linaro.org 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)