From: Michael Kelley <mikelley@microsoft.com>
To: Sunil Muthuswamy <sunilmut@linux.microsoft.com>,
KY Srinivasan <kys@microsoft.com>,
Haiyang Zhang <haiyangz@microsoft.com>,
Stephen Hemminger <sthemmin@microsoft.com>,
"wei.liu@kernel.org" <wei.liu@kernel.org>,
"maz@kernel.org" <maz@kernel.org>,
Dexuan Cui <decui@microsoft.com>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"mingo@redhat.com" <mingo@redhat.com>,
"bp@alien8.de" <bp@alien8.de>, "hpa@zytor.com" <hpa@zytor.com>,
"lorenzo.pieralisi@arm.com" <lorenzo.pieralisi@arm.com>,
"robh@kernel.org" <robh@kernel.org>,
"kw@linux.com" <kw@linux.com>,
"bhelgaas@google.com" <bhelgaas@google.com>,
"arnd@arndb.de" <arnd@arndb.de>
Cc: "x86@kernel.org" <x86@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
"linux-arch@vger.kernel.org" <linux-arch@vger.kernel.org>,
Sunil Muthuswamy <sunilmut@microsoft.com>
Subject: RE: [PATCH v5 1/2] PCI: hv: Make the code arch neutral by adding arch specific interfaces
Date: Fri, 12 Nov 2021 00:47:17 +0000 [thread overview]
Message-ID: <MWHPR21MB1593837874B0400A5F400DA1D7959@MWHPR21MB1593.namprd21.prod.outlook.com> (raw)
In-Reply-To: <1636573510-23838-2-git-send-email-sunilmut@linux.microsoft.com>
From: Sunil Muthuswamy <sunilmut@linux.microsoft.com> Sent: Wednesday, November 10, 2021 11:45 AM
>
> Encapsulate arch dependencies in Hyper-V vPCI through a set of
> arch-dependent interfaces. Adding these arch specific interfaces will
> allow for an implementation for other architectures, such as arm64.
>
> There are no functional changes expected from this patch.
>
> Signed-off-by: Sunil Muthuswamy <sunilmut@microsoft.com>
> ---
> In v2, v3, v4 & v5:
> Changes are described in the cover letter. No change from v4 -> v5.
>
> arch/x86/include/asm/hyperv-tlfs.h | 33 ++++++++++++
> arch/x86/include/asm/mshyperv.h | 7 ---
> drivers/pci/controller/pci-hyperv.c | 79 ++++++++++++++++++++---------
> include/asm-generic/hyperv-tlfs.h | 33 ------------
> 4 files changed, 87 insertions(+), 65 deletions(-)
>
[snip]
> diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
> index eaec915ffe62..03e07a4f0e3f 100644
> --- a/drivers/pci/controller/pci-hyperv.c
> +++ b/drivers/pci/controller/pci-hyperv.c
> @@ -43,9 +43,6 @@
> #include <linux/pci-ecam.h>
> #include <linux/delay.h>
> #include <linux/semaphore.h>
> -#include <linux/irqdomain.h>
> -#include <asm/irqdomain.h>
> -#include <asm/apic.h>
> #include <linux/irq.h>
> #include <linux/msi.h>
> #include <linux/hyperv.h>
> @@ -583,6 +580,42 @@ struct hv_pci_compl {
>
> static void hv_pci_onchannelcallback(void *context);
>
> +#ifdef CONFIG_X86
> +#define DELIVERY_MODE APIC_DELIVERY_MODE_FIXED
> +#define FLOW_HANDLER handle_edge_irq
> +#define FLOW_NAME "edge"
> +
> +static int hv_pci_irqchip_init(void)
> +{
> + return 0;
> +}
> +
> +static struct irq_domain *hv_pci_get_root_domain(void)
> +{
> + return x86_vector_domain;
> +}
> +
> +static unsigned int hv_msi_get_int_vector(struct irq_data *data)
> +{
> + struct irq_cfg *cfg = irqd_cfg(data);
> +
> + return cfg->vector;
> +}
> +
> +static void hv_set_msi_entry_from_desc(union hv_msi_entry *msi_entry,
> + struct msi_desc *msi_desc)
> +{
> + msi_entry->address.as_uint32 = msi_desc->msg.address_lo;
> + msi_entry->data.as_uint32 = msi_desc->msg.data;
> +}
> +
> +static int hv_msi_prepare(struct irq_domain *domain, struct device *dev,
> + int nvec, msi_alloc_info_t *info)
> +{
> + return pci_msi_prepare(domain, dev, nvec, info);
> +}
> +#endif // CONFIG_X86
Nit: Use "C" style comments. I.e.:
#endif /* CONFIG_X86 */
Michael
next prev parent reply other threads:[~2021-11-12 0:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-10 19:45 [PATCH v5 0/2] PCI: hv: Hyper-V vPCI for arm64 Sunil Muthuswamy
2021-11-10 19:45 ` [PATCH v5 1/2] PCI: hv: Make the code arch neutral by adding arch specific interfaces Sunil Muthuswamy
2021-11-12 0:47 ` Michael Kelley [this message]
2021-11-16 23:21 ` Boqun Feng
2021-11-10 19:45 ` [PATCH v5 2/2] arm64: PCI: hv: Add support for Hyper-V vPCI Sunil Muthuswamy
2021-11-12 0:50 ` Michael Kelley
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=MWHPR21MB1593837874B0400A5F400DA1D7959@MWHPR21MB1593.namprd21.prod.outlook.com \
--to=mikelley@microsoft.com \
--cc=arnd@arndb.de \
--cc=bhelgaas@google.com \
--cc=bp@alien8.de \
--cc=decui@microsoft.com \
--cc=haiyangz@microsoft.com \
--cc=hpa@zytor.com \
--cc=kw@linux.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=maz@kernel.org \
--cc=mingo@redhat.com \
--cc=robh@kernel.org \
--cc=sthemmin@microsoft.com \
--cc=sunilmut@linux.microsoft.com \
--cc=sunilmut@microsoft.com \
--cc=tglx@linutronix.de \
--cc=wei.liu@kernel.org \
--cc=x86@kernel.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.