From patchwork Mon Jul 17 14:27:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9845309 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 44DBF6037F for ; Mon, 17 Jul 2017 14:31:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3700327F89 for ; Mon, 17 Jul 2017 14:31:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B9AA2853A; Mon, 17 Jul 2017 14:31:30 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID 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 5B4382842E for ; Mon, 17 Jul 2017 14:31:28 +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=QnwhjaRYNfXAzC0YOShSYy0FHLLwn5Orf8UkISSSj0w=; b=TvwLwoHX5FNZFC01RUCSMhN0DZ Or2FCn18JO2BIsj0+6UQAPw6aMzQJ3xxYZfqE5Ninyy3iErNV6kIoq4dTgcifH4pvqq8waVoqgkg+ zB8ibsmuXohC2pdZ8TWfYI+nI2ek6N/kZ0D6unMXMJykQYRZxHBS1o/wIAoXkEdb2UrlYQCrlz4l1 N4sjSa+1oc0xiLHp6ojwtVavBsiG2wjRxP/hsHTIqal1LRJGXzmOtZXyk0w89klelllb4XXow5tz7 sh2jYu5mH+NAVLyiPAa8rJOVjUmwryr+BfZA/r0ZSDdMyO6DoYkBiX63hanNBnvo0jNs/QWvXx60S sW+QXWoQ==; 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 1dX73T-0005zo-93; Mon, 17 Jul 2017 14:31:23 +0000 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dX709-0001MS-IS for linux-arm-kernel@lists.infradead.org; Mon, 17 Jul 2017 14:28:08 +0000 Received: by mail-wm0-x236.google.com with SMTP id 70so22754986wmo.1 for ; Mon, 17 Jul 2017 07:27:38 -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=Hblv8SsyWJKtxs52jtN4Oiszawf0QH5ik6ADPQUy8RxUdYHHhs/5Uk8eDaol9rFNYn 8QEXiRd8DEEQnSaJBmffOIml5hQNwNgyXLd5mRX1yTkpCEqgr60RuR+8XdO/JJuXgGfj SvSF2e4TCD9iCvAtld1ZHQC1oqmJcybNjlhBo= 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=AIJ/P1r8oZQ1Bc2ONQS9F92uVXhFg9rBEQeCl9F0KC17+nHbyJyc2M4x2uwdCkLyJn dnkYNQ/pfkJxuV66kSxLSAOMBKpheCZx+tHjZW1CutAcbAZ9oPZXDuDklCJLZZDVYMj3 aK+uuj8Jbzlv4tDObdN70djsTB8qJvco+u2p0AhAPjnW/zwflV+MHpBoqf34FaWbjdYN g7UNJKVouzL1z9MiEFJbcwwT4jX1XvCO52rBY5qgga9Fq1s3SoXYmmhRDLeVzyxoPARk merkLOXsCuqyBmHSmg3wUgU8f+53EAC/lkZrAbEUO8NkY2Bo/Xd1PwzUoEF5rzFB1mFm b0kw== X-Gm-Message-State: AIVw110XkfxNY57vZ1YzmoyyD5LEApQZA0f8Q1+oXYobqyIR3Y1hDUnx UaZv9knM4gM+SsSs X-Received: by 10.80.170.74 with SMTP id p10mr17708315edc.33.1500301656732; Mon, 17 Jul 2017 07:27:36 -0700 (PDT) Received: from localhost.localdomain (xd93ddc2d.cust.hiper.dk. [217.61.220.45]) by smtp.gmail.com with ESMTPSA id b30sm9428952edd.6.2017.07.17.07.27.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Jul 2017 07:27:36 -0700 (PDT) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH v2 12/19] KVM: arm/arm64: Set VCPU affinity for virt timer irq Date: Mon, 17 Jul 2017 16:27:11 +0200 Message-Id: <20170717142718.13853-13-cdall@linaro.org> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170717142718.13853-1-cdall@linaro.org> References: <20170717142718.13853-1-cdall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170717_072758_504224_D8F03C26 X-CRM114-Status: GOOD ( 10.13 ) 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 , 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 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 --- 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; }