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: Auger Eric X-Patchwork-Id: 44566 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1F35321527 for ; Wed, 11 Feb 2015 08:35:42 +0000 (UTC) Received: by mail-wi0-f197.google.com with SMTP id n3sf1753022wiv.0 for ; Wed, 11 Feb 2015 00:35:41 -0800 (PST) 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=ay/thstedXfxJopGbX98u4uRorv5t4+V1EKh4stoX1k=; b=JllMoDfhgv+Tb6cv8tzslqSPAWi/Uslt5e4jmNRODYoKq00maYccdKhvWgVQqITEai 67+DCyNo4uBvOpBPEulaVijP6s74DrL1POO3otvu9kWKi2a9CMEypyysC9W+EvF0mfUN sxFSlR3ZbguP3IS1ZpgFWrjZ0tnP4a59BaL5ENpNuxvKZhW95YIA3j8EaN+z7mqrVzdg 5wTW1463LJyfKpuaDOUqo2/pv38ljXujDxj5jwtqokp4/e7ZmcnG8zZ+tTxoorLmLvab qmSKx/ZzRYp79y34F5FdHZNV+mTz6h1Xq8Y/gTLgKmuIUO5HJexD9NmBYg9OgYEKqqL7 5Q0Q== X-Gm-Message-State: ALoCoQmC+RfTP4+pbilhEZPU7mBa8pAglpIsOeFlbnT70Z02Vl8ia3JvS+wfddl4LPP4frd7geIr X-Received: by 10.112.131.106 with SMTP id ol10mr3321390lbb.20.1423643741418; Wed, 11 Feb 2015 00:35:41 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.71 with SMTP id k7ls34099laf.9.gmail; Wed, 11 Feb 2015 00:35:41 -0800 (PST) X-Received: by 10.152.30.66 with SMTP id q2mr26526775lah.107.1423643741290; Wed, 11 Feb 2015 00:35:41 -0800 (PST) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id po1si61721lbb.87.2015.02.11.00.35.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Feb 2015 00:35:41 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by labpn19 with SMTP id pn19so1870759lab.4 for ; Wed, 11 Feb 2015 00:35:41 -0800 (PST) X-Received: by 10.112.85.68 with SMTP id f4mr26915314lbz.106.1423643741178; Wed, 11 Feb 2015 00:35:41 -0800 (PST) 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 h5csp1110373lbj; Wed, 11 Feb 2015 00:35:40 -0800 (PST) X-Received: by 10.107.12.13 with SMTP id w13mr13622019ioi.28.1423643739842; Wed, 11 Feb 2015 00:35:39 -0800 (PST) Received: from mail-ig0-f179.google.com (mail-ig0-f179.google.com. [209.85.213.179]) by mx.google.com with ESMTPS id av2si11117534igc.40.2015.02.11.00.35.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Feb 2015 00:35:39 -0800 (PST) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 209.85.213.179 as permitted sender) client-ip=209.85.213.179; Received: by mail-ig0-f179.google.com with SMTP id l13so2987152iga.0 for ; Wed, 11 Feb 2015 00:35:39 -0800 (PST) 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 Cc: andre.przywara@arm.com, patches@linaro.org, a.motakis@virtualopensystems.com, a.rigo@virtualopensystems.com, b.reynal@virtualopensystems.com, gleb@kernel.org, pbonzini@redhat.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-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.215.50 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 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)