From patchwork Fri Oct 20 11:49:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 10019971 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 174C9602CB for ; Fri, 20 Oct 2017 11:55:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE19228EC0 for ; Fri, 20 Oct 2017 11:55:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E15CF28ED0; Fri, 20 Oct 2017 11:55:07 +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=-3.7 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM 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 6913028EC0 for ; Fri, 20 Oct 2017 11:55:07 +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=VWrDkxW4mnouzJALZtz6bYhVv6JAvOpg7oayGXrDBi0=; b=oJh/1w5XgtVmJ5S6fa+N7ZuQbv r9bVjm9/1I5vULp7Bj4e31Wc9xpnbPWB84zj+gxYQJKu3JI10ACVH3RO3SyXeSaqGvGQKzpr3xciL BzPHC/HbgaDWu+vPT1cw6T6/9NyDPQSNilRBir4QPHTutBoRGN9i7arx7GGebfYJ+SWirhvm+Ntw5 FmxNt/5A0E3057MnJ17AUvUiwV3C5JRTo03AlN8FyaW0tTGKgUIS/uWoAZPurxTr8YW52UBsQ303R fD9suLo58NQp38pFLLqQR2K3iqBQzTIHdAQxGhU+1w5Gjp3rQFgh5M+itO5eTaBpTOtqQRzHx/4wv IwWh4PwA==; 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 1e5VtG-0004iu-Rx; Fri, 20 Oct 2017 11:55:02 +0000 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e5Voh-00084B-D8 for linux-arm-kernel@lists.infradead.org; Fri, 20 Oct 2017 11:50:25 +0000 Received: by mail-wm0-x241.google.com with SMTP id m72so335122wmc.0 for ; Fri, 20 Oct 2017 04:50:01 -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=7XLCQEPHhJynAYUGmmFCrVfpOX04ldC7XB5ed+AxokA=; b=XcMwJ4HOYdhE3yYiegUMeNcK1JqzMn7juSFB94cwespi/CjuW61xtjU440k7CJfb9j c7+CvhE8UZne7dSyrv+M7918iozPFVvrIMnnPLh6Vk/XeAyrtUWTSYtu8INi5PhFDhos 6hADv8HcZnmA0mspXd1OReowgdGIM9MvAUwBk= 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=7XLCQEPHhJynAYUGmmFCrVfpOX04ldC7XB5ed+AxokA=; b=JNHuTFkPQfP3rPtFy9p00ufq8D2TEpvsKCXHOoEf7Gc1bGzaH3hFGRT76zkP+070ob gkALrLWqkthHyUEbzxmeAi8MNGQvq2FZZEqo1WwGlmBzxdPOpCXWSW0mZ5M4ZO7/lKuL I3EnQXz+4Ig2+eO3chpRF4d3qm+UJUanT9tnUq+PSEjBaOoEZpq+cxs4HdsixYwbkH03 vD+AzdZSWMxuwkCMps8pc60INfQO/yMnJp1OGsM1sse2MZMH+IkFuJ3YiQ/sf8ZbeOX0 ltcoCFPQQWA7GjuMFjUltv0fHpf6TXgq7GGa1w9AXI6brTFIVJuVZWFSQ0eHjUsHBMUW oRSA== X-Gm-Message-State: AMCzsaWAPMx5hAzMCHUsUn0PArOSOm76C5cGf44FoT2mDvLuHmhaSvTC 71outkXBYKzH9zlmVj3TnakHlg== X-Google-Smtp-Source: ABhQp+SaB4CZQ7lgJE8Xwx7/n0A8GSMMOcxSQQemL3PFJRbI5MqxLGhmEQoekbMxDH8l410zzYOqyw== X-Received: by 10.80.230.24 with SMTP id y24mr6139692edm.211.1508500200235; Fri, 20 Oct 2017 04:50:00 -0700 (PDT) Received: from localhost.localdomain (xd93dd96b.cust.hiper.dk. [217.61.217.107]) by smtp.gmail.com with ESMTPSA id f53sm872234ede.63.2017.10.20.04.49.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 20 Oct 2017 04:49:59 -0700 (PDT) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 13/20] KVM: arm/arm64: Set VCPU affinity for virt timer irq Date: Fri, 20 Oct 2017 13:49:32 +0200 Message-Id: <20171020114939.12554-14-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171020114939.12554-1-christoffer.dall@linaro.org> References: <20171020114939.12554-1-christoffer.dall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171020_045020_050674_D3070458 X-CRM114-Status: GOOD ( 10.63 ) 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 From: Christoffer Dall 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 93c8973a71f4..eac1b3d83a86 100644 --- a/virt/kvm/arm/arch_timer.c +++ b/virt/kvm/arm/arch_timer.c @@ -649,11 +649,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; }