Received: by 10.213.65.16 with SMTP id m16csp147874imf; Sun, 11 Mar 2018 20:50:45 -0700 (PDT) X-Google-Smtp-Source: AG47ELvcbatwbukqO4y4uy8n0+8lWKLkcNlSe+bQJR1bJqOOZYq/y11q8wRThRhD6wuIB/DBZWgO X-Received: by 10.101.90.75 with SMTP id z11mr5305226pgs.29.1520826645806; Sun, 11 Mar 2018 20:50:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520826645; cv=none; d=google.com; s=arc-20160816; b=UI6eU0SNsh2qlgI73YBa22l91Gyzgk5MIxByWKEss6QHcmrwQaRoKMQAd49DmOzSsB XL7qJsBuqKpnB8livqo6ymK+G5hIZaJOWIz3awCAh1OXgX0HwHi2CZc4kYCAkNhovki5 DSA51ook0BsaUtNRhELrcgvv8N+VJn0WlyH5gK1ntbJiJnXdjbWt6PLox11hg08hRI7J uUPBmXE5hVdlipfKpCaVekm0+jfChao0RCbwUyQE2pdqnddI9mhYjkJzPY5TsHbwUcdv WdNf/8jd588y/7zbRbkQs1+6IanXrhj7qyZm/5BqDQWZ4VoLZlcocEoCzerw3oE2F2Z2 g1eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-authentication-results; bh=u6qhn3CERNcGQfi000D6zbtYsO0GUlTnLGXjv9nWwPU=; b=V3du8PrxKUEYpFB1LgqSmtA8dE2vJLxiTJwnT9NoG+DYtCBeYkzJN7P6NNjcPr6Vg0 pPNvm3cPD4JUXgDUbq6145vitDEkhYQVVfXjMyhorKA2y3Or0s6QHnDUuzFnEy9WpJlz 4MHtmZVZwYLg7AXe85labvKzJWCDnmiTAyh5t3OD84ka9B6baJDixU/JDsMfd1r1ok/5 4qqWiggGvDMnULmS27YBqOXrT7/HN9NBCk+ToWukC5Zb5H0/AmDRqofKyzX1j2w+56fA acP6OTA8mWSIl3DHNNls2GEwTXQx2fmQlONRqGDb2Xj5qHaQ9C3gz3xSrdaRLnKKQ95/ eZWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YfVei7uN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c14si4968646pfn.313.2018.03.11.20.50.31; Sun, 11 Mar 2018 20:50:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YfVei7uN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933322AbeCLDtg (ORCPT + 99 others); Sun, 11 Mar 2018 23:49:36 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:40755 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932705AbeCLDtd (ORCPT ); Sun, 11 Mar 2018 23:49:33 -0400 Received: by mail-pg0-f68.google.com with SMTP id g8so5989470pgv.7 for ; Sun, 11 Mar 2018 20:49:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:reply-to; bh=u6qhn3CERNcGQfi000D6zbtYsO0GUlTnLGXjv9nWwPU=; b=YfVei7uNYPK1NgWgXDc2hKgHQF3SC+jThyMGflSvjDpRvg4rWIFtp58jCDgwp/lgmb GjZ4FxUewqYw09XypNcXPp1VyR52r64bzU2eJiEoOgMg2wLSg80KmoLMkcAe4sOv+b4x 1ZgD5c15zPDBkLgoURcyFeTMeSyoDOJ4bolrvNvUyupmnDAfCc81M4W60Yo94827fciu JUuZo7Nk4QabeTDggvFB8WLx9s9QkStRYaHgtkxmFJhCdgctVQI04HgDcu+ceRXL4+3q DSqeSLb9cc9PXfC7VarbncfENNx6MIlG+RZKFCZ53roI72KTg96cvLUgtxBGIZ2a0Gkc R+JA== 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:reply-to; bh=u6qhn3CERNcGQfi000D6zbtYsO0GUlTnLGXjv9nWwPU=; b=IhBNPEw0tgRyur0GuM2BNoUDOmeZhvIlDwMNHuDNnKWr6RAXUKo8jOsD/1oBREHcKy EPubpyN8SjMBPIHnH9egO4VzvJn9Wzuko6832LdFE5dD3XEamWjeKhUdw/Rn0IWU+vi7 f78fxPCRNqCt3jUqoNh979VcqvGo1KquEYRmkl0bG/CIBGYom8g0FXTfEyXdXLXqUJMd yg3Iuj7djNYINuTCiqX3DNWpHID3NX5nSc6lFsxitIXtjOZ82nloghfF7axtFQtaaQhM kMdZsYIluoHZGK2dP6Ac5zYIx0ND7LpyDi32kghJrMhWkCSfkqhsnBLpwT6inpAL1hJV U9tA== X-Gm-Message-State: AElRT7GDypcQV4ucQ/jyIVR8xFu8hIeRhutG5mebkJArZTnhnXoq4l9F yV8L9fzMgm7h9Q9aK39NAjs= X-Received: by 10.99.117.92 with SMTP id f28mr5507576pgn.421.1520826573142; Sun, 11 Mar 2018 20:49:33 -0700 (PDT) Received: from nvmetest.corp.microsoft.com ([2001:4898:80e8::4da]) by smtp.gmail.com with ESMTPSA id y15sm13004738pfa.33.2018.03.11.20.49.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 11 Mar 2018 20:49:32 -0700 (PDT) From: Michael Kelley X-Google-Original-From: Michael Kelley To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, vkuznets@redhat.com, jasowang@redhat.com, leann.ogasawara@canonical.com, marcelo.cerri@canonical.com, sthemmin@microsoft.com, kys@microsoft.com Cc: mikelley@microsoft.com Subject: [PATCH char-misc 1/1] Drivers: hv: vmbus: Add hooks for per-CPU IRQ Date: Sun, 11 Mar 2018 20:49:02 -0700 Message-Id: <1520826542-2095-1-git-send-email-mikelley@microsoft.com> X-Mailer: git-send-email 2.7.4 Reply-To: mikelley@microsoft.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. They are being added as staging for upcoming code for 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 --- 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 e73c4d0..b73b839 100644 --- a/arch/x86/include/asm/mshyperv.h +++ b/arch/x86/include/asm/mshyperv.h @@ -168,6 +168,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/disabled */ +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 b1f6793..6a3ea4e 100644 --- a/drivers/hv/hv.c +++ b/drivers/hv/hv.c @@ -299,6 +299,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(HV_X64_MSR_SINT0 + VMBUS_MESSAGE_SINT, shared_sint.as_uint64); @@ -433,6 +434,7 @@ int hv_synic_cleanup(unsigned int cpu) hv_get_synic_state(sctrl.as_uint64); sctrl.enable = 0; hv_set_synic_state(sctrl.as_uint64); + hv_disable_vmbus_irq(); return 0; } -- 2.7.4