From patchwork Wed Jan 31 09:35:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 10193741 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 8C506603EE for ; Wed, 31 Jan 2018 09:43:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 72A1F28606 for ; Wed, 31 Jan 2018 09:43:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 66E9F28609; Wed, 31 Jan 2018 09:43:39 +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 E942628606 for ; Wed, 31 Jan 2018 09:43:38 +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=5pj9JiCogy5fqKGFdpDQbLQLbjJNy7xBPyIFl60CV7w=; b=t96UGrIIlNLlR0e78Wkbu2c/BB GDaSodHlJfnJEB32grV7gFxtqJlV/hR5WcuFIlEQg+q3xj7wwBS9hdJ/SxxR7lNcQC8pOO66GpBcJ 6EDI1zGJkb3RIEZRFw0SMi/hDTzSKar3ePVte2yFcxQYaZiOnueRVZ/sdtsfiRsTJxCKyUonG+CGW m+CUZSS/yo1j6IZXuEGxCgPmpv+EJdYVvjtrDjiJi8rZvcPOiIUNyf+oUBBgp7z052/+msG95q4Tf PSggMziBXnj9dpSBU5R8ZjnxbPPiAaKT71tXoy9i4B9oyWs1QrAxnwlRISBQQeVHOhY5IhISRl4Ab +QLTFtvg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1egovX-0005IW-Pm; Wed, 31 Jan 2018 09:43:35 +0000 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1egoo6-0005v8-KR for linux-arm-kernel@lists.infradead.org; Wed, 31 Jan 2018 09:36:04 +0000 Received: by mail-wm0-x241.google.com with SMTP id f71so6721763wmf.0 for ; Wed, 31 Jan 2018 01:35:54 -0800 (PST) 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=DwAszTehtrUbwU5lPqdoDg6Kv9w31M9/4mAbHMnmpBw=; b=GkfpR/v9WQ5grvZEd/fGApfK1GJr1VRKK1T1ANQGycyfVOJnR2y+h5ynK+NhSJJKNF O4LHFF/N0091AVJPAVMe9z+c5GaargmiaJj16ukXkCIf0vnMgmT34NaLee2VuUfF0N0R yVpHvGHw5lDc2kwkx31/10e1kwrzfUoNg3Tmo= 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=DwAszTehtrUbwU5lPqdoDg6Kv9w31M9/4mAbHMnmpBw=; b=r7kl4MM/cBd2Ppy1lEm/zUMwr3r4447oOOWncVYD81CicHNOdkofgGFIkREE2yOJJ1 +bzzHF34zqdSUpkx2v7arboxnP1m2pHKkUN4Y8j+tNt8ANqKzkKRnB550sbxm4E9stwy JQ35lXoH3wJqs/Ap+Hug8yeQh3kiLVxypURGQBxpVfXLo5if4e7bxVuWS+vWfGqPbJNJ 4ot5miwBn5GmoH0725erwVLDq9sQ/aI5PK7VRWEMLpWZPPUUY49dLYjYNezSORH+qrd3 NtbREgSrA3UInLe/dgvtuWydcjMN4fWxXL4HtwdqWjUD8YKSY+Nf7saJ6mGx5T4Ym3ao 1MJg== X-Gm-Message-State: AKwxytfSmqybJNaUSYns4CmKMCLMc4qAnCEVG8lHdmdDiLunAfVqxycO 4Ja/7TB6kNThzUm8x0rkWfDMVe80wic= X-Google-Smtp-Source: AH8x224MYnbcwgOyUwVNUJdQTOwV88QXg+mDV7J1sumT0KpXL+tDNZ5DEDq1MWia8XscgkIV2MvWRg== X-Received: by 10.80.150.33 with SMTP id y30mr34588765eda.114.1517391352895; Wed, 31 Jan 2018 01:35:52 -0800 (PST) Received: from localhost.localdomain (x50d2404e.cust.hiper.dk. [80.210.64.78]) by smtp.gmail.com with ESMTPSA id z2sm10247837edc.50.2018.01.31.01.35.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 31 Jan 2018 01:35:52 -0800 (PST) From: Christoffer Dall To: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Subject: [PULL 28/28] KVM: arm/arm64: Fixup userspace irqchip static key optimization Date: Wed, 31 Jan 2018 10:35:07 +0100 Message-Id: <20180131093507.22219-29-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180131093507.22219-1-christoffer.dall@linaro.org> References: <20180131093507.22219-1-christoffer.dall@linaro.org> 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 , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, 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 When I introduced a static key to avoid work in the critical path for userspace irqchips which is very rarely used, I accidentally messed up my logic and used && where I should have used ||, because the point was to short-circuit the evaluation in case userspace irqchips weren't even in use. This fixes an issue when running in-kernel irqchip VMs alongside userspace irqchip VMs. Acked-by: Marc Zyngier Fixes: c44c232ee2d3 ("KVM: arm/arm64: Avoid work when userspace iqchips are not used") Signed-off-by: Christoffer Dall --- virt/kvm/arm/arch_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c index 63cf828f3c4f..fb6bd9b9845e 100644 --- a/virt/kvm/arm/arch_timer.c +++ b/virt/kvm/arm/arch_timer.c @@ -286,7 +286,7 @@ static void kvm_timer_update_irq(struct kvm_vcpu *vcpu, bool new_level, trace_kvm_timer_update_irq(vcpu->vcpu_id, timer_ctx->irq.irq, timer_ctx->irq.level); - if (!static_branch_unlikely(&userspace_irqchip_in_use) && + if (!static_branch_unlikely(&userspace_irqchip_in_use) || likely(irqchip_in_kernel(vcpu->kvm))) { ret = kvm_vgic_inject_irq(vcpu->kvm, vcpu->vcpu_id, timer_ctx->irq.irq,