From patchwork Tue Nov 7 10:47:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 10046429 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 7D9D260360 for ; Tue, 7 Nov 2017 10:53:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55BCC287C3 for ; Tue, 7 Nov 2017 10:53:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4AA8828EA1; Tue, 7 Nov 2017 10:53:54 +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 2A7CA287C3 for ; Tue, 7 Nov 2017 10:53:53 +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=JLeNPBNFoU0IWwxpAllEyQzvrF d8lUlbXbMqxIekujUDGtqZj0pBP3+4jvdT+N8sMarrAleTlPzRKiWNPwbAJYFIxyKxr1zInPd3nd2 6udUQSOQlHX/eZ1Xd4aO+9CDV9IaSIIWk6y/2kpdf5DjaGDX9FikFKwDlWLlkS6nngaPYGcylLW00 Uei/5gmnOeNBwivDk5dpJgvjb94bfs8/xfvZQhrPQCMXGXFGaJfdN8h6KKna7AWsEGaUL7f4McHji oEKCky57LKkHiqbY/oFHczn3wNRyHfEij0QoA93XXaVWXdPU7z2CRamnEyjIc7d8qCYdX2nE9BXH1 4GhsoY6A==; 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 1eC1Vw-0006xH-5x; Tue, 07 Nov 2017 10:53:52 +0000 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eC1R0-0000zQ-5C for linux-arm-kernel@lists.infradead.org; Tue, 07 Nov 2017 10:49:03 +0000 Received: by mail-wm0-x243.google.com with SMTP id z3so2809134wme.5 for ; Tue, 07 Nov 2017 02:48:27 -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=7XLCQEPHhJynAYUGmmFCrVfpOX04ldC7XB5ed+AxokA=; b=CoOdzbFWMqTUI1egm8+YYeKGmbtySD0DuKKEmBEesvHfkB7c/oh9/IjJWiOONWJxEF hore2eAGlLLmDRVUaqJREXBQHf5jwHwDptJXQUhyc9SuEMnGHsxS7RnV3W8FNOjNJdOo o0xvkdgcgaoBHH6ByVmYb/l+REtmQh2q+4Vjw= 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=MIOcrItWNA0kcRV7M5tWALBXP5b3qGqEN3b6fVi1DGkWacT6ttSUQsyIOL6kyUwJQn jMcYA84/cTITGuvx9x/UFA39YUyA8ntuIoJaiYX1kbmFP9DN/jT/ZprjdV+feV188xcr PjmxUSgxd+ECLgW49D1K5bbB7OVCSQDaxoZxb3PbYl85NBN+AwJFd1roMy1SGSeYvOl7 NNX/g/GbNdURmTtYzCBE7iH3QlT8lvVG+j4sIWLOuaxGNWs0PdVARDbZ7P7tMehnohVr Mygfm/Tb/1FESsid5AgUUJ2FSQx6Li84f7WtO/oHcfQ7bA7HZWzCurKfUnyMUKKUWltb 7uvg== X-Gm-Message-State: AMCzsaXjUAOcZY52MRd5ZO8oyPyJTUz0IGQtlZcB0A1F3p5Jz7azpC6g VtDPmJ6QCUvuiLP87lJvmYbIaw== X-Google-Smtp-Source: ABhQp+Q4Eo/dDJ9MeefjU4SaMhoE2Z3GgAPeZ751h7JQHuth+bxdFVh7DCRQEAZAFtSIeo5xP6mEgg== X-Received: by 10.80.186.78 with SMTP id 14mr23352206eds.132.1510051705735; Tue, 07 Nov 2017 02:48:25 -0800 (PST) Received: from localhost.localdomain (xd93dd96b.cust.hiper.dk. [217.61.217.107]) by smtp.gmail.com with ESMTPSA id q12sm1044958edj.29.2017.11.07.02.48.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Nov 2017 02:48:24 -0800 (PST) From: Christoffer Dall To: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Subject: [PULL 11/26] KVM: arm/arm64: Set VCPU affinity for virt timer irq Date: Tue, 7 Nov 2017 11:47:44 +0100 Message-Id: <20171107104800.30021-12-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171107104800.30021-1-christoffer.dall@linaro.org> References: <20171107104800.30021-1-christoffer.dall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171107_024846_627455_0D8F48D1 X-CRM114-Status: GOOD ( 10.52 ) 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, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.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; }