From patchwork Thu Nov 22 03:10:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kys@linuxonhyperv.com X-Patchwork-Id: 10693449 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 86BEC14DE for ; Thu, 22 Nov 2018 03:12:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 776362C4C9 for ; Thu, 22 Nov 2018 03:12:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A2302C782; Thu, 22 Nov 2018 03:12:12 +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.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 18FA12C4C9 for ; Thu, 22 Nov 2018 03:12:12 +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:Cc:Reply-To:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:To:From:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6koIHEFt/SvzVEs+QY3FwSOaBiFBibN42SevT24Aqhg=; b=Xn9FF84g4dzq53 rbf4uTrbVgEsdKB/Go4bCaYN9VTj1iob/7C/BMHUEr6L5KB5fvanTN5WLujjWtLxGhdXJeVOiIKYP Ws8fuks5GyLy/d+6cTbl+ltCb8V6nVcx5F86Fhkvz8ASFf20AyYyhqf5gDAG0zlENoXmz61Nez57k 7+N9oGvUtURBxn2nAO/XjtV5oiNyk4pljWrIQlMacYkMPI+B7YwPTm2S6hqjJzqJyYRnOjLCroRyU /IAVM13qxaScEtX/mU1HCZxe1EWnRxe2yDfMvuuOdYAs4kuISzhKVs1Q2zyNVj7SorpwSG7B/iLr9 iHW5pgEcuxcxYBfkmpuQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gPfPR-0005me-LX; Thu, 22 Nov 2018 03:12:05 +0000 Received: from a2nlsmtp01-05.prod.iad2.secureserver.net ([198.71.225.49]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gPfPP-0005Kz-5N for linux-arm-kernel@lists.infradead.org; Thu, 22 Nov 2018 03:12:04 +0000 Received: from linuxonhyperv2.linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with ESMTP id PfOQgqzUCse9VPfOQgywCR; Wed, 21 Nov 2018 20:11:02 -0700 x-originating-ip: 107.180.71.197 Received: from kys by linuxonhyperv2.linuxonhyperv.com with local (Exim 4.91) (envelope-from ) id 1gPfOP-0004GQ-SO; Wed, 21 Nov 2018 20:11:01 -0700 From: kys@linuxonhyperv.com To: will.deacon@arm.com, catalin.marinas@armm.com, mark.rutland@arm.com, marc.zyngier@arm.com, linux-arm-kernel@lists.infradead.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, jasowang@redhat.com, sthemmin@microsoft.com, Michael.H.Kelley@microsoft.com, vkuznets@redhat.com Subject: [PATCH 3/4] Drivers: hv: vmbus: Add hooks for per-CPU IRQ Date: Thu, 22 Nov 2018 03:10:58 +0000 Message-Id: <20181122031059.16338-3-kys@linuxonhyperv.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181122031059.16338-1-kys@linuxonhyperv.com> References: <20181122030914.16274-1-kys@linuxonhyperv.com> <20181122031059.16338-1-kys@linuxonhyperv.com> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfLJu3a4QI8aw6Tzl5UCoLusefq6FAcOrnyMe75v908rojsSVShaQRGsYFMiKZKRl8gL/JWmm5uwsyooKF0ojAQWKN7ohNJiBM4RfmDR+PtV6BWqEZ5Vf /P+m78RZusUKyRvgZe45CxRqSbeyvy5kI8dPY7XXEtmUhZ7GHfS+2FERB25hDZUBQ3oReb3A5GcncYxu8zOOTDC+AzR4yHw+ZThH42e8fy6p9QUlGbqhqjmT 8xk+R1vqMoNGcF+Kvszp1ZsvpLCrdoSz9XZOo4rC8jritvpeF6unI/Vh4/cGJmjuVln+ZWLGhZ530H1R0/V1bmpppax4cwS9fxuKbVJ3hiPzyeCmVuUB5pvG MpLcWCHMoHt60l0QE5ePs6CDTjZnLrItsPesaWi3UAtm8tcQmwLCKSs0cIbZUVFWMhF59UeYwxRpyWsSqUQzbr+FXY0nuI/xvuv4jTqhHsKz+aYVaPqjshmM vInPi/A2/5d1ZEcm0wEb45O9A6UyrEcm2BX+9B0sbEcN03Jro7aXvBmynLQ8voLqj7Kw20NMS4DZ3cNwlJWr9pkEX/WAl+TZdJ2l4dvdALuwsoY53d7t0hnf 8qNpGs30NN+dpL6hX+e9H/fiScmcEGI/RW/B6GqFVraw+yC0w5tCMdj95rsqOYSLPYTgPM57HlcTMiWhlYkUSZbw5SY4/HB3ghWKVcjTxADsLn3KoKGUlGOV VgZ2I3mpvYXiACmCAziuqz9sOUoS+pca1HXs+rxJ2QLdzapQNjPz/g== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181121_191203_258195_C50ADE9E X-CRM114-Status: UNSURE ( 8.60 ) X-CRM114-Notice: Please train this message. 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: , Reply-To: kys@microsoft.com Cc: "K . Y . Srinivasan" , Michael Kelley 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: Michael Kelley Add hooks to enable/disable a per-CPU IRQ for VMbus. These hooks are in the architecture independent setup and shutdown paths for Hyper-V, and are needed by Linux guests on Hyper-V on ARM64. The x86/x64 implementation is null because VMbus interrupts on x86/x64 don't use an IRQ. Signed-off-by: Michael Kelley Signed-off-by: K. Y. Srinivasan --- arch/x86/include/asm/mshyperv.h | 4 ++++ drivers/hv/hv.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h index 0d6271cce198..8d97bd3a13a6 100644 --- a/arch/x86/include/asm/mshyperv.h +++ b/arch/x86/include/asm/mshyperv.h @@ -109,6 +109,10 @@ void hyperv_vector_handler(struct pt_regs *regs); void hv_setup_vmbus_irq(void (*handler)(void)); void hv_remove_vmbus_irq(void); +/* On x86/x64, there isn't a real IRQ to be enabled/disable */ +static inline void hv_enable_vmbus_irq(void) {} +static inline void hv_disable_vmbus_irq(void) {} + void hv_setup_kexec_handler(void (*handler)(void)); void hv_remove_kexec_handler(void); void hv_setup_crash_handler(void (*handler)(struct pt_regs *regs)); diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c index 166c2501de17..d0bb09a4bd73 100644 --- a/drivers/hv/hv.c +++ b/drivers/hv/hv.c @@ -307,6 +307,7 @@ int hv_synic_init(unsigned int cpu) hv_set_siefp(siefp.as_uint64); /* Setup the shared SINT. */ + hv_enable_vmbus_irq(); hv_get_synint_state(VMBUS_MESSAGE_SINT, shared_sint.as_uint64); shared_sint.vector = HYPERVISOR_CALLBACK_VECTOR; @@ -434,6 +435,7 @@ int hv_synic_cleanup(unsigned int cpu) /* Disable the global synic bit */ sctrl.enable = 0; hv_set_synic_state(sctrl.as_uint64); + hv_disable_vmbus_irq(); return 0; }