From patchwork Wed Feb 1 17:43:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jintack Lim X-Patchwork-Id: 9550401 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 0CE9960425 for ; Wed, 1 Feb 2017 17:44:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F31EE2808C for ; Wed, 1 Feb 2017 17:44:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E80DE2845D; Wed, 1 Feb 2017 17:44:16 +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=-1.4 required=2.0 tests=BAYES_00, RCVD_IN_SORBS_SPAM autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B72BA2808C for ; Wed, 1 Feb 2017 17:44:16 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cYyx6-0004l5-4F; Wed, 01 Feb 2017 17:44:16 +0000 Received: from outprodmail01.cc.columbia.edu ([128.59.72.39]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cYywW-0003wF-MJ for linux-arm-kernel@lists.infradead.org; Wed, 01 Feb 2017 17:43:43 +0000 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 v11He8aC030681 for ; Wed, 1 Feb 2017 12:43:21 -0500 Received: from hazelnut (localhost.localdomain [127.0.0.1]) by hazelnut (Postfix) with ESMTP id 7B42B83 for ; Wed, 1 Feb 2017 12:43:21 -0500 (EST) Received: from sendprodmail01.cc.columbia.edu (sendprodmail01.cc.columbia.edu [128.59.72.13]) by hazelnut (Postfix) with ESMTP id 4BBC88A for ; Wed, 1 Feb 2017 12:43:21 -0500 (EST) Received: from mail-qt0-f200.google.com (mail-qt0-f200.google.com [209.85.216.200]) by sendprodmail01.cc.columbia.edu (8.14.4/8.14.4) with ESMTP id v11HhLBv048163 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 1 Feb 2017 12:43:21 -0500 Received: by mail-qt0-f200.google.com with SMTP id c25so153960084qtg.2 for ; Wed, 01 Feb 2017 09:43:21 -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=jtdUwP3ygZChCr5VXLWDZLYkr7VA59VzojAQ4EJhQns=; b=CSQOuiWX8GOWoeUd0mF7Lc0yTPxKDZdqS31YoyV2Cr7YJm+8Z1UM8pHD8TPDrAxc3i 0cugRcJtNWZQjGQPo3tCzyWelMLaWSnJOoQ+VKreqExU4tj7HzjfvtHpqAXc66eK5C3Z RmWoMMriUGmyuJCcfG7NUauavyfz0L2XR4sRC5Dvh3zikXubo44Lklm2UmOy4kMbsLgq GMT2IJAgT2XzYYehZzQjoYsMeQclOdLPGr4mue7rOtWIcGk9YDki1DJhFN1mqBGEL7ya oTcF2JyMOf7GeFy5/5iftqFNXrd9gDCCW0OKPd6QJ7QjXTeuCcoWwH1FKg09WDu+iLuh Swtg== X-Gm-Message-State: AIkVDXJhiBYy/sARftI94UBk5ahutjn/eP2rls2Xh/5nn1hx2n5nCOPq9wZNVnJvQdsdP6BYGSvbJepf3BjOGa1hKFzba2GM6x2IC5r2CsYOChhDhk6eAIPWmBToSwp2RMYSGJRju20xXmmFLknY+pCsffQxWKtbWBUInw== X-Received: by 10.237.35.83 with SMTP id i19mr4234030qtc.7.1485971000773; Wed, 01 Feb 2017 09:43:20 -0800 (PST) X-Received: by 10.237.35.83 with SMTP id i19mr4234010qtc.7.1485971000546; Wed, 01 Feb 2017 09:43:20 -0800 (PST) Received: from jintack.cs.columbia.edu ([2001:18d8:ffff:16:21a:4aff:feaa:f900]) by smtp.gmail.com with ESMTPSA id b16sm19149046qka.9.2017.02.01.09.43.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Feb 2017 09:43:19 -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 Subject: [RFC v3 06/10] KVM: arm/arm64: Update the physical timer interrupt level Date: Wed, 1 Feb 2017 12:43:06 -0500 Message-Id: <1485970990-13775-7-git-send-email-jintack@cs.columbia.edu> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1485970990-13775-1-git-send-email-jintack@cs.columbia.edu> References: <1485970990-13775-1-git-send-email-jintack@cs.columbia.edu> X-No-Spam-Score: Local X-Scanned-By: MIMEDefang 2.78 on 128.59.72.13 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170201_094341_280905_1B4A2DC5 X-CRM114-Status: GOOD ( 10.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jintack@cs.columbia.edu MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 ae38703..1b086fd6 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; }