From patchwork Fri Feb 3 15:20:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jintack Lim X-Patchwork-Id: 9554341 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9F9F16051F for ; Fri, 3 Feb 2017 15:20:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 96F99283FC for ; Fri, 3 Feb 2017 15:20:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8B8E1284EF; Fri, 3 Feb 2017 15:20:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E7BE284EE for ; Fri, 3 Feb 2017 15:20:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751519AbdBCPU3 (ORCPT ); Fri, 3 Feb 2017 10:20:29 -0500 Received: from outprodmail01.cc.columbia.edu ([128.59.72.39]:37878 "EHLO outprodmail01.cc.columbia.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751504AbdBCPU2 (ORCPT ); Fri, 3 Feb 2017 10:20:28 -0500 Received: from hazelnut (hazelnut.cc.columbia.edu [128.59.213.250]) by outprodmail01.cc.columbia.edu (8.14.4/8.14.4) with ESMTP id v13FHkKt050777 for ; Fri, 3 Feb 2017 10:20:17 -0500 Received: from hazelnut (localhost.localdomain [127.0.0.1]) by hazelnut (Postfix) with ESMTP id 5C07283 for ; Fri, 3 Feb 2017 10:20:17 -0500 (EST) Received: from sendprodmail03.cc.columbia.edu (sendprodmail03.cc.columbia.edu [128.59.72.15]) by hazelnut (Postfix) with ESMTP id 43FC389 for ; Fri, 3 Feb 2017 10:20:17 -0500 (EST) Received: from mail-qt0-f199.google.com (mail-qt0-f199.google.com [209.85.216.199]) by sendprodmail03.cc.columbia.edu (8.14.4/8.14.4) with ESMTP id v13FKHus046720 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 3 Feb 2017 10:20:17 -0500 Received: by mail-qt0-f199.google.com with SMTP id k15so30772862qtg.5 for ; Fri, 03 Feb 2017 07:20:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=g67ptjCyARN1y37JHNNVQcwymmNXg1U7REvHDut4jWM=; b=uVAeHSTHx7XBsMw7zPhN1oNn5/tax+D/jpxdPLkDmxGzn35YCo8pi1TenWWr66R9V3 Yoaf6uEnBr7RGUwen//gXG1/okvCF/Eg2r6vchNHl69oebQktrih7NLuIPUouyYTjJRC 1dUYw+A0tC5gSXMHtZgbf/ZT5pYxk4fGAqVunVo7ch69WWmO0EnX3Gomg+RtjcCWYenf AfQfcHbm8aVagIfu8EuCTuteaZgchQeTgejzsu0isIb2ryS1Tg2UF4qa9yXUJTeRz/q/ rwJj5jurLf36wSiTCTiXW4Acn2O8glJs2iJf87IGGwJSgenU9z4xIy6wfY+fSPge1rX7 1N2A== X-Gm-Message-State: AIkVDXJAVio3zIjp39NPymP1pDy8z4VuMJpaNbnGVwUrML1+/rgkfpMd0EyUCacg9Mw1au85Z+Gb0ZLUdV1p+SjgM4XTUe2/u23R7DRhKmOIrOrhVaYHRpEhK97N5Cm52eq2cW3m13SrhMg= X-Received: by 10.55.26.159 with SMTP id l31mr14123529qkh.164.1486135216815; Fri, 03 Feb 2017 07:20:16 -0800 (PST) X-Received: by 10.55.26.159 with SMTP id l31mr14123495qkh.164.1486135216586; Fri, 03 Feb 2017 07:20:16 -0800 (PST) Received: from jintack.cs.columbia.edu ([2001:18d8:ffff:16:21a:4aff:feaa:f900]) by smtp.gmail.com with ESMTPSA id t35sm24462204qtc.40.2017.02.03.07.20.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 03 Feb 2017 07:20:16 -0800 (PST) From: Jintack Lim To: pbonzini@redhat.com, rkrcmar@redhat.com, christoffer.dall@linaro.org, marc.zyngier@arm.com, linux@armlinux.org.uk, catalin.marinas@arm.com, will.deacon@arm.com, andre.przywara@arm.com, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org Cc: jintack@cs.columbia.edu Subject: [RFC v4 06/10] KVM: arm/arm64: Update the physical timer interrupt level Date: Fri, 3 Feb 2017 10:20:04 -0500 Message-Id: <1486135208-13415-7-git-send-email-jintack@cs.columbia.edu> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1486135208-13415-1-git-send-email-jintack@cs.columbia.edu> References: <1486135208-13415-1-git-send-email-jintack@cs.columbia.edu> X-No-Spam-Score: Local X-Scanned-By: MIMEDefang 2.78 on 128.59.72.15 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Now that we maintain the EL1 physical timer register states of VMs, update the physical timer interrupt level along with the virtual one. Signed-off-by: Jintack Lim Acked-by: Christoffer Dall --- virt/kvm/arm/arch_timer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c index dbd0af1..7f9a664 100644 --- a/virt/kvm/arm/arch_timer.c +++ b/virt/kvm/arm/arch_timer.c @@ -186,6 +186,7 @@ static int kvm_timer_update_state(struct kvm_vcpu *vcpu) { struct arch_timer_cpu *timer = &vcpu->arch.timer_cpu; struct arch_timer_context *vtimer = vcpu_vtimer(vcpu); + struct arch_timer_context *ptimer = vcpu_ptimer(vcpu); /* * If userspace modified the timer registers via SET_ONE_REG before @@ -199,6 +200,9 @@ static int kvm_timer_update_state(struct kvm_vcpu *vcpu) if (kvm_timer_should_fire(vtimer) != vtimer->irq.level) kvm_timer_update_irq(vcpu, !vtimer->irq.level, vtimer); + if (kvm_timer_should_fire(ptimer) != ptimer->irq.level) + kvm_timer_update_irq(vcpu, !ptimer->irq.level, ptimer); + return 0; }