All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu@kernel.org>
To: Linux on Hyper-V List <linux-hyperv@vger.kernel.org>
Cc: virtualization@lists.linux-foundation.org,
	Linux Kernel List <linux-kernel@vger.kernel.org>,
	Michael Kelley <mikelley@microsoft.com>,
	Vineeth Pillai <viremana@linux.microsoft.com>,
	Sunil Muthuswamy <sunilmut@microsoft.com>,
	Nuno Das Neves <nunodasneves@linux.microsoft.com>,
	pasha.tatashin@soleen.com, Wei Liu <wei.liu@kernel.org>,
	Rob Herring <robh@kernel.org>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Arnd Bergmann <arnd@arndb.de>,
	linux-pci@vger.kernel.org (open list:PCI NATIVE HOST BRIDGE AND
	ENDPOINT DRIVERS),
	linux-arch@vger.kernel.org (open list:GENERIC INCLUDE/ASM HEADER
	FILES)
Subject: [PATCH v6 12/16] asm-generic/hyperv: update hv_interrupt_entry
Date: Wed,  3 Feb 2021 15:04:31 +0000	[thread overview]
Message-ID: <20210203150435.27941-13-wei.liu@kernel.org> (raw)
In-Reply-To: <20210203150435.27941-1-wei.liu@kernel.org>

We will soon use the same structure to handle IO-APIC interrupts as
well. Introduce an enum to identify the source and a data structure for
IO-APIC RTE.

While at it, update pci-hyperv.c to use the enum.

No functional change.

Signed-off-by: Wei Liu <wei.liu@kernel.org>
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
---
 drivers/pci/controller/pci-hyperv.c |  2 +-
 include/asm-generic/hyperv-tlfs.h   | 36 +++++++++++++++++++++++++++--
 2 files changed, 35 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
index 6db8d96a78eb..87aa62ee0368 100644
--- a/drivers/pci/controller/pci-hyperv.c
+++ b/drivers/pci/controller/pci-hyperv.c
@@ -1216,7 +1216,7 @@ static void hv_irq_unmask(struct irq_data *data)
 	params = &hbus->retarget_msi_interrupt_params;
 	memset(params, 0, sizeof(*params));
 	params->partition_id = HV_PARTITION_ID_SELF;
-	params->int_entry.source = 1; /* MSI(-X) */
+	params->int_entry.source = HV_INTERRUPT_SOURCE_MSI;
 	hv_set_msi_entry_from_desc(&params->int_entry.msi_entry, msi_desc);
 	params->device_id = (hbus->hdev->dev_instance.b[5] << 24) |
 			   (hbus->hdev->dev_instance.b[4] << 16) |
diff --git a/include/asm-generic/hyperv-tlfs.h b/include/asm-generic/hyperv-tlfs.h
index 4669f9a4e1f1..94c7d77bbf68 100644
--- a/include/asm-generic/hyperv-tlfs.h
+++ b/include/asm-generic/hyperv-tlfs.h
@@ -480,6 +480,11 @@ struct hv_create_vp {
 	u64 flags;
 } __packed;
 
+enum hv_interrupt_source {
+	HV_INTERRUPT_SOURCE_MSI = 1, /* MSI and MSI-X */
+	HV_INTERRUPT_SOURCE_IOAPIC,
+};
+
 union hv_msi_address_register {
 	u32 as_uint32;
 	struct {
@@ -513,10 +518,37 @@ union hv_msi_entry {
 	} __packed;
 };
 
+union hv_ioapic_rte {
+	u64 as_uint64;
+
+	struct {
+		u32 vector:8;
+		u32 delivery_mode:3;
+		u32 destination_mode:1;
+		u32 delivery_status:1;
+		u32 interrupt_polarity:1;
+		u32 remote_irr:1;
+		u32 trigger_mode:1;
+		u32 interrupt_mask:1;
+		u32 reserved1:15;
+
+		u32 reserved2:24;
+		u32 destination_id:8;
+	};
+
+	struct {
+		u32 low_uint32;
+		u32 high_uint32;
+	};
+} __packed;
+
 struct hv_interrupt_entry {
-	u32 source;			/* 1 for MSI(-X) */
+	u32 source;
 	u32 reserved1;
-	union hv_msi_entry msi_entry;
+	union {
+		union hv_msi_entry msi_entry;
+		union hv_ioapic_rte ioapic_rte;
+	};
 } __packed;
 
 /*
-- 
2.20.1


  parent reply	other threads:[~2021-02-03 15:12 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-03 15:04 [PATCH v6 00/16] Introducing Linux root partition support for Microsoft Hypervisor Wei Liu
2021-02-03 15:04 ` [PATCH v6 01/16] asm-generic/hyperv: change HV_CPU_POWER_MANAGEMENT to HV_CPU_MANAGEMENT Wei Liu
2021-02-03 15:04 ` [PATCH v6 02/16] x86/hyperv: detect if Linux is the root partition Wei Liu
2021-02-04 16:49   ` Michael Kelley
2021-02-04 16:49     ` Michael Kelley via Virtualization
2021-02-03 15:04 ` [PATCH v6 03/16] Drivers: hv: vmbus: skip VMBus initialization if Linux is root Wei Liu
2021-02-03 15:04 ` [PATCH v6 04/16] clocksource/hyperv: use MSR-based access if running as root Wei Liu
2021-02-03 15:04 ` [PATCH v6 05/16] x86/hyperv: allocate output arg pages if required Wei Liu
2021-02-04 16:52   ` Michael Kelley
2021-02-04 16:52     ` Michael Kelley via Virtualization
2021-02-03 15:04 ` [PATCH v6 06/16] x86/hyperv: extract partition ID from Microsoft Hypervisor if necessary Wei Liu
2021-02-04 16:54   ` Michael Kelley
2021-02-04 16:54     ` Michael Kelley via Virtualization
2021-02-03 15:04 ` [PATCH v6 07/16] x86/hyperv: handling hypercall page setup for root Wei Liu
2021-02-03 15:04 ` [PATCH v6 08/16] ACPI / NUMA: add a stub function for node_to_pxm() Wei Liu
2021-02-04 16:56   ` Michael Kelley via Virtualization
2021-02-04 18:38   ` Wei Liu
2021-02-04 18:45     ` Rafael J. Wysocki
2021-02-04 18:45       ` [Devel] " Rafael J. Wysocki
2021-02-04 18:45       ` Rafael J. Wysocki
2021-02-04 18:48       ` Wei Liu
2021-02-03 15:04 ` [PATCH v6 09/16] x86/hyperv: provide a bunch of helper functions Wei Liu
2021-02-04 17:13   ` Michael Kelley
2021-02-04 17:13     ` Michael Kelley via Virtualization
2021-02-03 15:04 ` [PATCH v6 10/16] x86/hyperv: implement and use hv_smp_prepare_cpus Wei Liu
2021-02-03 15:04 ` [PATCH v6 11/16] asm-generic/hyperv: update hv_msi_entry Wei Liu
2021-02-03 15:04 ` Wei Liu [this message]
2021-02-03 15:04 ` [PATCH v6 13/16] asm-generic/hyperv: introduce hv_device_id and auxiliary structures Wei Liu
2021-02-04 17:15   ` Michael Kelley
2021-02-04 17:15     ` Michael Kelley via Virtualization
2021-02-03 15:04 ` [PATCH v6 14/16] asm-generic/hyperv: import data structures for mapping device interrupts Wei Liu
2021-02-03 15:04 ` [PATCH v6 15/16] x86/hyperv: implement an MSI domain for root partition Wei Liu
2021-02-04 17:43   ` Michael Kelley
2021-02-04 17:43     ` Michael Kelley via Virtualization
2021-02-04 17:56     ` Wei Liu
2021-02-04 18:40       ` Michael Kelley
2021-02-04 18:40         ` Michael Kelley via Virtualization
2021-02-04 18:43         ` Wei Liu
2021-02-03 15:04 ` [PATCH v6 16/16] iommu/hyperv: setup an IO-APIC IRQ remapping " Wei Liu
2021-02-03 15:04   ` Wei Liu
2021-02-04 13:33   ` Joerg Roedel
2021-02-04 13:33     ` Joerg Roedel
2021-02-04 13:33     ` Joerg Roedel
2021-02-04 17:53   ` Michael Kelley
2021-02-04 17:53     ` Michael Kelley via Virtualization
2021-02-04 17:53     ` Michael Kelley via iommu
2021-02-04 19:49 ` [PATCH v6 00/16] Introducing Linux root partition support for Microsoft Hypervisor Wei Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210203150435.27941-13-wei.liu@kernel.org \
    --to=wei.liu@kernel.org \
    --cc=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=haiyangz@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=mikelley@microsoft.com \
    --cc=nunodasneves@linux.microsoft.com \
    --cc=pasha.tatashin@soleen.com \
    --cc=robh@kernel.org \
    --cc=sthemmin@microsoft.com \
    --cc=sunilmut@microsoft.com \
    --cc=viremana@linux.microsoft.com \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.