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: 9845281 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 6CF3360386 for ; Mon, 17 Jul 2017 14:28:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F1E32851D for ; Mon, 17 Jul 2017 14:28:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4AF1F28520; Mon, 17 Jul 2017 14:28:16 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI 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 F38802851D for ; Mon, 17 Jul 2017 14:28:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751414AbdGQO2L (ORCPT ); Mon, 17 Jul 2017 10:28:11 -0400 Received: from mail-wm0-f47.google.com ([74.125.82.47]:33652 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751491AbdGQO1i (ORCPT ); Mon, 17 Jul 2017 10:27:38 -0400 Received: by mail-wm0-f47.google.com with SMTP id t70so22787057wmt.0 for ; Mon, 17 Jul 2017 07:27:37 -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=JIWR1W8rlYIt8TzTVd3MnXUnOi7BB4TdVjGFioyH0QHo56iJItrGjlTDLX+6ppz92d b+BxOy2i1VuTLJYVfWGBfPB4yQazyxPyEMuh3+Ax6+th+a8NnEdDsWE7iYqOIvIb01L4 ugZXKdo7Zm/WEF3Y3jToDCmbbffGBqybcmijzCV2udtJW/MDo56GoBtDU/by3D/wb5VF vEw8w1d7+YzWRqKKpmi9EuXy4F6hysUPC7+vVthU8qzSWvJTA+nb4LERciVWkOpRVbmD vIvxOoIV1+WyiwAoVVDwnVJF15wvv2i7NKjlIrn7acSXpbfAeE+2MvnYA7K9K0UUEigU eBgw== X-Gm-Message-State: AIVw111fNGljnClPof1h8GrZTTnWk4JZ5jQ0/jHhazqusJiKNGz0YABb d/3LbMJG7OqWdtdimkkGQQ== 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 Cc: kvm@vger.kernel.org, Marc Zyngier , Christoffer Dall 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> 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 --- 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; }