From patchwork Thu Oct 12 10:41:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 10001661 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 02A1360325 for ; Thu, 12 Oct 2017 10:54:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E975628CE6 for ; Thu, 12 Oct 2017 10:54:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DE55F28CEC; Thu, 12 Oct 2017 10:54:44 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham 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 5F51828CE6 for ; Thu, 12 Oct 2017 10:54:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=8PaAMYk5vv70ci/sOBo8d/S1IdqxaUKNtSaiWI9bcgA=; b=NBckvNdmJDusuEmx3g1osN0EPT 3iPKGERrYUfi1v5O7vS8i+hg7pte6SkDBulT31YxBEPGd8sO63NvMS3gfnnxgNZXl5PkU7lbZxhub mr1rLAfI8YFh51KBlnAhA/y6dxqRWISSZSazB34gSCEHB0dilUvIiq8JMvXId20hI4tpWGX9Crzd6 BG4at3bYEMwe/rppnpBUkFGJq9jzY/kOCTUkq9b2r1aq/gLXP/JIkZTqzNDb+Jzz9ATccTGZtK4Yg I3Ma9khaBnAmne3Gv8Fb6AMAcMFAAdUinlCxs60rt/7my3puSBN9bly5pc9OmB800tAVpaDtSd/De +VsrzYvg==; 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 1e2b8V-0003xm-Ix; Thu, 12 Oct 2017 10:54:43 +0000 Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e2awb-0007Xv-A2 for linux-arm-kernel@lists.infradead.org; Thu, 12 Oct 2017 10:42:39 +0000 Received: by mail-wm0-x233.google.com with SMTP id k4so12101324wmc.1 for ; Thu, 12 Oct 2017 03:42:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3BnvLnHet483I57bAqzNjq+Fij/p4EDz2QkbPHNLS4Y=; b=YIZErXjLyV24GnvwcXT007JtPZm7pNa5ud69N86Z7uqr1C1fvi8Pd3IRGHz+QMSi0U MT1nCtq0BB9MqEkxHSAmWOghPDWgbWGAamQvTeCohGwirUoG/tN+tALs18dfhfUW6jg5 BSjj8nH9hAiSKQ/aAhCqDjZMFhRPw4bgT/Tmw= 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=3BnvLnHet483I57bAqzNjq+Fij/p4EDz2QkbPHNLS4Y=; b=sbnpYUG7tOafAm6V0qn7rHgQaV3PprPJBfxRpxpZJq6GF2Dpv9kL2COELJrVLJgw2o r7IE6219KTQR32YxOFOHFW2FgP9o4xpZAndkprA+FSlRWvv1KOKMPhkt+coT/TGHp90A EBtDrk6M/SAtCruTtFJ08zEWXB2woJK8K5E/njb2xv4OGC5BFQ+YnJ+WkqptJMzXJJK4 8ZaPMLUiQ9NJaf26TuSux6kQEXNBqe203E76W3PDcnv3HDpRM2cA7B0YceRcLYCnueut bpmm+303J2Y8TZFZhmEvjxCkQPvBBcMuCzlxUFHvTSDbdB7jdR0jC9MJ/FZ7Lmz4sZ0W pOBQ== X-Gm-Message-State: AMCzsaVyWSgQge/9xxMoSBe/FQkDKWpD3sgLj6MOiZFDXttb9su644DB zYoYjbSNk4YDQ7Up7FBZR73IZw== X-Google-Smtp-Source: AOwi7QDZM9Hmv1pMEvUzBEqome/BZ8dJUKsIMflTpMnZiHYRuYWmHpiwbkS9bGER6QyRuTitZEOJgw== X-Received: by 10.80.137.212 with SMTP id h20mr2377714edh.295.1507804923525; Thu, 12 Oct 2017 03:42:03 -0700 (PDT) Received: from localhost.localdomain (xd93dd96b.cust.hiper.dk. [217.61.217.107]) by smtp.gmail.com with ESMTPSA id g49sm4798603edc.31.2017.10.12.03.42.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Oct 2017 03:42:02 -0700 (PDT) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [PATCH 16/37] KVM: arm64: Remove noop calls to timer save/restore from VHE switch Date: Thu, 12 Oct 2017 12:41:20 +0200 Message-Id: <20171012104141.26902-17-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20171012104141.26902-1-christoffer.dall@linaro.org> References: <20171012104141.26902-1-christoffer.dall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171012_034226_105835_FD0BEB2D X-CRM114-Status: GOOD ( 12.23 ) 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: Marc Zyngier , Christoffer Dall , Shih-Wei Li , kvm@vger.kernel.org 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 The VHE switch function calls __timer_enable_traps and __timer_disable_traps which don't do anything on VHE systems. Therefore, simply remove these calls from the VHE switch function and make the functions non-conditional as they are now only called from the non-VHE switch path. Signed-off-by: Christoffer Dall --- arch/arm64/kvm/hyp/switch.c | 2 -- virt/kvm/arm/hyp/timer-sr.c | 10 ++-------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/arch/arm64/kvm/hyp/switch.c b/arch/arm64/kvm/hyp/switch.c index 2cedf12..b98b73b 100644 --- a/arch/arm64/kvm/hyp/switch.c +++ b/arch/arm64/kvm/hyp/switch.c @@ -336,7 +336,6 @@ int kvm_vcpu_run(struct kvm_vcpu *vcpu) __activate_vm(vcpu); __vgic_restore_state(vcpu); - __timer_enable_traps(vcpu); /* * We must restore the 32-bit state before the sysregs, thanks @@ -356,7 +355,6 @@ int kvm_vcpu_run(struct kvm_vcpu *vcpu) __sysreg_save_guest_state(guest_ctxt); __sysreg32_save_state(vcpu); - __timer_disable_traps(vcpu); __vgic_save_state(vcpu); __deactivate_traps(vcpu); diff --git a/virt/kvm/arm/hyp/timer-sr.c b/virt/kvm/arm/hyp/timer-sr.c index f398616..82c217e 100644 --- a/virt/kvm/arm/hyp/timer-sr.c +++ b/virt/kvm/arm/hyp/timer-sr.c @@ -53,16 +53,10 @@ void __hyp_text disable_el1_phys_timer_access(void) void __hyp_text __timer_disable_traps(struct kvm_vcpu *vcpu) { - /* - * We don't need to do this for VHE since the host kernel runs in EL2 - * with HCR_EL2.TGE ==1, which makes those bits have no impact. - */ - if (!has_vhe()) - enable_el1_phys_timer_access(); + enable_el1_phys_timer_access(); } void __hyp_text __timer_enable_traps(struct kvm_vcpu *vcpu) { - if (!has_vhe()) - disable_el1_phys_timer_access(); + disable_el1_phys_timer_access(); }