From patchwork Thu Apr 30 09:24:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 47778 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DC4D820553 for ; Thu, 30 Apr 2015 09:25:39 +0000 (UTC) Received: by wgtl5 with SMTP id l5sf13430992wgt.1 for ; Thu, 30 Apr 2015 02:25:39 -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:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=JrldrRyIyQ1n+3MRIFJVgZFmpYJq4LrXyxuZVFrKzkc=; b=BHJTJrOOwYNn1n5LWxQjbfX8DEuwli23kilsXda6WOp1Gbyp7lWu6v7rmtW+SvaJ0Z rZX6AbLaqTwDvvtkAnzypFdXCGx/9OM2BUQDH+4lN8LPjVsiSIapb+V9CWQie86TlEfQ c+L0NhgeqZ0tnz8GxidR0BFaQQh7v160wnLVWmYwKIC7goTygYS0Kbrn1uXLYZ8KBrHp UfGuBYOxREjOhZyuw/RwaIRxhZbcNY1DUgwBSbzHABYRJ61jlLcgAIgbjEakgn+g1Sr6 VqQe5VZU23znHMD4j5wLkwXPgZriKex+8RojF5TEmzb77ikeW3TuB8DUyXyBUKza933m PdfA== X-Gm-Message-State: ALoCoQk3NM1JiCFiKk1lbGVkgTUqgMtAfFSZh0IvXrhKAkv7U50WH/wCveGQCel8G75nQP5yypFA X-Received: by 10.180.10.136 with SMTP id i8mr1196910wib.7.1430385939238; Thu, 30 Apr 2015 02:25:39 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.229.129 with SMTP id sq1ls349164lac.4.gmail; Thu, 30 Apr 2015 02:25:39 -0700 (PDT) X-Received: by 10.152.29.6 with SMTP id f6mr2897115lah.85.1430385939110; Thu, 30 Apr 2015 02:25:39 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id n14si1330513laa.83.2015.04.30.02.25.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Apr 2015 02:25:39 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by laat2 with SMTP id t2so39578886laa.1 for ; Thu, 30 Apr 2015 02:25:39 -0700 (PDT) X-Received: by 10.112.204.6 with SMTP id ku6mr2924251lbc.73.1430385939016; Thu, 30 Apr 2015 02:25:39 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.67.65 with SMTP id l1csp2995409lbt; Thu, 30 Apr 2015 02:25:38 -0700 (PDT) X-Received: by 10.70.45.16 with SMTP id i16mr6496758pdm.51.1430385928497; Thu, 30 Apr 2015 02:25:28 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id nf2si2640288pbc.149.2015.04.30.02.25.27; Thu, 30 Apr 2015 02:25:28 -0700 (PDT) Received-SPF: none (google.com: stable-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751209AbbD3JZZ (ORCPT + 2 others); Thu, 30 Apr 2015 05:25:25 -0400 Received: from ip4-83-240-67-251.cust.nbox.cz ([83.240.67.251]:52946 "EHLO ip4-83-240-18-248.cust.nbox.cz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751271AbbD3JZO (ORCPT ); Thu, 30 Apr 2015 05:25:14 -0400 Received: from ku by ip4-83-240-18-248.cust.nbox.cz with local (Exim 4.85) (envelope-from ) id 1YnkiV-0005MD-T5; Thu, 30 Apr 2015 11:25:11 +0200 From: Jiri Slaby To: stable@vger.kernel.org Cc: Christoffer Dall , Shannon Zhao , Jiri Slaby Subject: [patch added to the 3.12 stable tree] KVM: ARM: Update comments for kvm_handle_wfi Date: Thu, 30 Apr 2015 11:24:13 +0200 Message-Id: <1430385911-20480-5-git-send-email-jslaby@suse.cz> X-Mailer: git-send-email 2.3.5 In-Reply-To: <1430385911-20480-1-git-send-email-jslaby@suse.cz> References: <1430385911-20480-1-git-send-email-jslaby@suse.cz> Sender: stable-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: stable@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: patch@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.45 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Christoffer Dall This patch has been added to the 3.12 stable tree. If you have any objections, please let us know. =============== commit 82ea046c95a3c3ddcfa058c8a270b9afb6e93700 upstream. Update comments to reflect what is really going on and add the TWE bit to the comments in kvm_arm.h. Also renames the function to kvm_handle_wfx like is done on arm64 for consistency and uber-correctness. Signed-off-by: Christoffer Dall Signed-off-by: Shannon Zhao Signed-off-by: Jiri Slaby --- arch/arm/include/asm/kvm_arm.h | 1 + arch/arm/kvm/handle_exit.c | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/arch/arm/include/asm/kvm_arm.h b/arch/arm/include/asm/kvm_arm.h index fe395b7b1ce2..1d3153c7eb41 100644 --- a/arch/arm/include/asm/kvm_arm.h +++ b/arch/arm/include/asm/kvm_arm.h @@ -57,6 +57,7 @@ * TSC: Trap SMC * TSW: Trap cache operations by set/way * TWI: Trap WFI + * TWE: Trap WFE * TIDCP: Trap L2CTLR/L2ECTLR * BSU_IS: Upgrade barriers to the inner shareable domain * FB: Force broadcast of all maintainance operations diff --git a/arch/arm/kvm/handle_exit.c b/arch/arm/kvm/handle_exit.c index c4c496f7619c..a92079011a83 100644 --- a/arch/arm/kvm/handle_exit.c +++ b/arch/arm/kvm/handle_exit.c @@ -73,15 +73,17 @@ static int handle_dabt_hyp(struct kvm_vcpu *vcpu, struct kvm_run *run) } /** - * kvm_handle_wfi - handle a wait-for-interrupts instruction executed by a guest + * kvm_handle_wfx - handle a WFI or WFE instructions trapped in guests * @vcpu: the vcpu pointer * @run: the kvm_run structure pointer * - * Simply sets the wait_for_interrupts flag on the vcpu structure, which will - * halt execution of world-switches and schedule other host processes until - * there is an incoming IRQ or FIQ to the VM. + * WFE: Yield the CPU and come back to this vcpu when the scheduler + * decides to. + * WFI: Simply call kvm_vcpu_block(), which will halt execution of + * world-switches and schedule other host processes until there is an + * incoming IRQ or FIQ to the VM. */ -static int kvm_handle_wfi(struct kvm_vcpu *vcpu, struct kvm_run *run) +static int kvm_handle_wfx(struct kvm_vcpu *vcpu, struct kvm_run *run) { trace_kvm_wfi(*vcpu_pc(vcpu)); if (kvm_vcpu_get_hsr(vcpu) & HSR_WFI_IS_WFE) @@ -93,7 +95,7 @@ static int kvm_handle_wfi(struct kvm_vcpu *vcpu, struct kvm_run *run) } static exit_handle_fn arm_exit_handlers[] = { - [HSR_EC_WFI] = kvm_handle_wfi, + [HSR_EC_WFI] = kvm_handle_wfx, [HSR_EC_CP15_32] = kvm_handle_cp15_32, [HSR_EC_CP15_64] = kvm_handle_cp15_64, [HSR_EC_CP14_MR] = kvm_handle_cp14_access,