From patchwork Sat Sep 23 00:42:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9967335 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 BC8B9602CB for ; Sat, 23 Sep 2017 00:46:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ABF78299CD for ; Sat, 23 Sep 2017 00:46:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D61D299D0; Sat, 23 Sep 2017 00:46:09 +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 3381E299CE for ; Sat, 23 Sep 2017 00:46:08 +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=G+WlEy2GYMNfJfbjNzUd8Xvac1 EcThE4t7xY5l5f9ahLxBUqQUdV5vX7fZj0LkbvIfr556vm2FIt1ur48X+r6BoVH7g4taAIaRX0mRn o6Uge/8XQ3mxYczwwzfmQ/1/KmDHSQHUX4821ZttMSZIc/spqy1uGF65DCI8guYjIoTEYV9dpBfJJ SZ7wcpIeuh6B3Cu2wuiIznT0eUJI5O70PD47Ao19NPb5jN6u/+mq1/V4XfE1jQuqDzJ3Y8nVYFMMY 3HdmsJ4QEctvb5GIuZ9m18y9lXeNCbhqAW8fKqmYBJ/WWSOiMEfxDxmZHDUcDZoypJy95zKo4NBtL p25ikFIQ==; 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 1dvYZk-00070M-HL; Sat, 23 Sep 2017 00:45:44 +0000 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dvYWn-0003pE-3K for linux-arm-kernel@lists.infradead.org; Sat, 23 Sep 2017 00:42:49 +0000 Received: by mail-wm0-x230.google.com with SMTP id b195so7636747wmb.5 for ; Fri, 22 Sep 2017 17:42:24 -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=Dgq9CYWGtzZao7opaVxq22ETnOI8QLF/wTdtum57NdeEo3v6niiIlyv50LTq2Z3diL 1uLHwMeCNk9fyHwjpKy7KfXiqkWr1wOx+Nksdxzl3WLzVEHIztf0eGf8LI8Ww90pJ949 Z2P9nRMnfHKQnu/3gFCVxBqCQhCrd0mr0qAvQ= 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=Bqi06Ql8rXVB8HAa5IM85s4jg8ln861BMp8+101grSqXO0Rnr70TTkUZpRpcWwYFbT 9G+icGxP864d5YU3Qdy45o3s0yFOsabqCu4I5AXVYcyo9y7nwdQR9QdfnWBETwJgitxD 02OmH53xetMmIqsWsXr3XgA2C42++pkZ3V50jdkNBUEumquTkXokDJPsYSNs9R/Uu7Qj ozXLek95lRs9qhVcaUV7zCDdr7RETyV9LUuX9BS/N4ywI9F6gApjymYSOFmyKTf+V6V8 uPvZI6DUjCir0oNCpnAamoiW9TxHy7mxln9YICTtIzoJ3fHrH5B/KYoGauvnejOfTpok tONw== X-Gm-Message-State: AHPjjUjVtUv2HeUwSUeYyAz7RMTO0p6zNIY4tCoxPPVY3+J2sp7vRCs3 SkS4/fwG/4f3IQUZ5Zup+ruqGA== X-Google-Smtp-Source: AOwi7QBVk0uTa9D2wmbCzu0QX0wCcWvAKsMWXpQt/455DZ+oMBBIhzQFpIqiXtXfcjnZUiKSQGHVtw== X-Received: by 10.80.212.150 with SMTP id s22mr6618775edi.286.1506127343444; Fri, 22 Sep 2017 17:42:23 -0700 (PDT) Received: from localhost.localdomain (xd93dd96b.cust.hiper.dk. [217.61.217.107]) by smtp.gmail.com with ESMTPSA id c25sm646085edb.57.2017.09.22.17.42.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Sep 2017 17:42:22 -0700 (PDT) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 13/20] KVM: arm/arm64: Set VCPU affinity for virt timer irq Date: Sat, 23 Sep 2017 02:42:00 +0200 Message-Id: <20170923004207.22356-14-cdall@linaro.org> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170923004207.22356-1-cdall@linaro.org> References: <20170923004207.22356-1-cdall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170922_174241_868420_0B651735 X-CRM114-Status: GOOD ( 10.57 ) 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 , Catalin Marinas , Will Deacon , kvm@vger.kernel.org, Christoffer Dall 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 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; }