From patchwork Sat Sep 23 00:42:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9967311 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 850C3602CB for ; Sat, 23 Sep 2017 00:42:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 77FD7299C9 for ; Sat, 23 Sep 2017 00:42:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D213299CD; Sat, 23 Sep 2017 00:42: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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, 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 28998299C9 for ; Sat, 23 Sep 2017 00:42:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752659AbdIWAmd (ORCPT ); Fri, 22 Sep 2017 20:42:33 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:49180 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752503AbdIWAmY (ORCPT ); Fri, 22 Sep 2017 20:42:24 -0400 Received: by mail-wm0-f54.google.com with SMTP id r74so7646200wme.4 for ; Fri, 22 Sep 2017 17:42:24 -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=ui/kWg95mNYBlicnRBiSJiQZzFsIskwu7ZG1hpGA2qU=; b=Dgq9CYWGtzZao7opaVxq22ETnOI8QLF/wTdtum57NdeEo3v6niiIlyv50LTq2Z3diL 1uLHwMeCNk9fyHwjpKy7KfXiqkWr1wOx+Nksdxzl3WLzVEHIztf0eGf8LI8Ww90pJ949 Z2P9nRMnfHKQnu/3gFCVxBqCQhCrd0mr0qAvQ= 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=ui/kWg95mNYBlicnRBiSJiQZzFsIskwu7ZG1hpGA2qU=; b=qTteD0+uixpXR2Mncj4DRsnzKdaZ+ZoN2pTKXfLVsbCFcfPfFMD1y6e/U/TG8HfTMN SaFsjJT0JXurrxc4KcsDw2brehk0FI4VR5bk/xuqrmKnJJwSho9sBclF/XnT4jQp/vV/ gcbVOHr5uvWrW0+NyRblAH1mqZQUwpaDVvmIiJ9h//ebGjpyGHBWHhT9dqn5Rg4hVBZh nQCla+Kl7al9Lpj2wjE9DweJymUENuLBnlYvxTsRGYuXcZSPnwgzY7qjgo90EuDZlFq3 0YZtj+3eSsmSOmt183sgDGSkAZxkJ4IKv/6N1ucdyAMMJkyjaNMQZ3PovaHWHiR71ezy eGvg== X-Gm-Message-State: AHPjjUiGd5v0GOBaHxhEcLENOXgFmAeihdEU2aRi+iLuzHpZt+NtvlcD DpkcnkAMUJLgxnoiIWMYTTIPjw== X-Google-Smtp-Source: AOwi7QBVk0uTa9D2wmbCzu0QX0wCcWvAKsMWXpQt/455DZ+oMBBIhzQFpIqiXtXfcjnZUiKSQGHVtw== X-Received: by 10.80.212.150 with SMTP id s22mr6618775edi.286.1506127343444; Fri, 22 Sep 2017 17:42:23 -0700 (PDT) Received: from localhost.localdomain (xd93dd96b.cust.hiper.dk. [217.61.217.107]) by smtp.gmail.com with ESMTPSA id c25sm646085edb.57.2017.09.22.17.42.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Sep 2017 17:42:22 -0700 (PDT) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Cc: kvm@vger.kernel.org, Marc Zyngier , Will Deacon , Catalin Marinas , Christoffer Dall Subject: [PATCH v3 13/20] KVM: arm/arm64: Set VCPU affinity for virt timer irq Date: Sat, 23 Sep 2017 02:42:00 +0200 Message-Id: <20170923004207.22356-14-cdall@linaro.org> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170923004207.22356-1-cdall@linaro.org> References: <20170923004207.22356-1-cdall@linaro.org> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP As we are about to take physical interrupts for the virtual timer on the host but want to leave those active while running the VM (and let the VM deactivate them), we need to set the vtimer PPI affinity accordingly. Signed-off-by: Christoffer Dall Reviewed-by: Marc Zyngier --- virt/kvm/arm/arch_timer.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c index 4254f88..4275f8f 100644 --- a/virt/kvm/arm/arch_timer.c +++ b/virt/kvm/arm/arch_timer.c @@ -650,11 +650,20 @@ int kvm_timer_hyp_init(void) return err; } + err = irq_set_vcpu_affinity(host_vtimer_irq, kvm_get_running_vcpus()); + if (err) { + kvm_err("kvm_arch_timer: error setting vcpu affinity\n"); + goto out_free_irq; + } + kvm_info("virtual timer IRQ%d\n", host_vtimer_irq); cpuhp_setup_state(CPUHP_AP_KVM_ARM_TIMER_STARTING, "kvm/arm/timer:starting", kvm_timer_starting_cpu, kvm_timer_dying_cpu); + return 0; +out_free_irq: + free_percpu_irq(host_vtimer_irq, kvm_get_running_vcpus()); return err; }