From patchwork Sat Sep 28 06:21:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 20681 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f199.google.com (mail-vc0-f199.google.com [209.85.220.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4583524687 for ; Sat, 28 Sep 2013 06:21:44 +0000 (UTC) Received: by mail-vc0-f199.google.com with SMTP id lf12sf3247485vcb.6 for ; Fri, 27 Sep 2013 23:21:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=cfjGrRmLV14uPFFKAqWThLmp/Zyc8t1PdX8ubVH0AuM=; b=JK3ruO9/9H5/kUCyBghwcH9mc1TCpsT5ZBXS6PdH9w3w4HBnuAh82yxSWs359ggsJv UWwkVMqQ7tQHmPsXZO0iUXEaM/IuZkzeCUT7pP9a+qc4XC4liKJKmioZuT9SPxQLIgUG rLlcelEB4+t85XgJBfd8kdHKT77gNiqZZIonI/35Hld3zI/zYJjsKc5dlBdOLlxPcGsY LcPpX56u3F1XR10bS8/S+Te8UmnCHxdp/oL3F328Gqye9m8dy1Q7s1ZfSTGnhxiU4yRk xSiqRvk20cWAYtiylq98dDpZ1E4kobKaVUTjDln+W+tcuUYDvEDrrPER77G8g4HDc+4E yEpQ== X-Received: by 10.236.4.69 with SMTP id 45mr1895351yhi.20.1380349303552; Fri, 27 Sep 2013 23:21:43 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.97.66 with SMTP id dy2ls1584398qeb.85.gmail; Fri, 27 Sep 2013 23:21:43 -0700 (PDT) X-Received: by 10.52.187.138 with SMTP id fs10mr8329291vdc.10.1380349303376; Fri, 27 Sep 2013 23:21:43 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id gq10si2900830vdc.108.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 27 Sep 2013 23:21:43 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id gd11so2452995vcb.5 for ; Fri, 27 Sep 2013 23:21:13 -0700 (PDT) X-Gm-Message-State: ALoCoQn2aC2xSR2K4+45uzGKcDye6x62PCHegQOs5XH1K/VCLVjjjO7S18YPjgoA5YY1iSgKPzmz X-Received: by 10.220.186.202 with SMTP id ct10mr4437960vcb.14.1380349273223; Fri, 27 Sep 2013 23:21:13 -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.220.174.196 with SMTP id u4csp469156vcz; Fri, 27 Sep 2013 23:21:12 -0700 (PDT) X-Received: by 10.66.121.201 with SMTP id lm9mr15745583pab.80.1380349272001; Fri, 27 Sep 2013 23:21:12 -0700 (PDT) Received: from mail-pb0-f47.google.com (mail-pb0-f47.google.com [209.85.160.47]) by mx.google.com with ESMTPS id dj4si9503311pbc.74.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 27 Sep 2013 23:21:11 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.47 is neither permitted nor denied by best guess record for domain of christoffer.dall@linaro.org) client-ip=209.85.160.47; Received: by mail-pb0-f47.google.com with SMTP id rr4so3412002pbb.34 for ; Fri, 27 Sep 2013 23:21:10 -0700 (PDT) X-Received: by 10.66.102.100 with SMTP id fn4mr15840593pab.71.1380349270824; Fri, 27 Sep 2013 23:21:10 -0700 (PDT) Received: from localhost.localdomain (c-67-169-181-221.hsd1.ca.comcast.net. [67.169.181.221]) by mx.google.com with ESMTPSA id im2sm12847273pbd.31.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 27 Sep 2013 23:21:10 -0700 (PDT) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu Cc: Marc Zyngier , Andre Przywara , linaro-kernel@lists.linaro.org, patches@linaro.org, Christoffer Dall Subject: [PATCH] KVM: ARM: arch_timer: Add comment about timer mask Date: Fri, 27 Sep 2013 23:21:17 -0700 Message-Id: <1380349277-3483-1-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: christoffer.dall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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: , It is quite subtle why we mask the timer on behalf of the guest when then guest has programmed the timer and it fires and is handled on the host. Add a comment to that effect. Signed-off-by: Christoffer Dall --- virt/kvm/arm/arch_timer.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c index c2e1ef4..8168437 100644 --- a/virt/kvm/arm/arch_timer.c +++ b/virt/kvm/arm/arch_timer.c @@ -63,6 +63,12 @@ static void kvm_timer_inject_irq(struct kvm_vcpu *vcpu) { struct arch_timer_cpu *timer = &vcpu->arch.timer_cpu; + /* + * Mask the virtual timer, because otherwise, the guest would never + * execute its interrupt handler because the virtual timer interrupt + * would continously preempt guest execution as the hardware interrupt + * traps to Hyp mode. + */ timer->cntv_ctl |= ARCH_TIMER_CTRL_IT_MASK; kvm_vgic_inject_irq(vcpu->kvm, vcpu->vcpu_id, timer->irq->irq,