From patchwork Fri Oct 27 08:34:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 10029413 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 8DDD5602D6 for ; Fri, 27 Oct 2017 08:40:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B67828503 for ; Fri, 27 Oct 2017 08:40:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6EAD728F5A; Fri, 27 Oct 2017 08:40:03 +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 0226428503 for ; Fri, 27 Oct 2017 08:40:03 +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=dgYfvw/AHw5Ipx8CCMzw8iVBrsEvy+4gWav6lByz4O0=; b=rfD+/LYfOKAEsKtXsMdwGJJ8BJ IVfQ5kRec9IzAQ6uKwWiBK1U1RBYSTj78INJn3A5t+PTTlbGPnjD6bdJrc9t4ASyazQ0yvd8/Ax+4 1TBI7bs2SAxobfosxTiFbBhJBIZSJgscnLjEiO5u7GXYupuQvkm3lg+eCFPw1KD7r4wKgyqf+lRas bNsJg6c7qki4p3czGxRtsjIGUd51dg+Ge83nqeNNFK7NnsDWU1pyKg2qnnN6WUVz0gxuH+eTAa40P mdI81qO9oxw6mm4uUiSjKRwOvksiV9oDkhoYnrkw5qhNLxi1JbGf9wzOp5INrtYqgJQfd7r4AR+hj kTERKcWQ==; 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 1e80BJ-0002Y4-Rr; Fri, 27 Oct 2017 08:39:57 +0000 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e807x-0000Y3-W1 for linux-arm-kernel@lists.infradead.org; Fri, 27 Oct 2017 08:37:32 +0000 Received: by mail-lf0-x242.google.com with SMTP id 90so6522544lfs.13 for ; Fri, 27 Oct 2017 01:36:10 -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=JgSqqVBhcEaHKvbWruo6wuS2MLBlaXe5G7JKTFpEU6I=; b=exut9Ev4RKGKAAgCcTzRpkenCG25+/Zhlos45TzzQsAHomRXQPJnlUxdNMlBBoB7cW Q2RPTt8Mg/eWd+7BDWH2Ws8UseIvDk3diK0c7huUwc2mIuN0k5xE1opwU8TlCh+7OLwA lHGOsdQtRrj9xpdYJM/kpwPd21hFsl/SR6vuE= 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=JgSqqVBhcEaHKvbWruo6wuS2MLBlaXe5G7JKTFpEU6I=; b=Se+SNyPM9+E1cY4wS/aZqQ/s9vNNwfOaXAnFEirEw1C1IW/wfNSKllsPCjXOCwGzRZ Jx+0IneFiuZ+AYlF4SnaF6ikAn4NMIfbe5jXKRj2RLWGwGVEsmMwcA+fyvgdk9myKGBD WFrOau50TgnfuBZk4KnPDPMl3mmPq3hru8ff3nJFft2Gmd8RxYXL6xxw3s7/273UPRkE NYWzBNRYUdLz5cHXBh8k9NxHBmbVWwGn77+P7K2aHO8oaXF85Wx95CrG67Iih+g3Vkvz 5YXYcR2LlEvJ9PVqTYxPIdVtBLWOo1326IGNyAwvPtkKCOLp9l7isoOWGU9x4gxtlJn3 oirA== X-Gm-Message-State: AMCzsaXuwa4VBVHe2jYY3W4o8SSWYWkVG/M82kqzWwvlXj6xbygwOWlY JgBfMXkiNJHbnrVlAKnIfZ6ZWA== X-Google-Smtp-Source: ABhQp+SmLnlGKJwMu2KidZUmtC6OdOgNDpRasBHkA9nu0oMQOH4Bnghvc7PI18zuzSEAfpjKWWbIYw== X-Received: by 10.25.83.144 with SMTP id h16mr8768067lfl.123.1509093368935; Fri, 27 Oct 2017 01:36:08 -0700 (PDT) Received: from localhost.localdomain (212.27.17.163.bredband.3.dk. [212.27.17.163]) by smtp.gmail.com with ESMTPSA id d204sm1471957lfe.73.2017.10.27.01.36.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Oct 2017 01:36:08 -0700 (PDT) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 13/20] KVM: arm/arm64: Set VCPU affinity for virt timer irq Date: Fri, 27 Oct 2017 10:34:34 +0200 Message-Id: <1509093281-15225-14-git-send-email-cdall@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509093281-15225-1-git-send-email-cdall@linaro.org> References: <1509093281-15225-1-git-send-email-cdall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171027_013630_680458_270EE1B2 X-CRM114-Status: GOOD ( 10.81 ) 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: Christoffer Dall , kvm@vger.kernel.org, Marc Zyngier , Catalin Marinas , Will Deacon , Eric Auger 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 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 93c8973..eac1b3d 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; }