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: 10029383 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 DABC9602D6 for ; Fri, 27 Oct 2017 08:36:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C97EA28F55 for ; Fri, 27 Oct 2017 08:36:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE4B128F5C; Fri, 27 Oct 2017 08:36:46 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 7A17D28F55 for ; Fri, 27 Oct 2017 08:36:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752330AbdJ0Igp (ORCPT ); Fri, 27 Oct 2017 04:36:45 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:55969 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751148AbdJ0IgK (ORCPT ); Fri, 27 Oct 2017 04:36:10 -0400 Received: by mail-lf0-f66.google.com with SMTP id p184so6510658lfe.12 for ; Fri, 27 Oct 2017 01:36:09 -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=A11/XOulNq8mElHwM7iVypOZqdI6zcG57F3zn48nCtyZApHLvKmwE2WXpBZBHjmu3Q WrpmV6F7a+InyzpiUSeJtdhB/sRTo+Sdd3h+dPgRbBz5rcTVPm4kJfwfAgPZM1iA/3MD f94eN5aXRXud4F/+NevzSUTtbXf52Wk8+nJQdUE2XYVHgKOIREwnH70P8PfUcUieYjmO Mlwl00Uid9JNlwNML07kaDYOKxHoFuxxERQ4YLukveTnX0jaSuzrzfAsQT6pEeYlig7K 5wN9aCH1j6B2aUlHHLGKRn5W2ayw6RGIpleToisQjBFyMpVXt0UT2jcYhrU1vj5t7uqT dYKw== X-Gm-Message-State: AMCzsaW+LmnxYHsd2kPcTCyCHtGMS1rDFbli+AomS9NavNMRh31B7cdX nE4qQYivE9QTNEWoJy4eNRKeVw== 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 Cc: Marc Zyngier , Eric Auger , kvm@vger.kernel.org, Catalin Marinas , Will Deacon , Christoffer Dall 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> 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 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; }