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: 9550393 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 0A91960425 for ; Wed, 1 Feb 2017 17:44:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F1B842040D for ; Wed, 1 Feb 2017 17:44:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E5F222842E; Wed, 1 Feb 2017 17:44:09 +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=unavailable 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 953572040D for ; Wed, 1 Feb 2017 17:44:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753983AbdBARnt (ORCPT ); Wed, 1 Feb 2017 12:43:49 -0500 Received: from outprodmail02.cc.columbia.edu ([128.59.72.51]:55369 "EHLO outprodmail02.cc.columbia.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753725AbdBARnc (ORCPT ); Wed, 1 Feb 2017 12:43:32 -0500 Received: from hazelnut (hazelnut.cc.columbia.edu [128.59.213.250]) by outprodmail02.cc.columbia.edu (8.14.4/8.14.4) with ESMTP id v11He8HB001155 for ; Wed, 1 Feb 2017 12:43:21 -0500 Received: from hazelnut (localhost.localdomain [127.0.0.1]) by hazelnut (Postfix) with ESMTP id AFE9D81 for ; Wed, 1 Feb 2017 12:43:21 -0500 (EST) Received: from sendprodmail04.cc.columbia.edu (sendprodmail04.cc.columbia.edu [128.59.72.16]) by hazelnut (Postfix) with ESMTP id 9844183 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 sendprodmail04.cc.columbia.edu (8.14.4/8.14.4) with ESMTP id v11HhLFT018424 (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 h53so201388233qth.6 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=N8BOSUeUw2ZU/fzOtm7C/IJ72+z3+yL9QB9WBa9HAsEtzOOuYMZe2/PH91eEsffWSD zUAm3pUKg/xDg0bPNPFCCB/T1Jf9gwkCg5ti17NU8hEPUkumDIiMG27SKIOyaWxXKZY/ ckFtWj0Bwke73GV2TKyotHJNwemg2C+mM1kxD2gtzUlYVFodloYEnaoOuGBuZY0Eh3mS 6evZ/OK21QQEvVO4LaQW0CRCoG0MvmlwfDbJdfVoaSzppgL9icLqyN+Kr+noL8059el1 zFZiPF/0hh5fHzLo7IDGLLpxVN+TQ1myKOu5cbZr/6QA+XRNoY9KRvT/Cpw4q0IhmLaJ XldQ== X-Gm-Message-State: AIkVDXLmH1h9jKBO9dWf5WHIGnEbg+Pxj6NFnHSKE8mhATyV5MaIz7XFxaIXw9JfK0RWTHYFUwNE9JsXDTZsz2IdoXYFRe4GpT0wUFhtjK15MvkZzdKFwbBmNLGB+jnOTtxLL4HWODTOWo0= X-Received: by 10.237.35.83 with SMTP id i19mr4234038qtc.7.1485971000785; 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 Cc: jintack@cs.columbia.edu 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.16 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 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; }