PCI: hv: Support host bridge probing on ARM64
Subsystems (5)
v3 cover PCI: hv: Support host bridge probing on ARM64
Hi Bjorn, Arnd and Marc,
This is the v3 for the preparation of virtual PCI support on Hyper-V ARM64. Previous versions:
v1: https://lore.kernel.org/lkml/[email protected]/
v2: https://lore.kernel.org/lkml/[email protected]/
Changes since last version:
* Use a sentinel value approach instead of calling
pci_bus_find_domain_nr() for every CONFIG_PCI_DOMAIN_GENERIC=y arch as per suggestion from
* Improve the commit log and comments for patch #6.
* Rebase to the latest mainline.
The basic problem we need to resolve is that ARM64 is an arch with PCI_DOMAINS_GENERIC=y, so the bus sysdata is pci_config_window. However, Hyper-V PCI provides a paravirtualized PCI interface, so there is no actual pci_config_window for a PCI host bridge, so no information can be retrieve from the pci_config_window of a Hyper-V virtual PCI bus. Also there is no corresponding ACPI device for the Hyper-V PCI root bridge.
With this patchset, we could enable the virtual PCI on Hyper-V ARM64 guest with other code under development.
Comments and suggestions are welcome.
Regards,
Boqun
Arnd Bergmann (1):
PCI: hv: Generify PCI probing
Boqun Feng (6):
PCI: Introduce domain_nr in pci_host_bridge
PCI: Allow msi domain set-up at host probing time
PCI: hv: Use pci_host_bridge::domain_nr for PCI domain
PCI: hv: Set up msi domain at bridge probing time
arm64: PCI: Support root bridge preparation for Hyper-V PCI
PCI: hv: Turn on the host bridge probing on ARM64
arch/arm64/kernel/pci.c | 7 ++- drivers/pci/controller/pci-hyperv.c | 87 +++++++++++++++++------------ drivers/pci/probe.c | 9 ++- include/linux/pci.h | 10 ++++ 4 files changed, 73 insertions(+), 40 deletions(-)
Signature · 1 line
2.30.2
RFC v3 1/7 PCI: Introduce domain_nr in pci_host_bridge
Currently we retrieve the PCI domain number of the host bridge from the bus sysdata (or pci_config_window if PCI_DOMAINS_GENERIC=y). Actually we have the information at PCI host bridge probing time, and it makes sense that we store it into pci_host_bridge. One benefit of doing so is the requirement for supporting PCI on Hyper-V for ARM64, because the host bridge of Hyper-V doesn't have pci_config_window, whereas ARM64 is a PCI_DOMAINS_GENERIC=y arch, so we cannot retrieve the PCI domain number from pci_config_window on ARM64 Hyper-V guest.
As the preparation for ARM64 Hyper-V PCI support, we introduce the domain_nr in pci_host_bridge and a sentinel value to allow drivers to set domain numbers properly at probing time. Currently CONFIG_PCI_DOMAINS_GENERIC=y archs are only users of this newly-introduced field.
--- drivers/pci/probe.c | 4 +++- include/linux/pci.h | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-)
drivers/pci/probe.c +3 -1
@@ -594,6 +594,7 @@ static void pci_init_host_bridge(struct pci_host_bridge *bridge) bridge->native_pme =1 ; bridge->native_ltr =1 ; bridge->native_dpc =1 ; + bridge->domain_nr =PCI_DOMAIN_NR_NOT_SET ;device_initialize (&bridge->dev); }
@@ -898,7 +899,8 @@ static int pci_register_host_bridge(struct pci_host_bridge *bridge) bus->ops = bridge->ops; bus->number = bus->busn_res.start = bridge->busnr;#ifdef CONFIG_PCI_DOMAINS_GENERIC - bus->domain_nr =pci_bus_find_domain_nr (bus, parent); +if (bridge->domain_nr ==PCI_DOMAIN_NR_NOT_SET ) + bus->domain_nr =pci_bus_find_domain_nr (bus, parent);#endif b =pci_find_bus (pci_domain_nr (bus), bridge->busnr);
include/linux/pci.h +10 -0
@@ -526,6 +526,15 @@ static inline int pci_channel_offline(struct pci_dev *pdev)return (pdev->error_state != pci_channel_io_normal); } +/* +* PCI Conventional has at most 256 PCI bus segments and PCI Express has at +* most 65536 "PCI Segments Groups", therefore -1 is not a valid PCI domain +* number, and can be used as a sentinel value indicating ->domain_nr is not +* set by the driver (and CONFIG_PCI_DOMAINS_GENERIC=y can set it in generic +* code). +*/ +#define PCI_DOMAIN_NR_NOT_SET (-1) +struct pci_host_bridge {struct device dev;struct pci_bus *bus;/* Root bus */
@@ -533,6 +542,7 @@ struct pci_host_bridge {struct pci_ops *child_ops;void *sysdata;int busnr; +int domain_nr;struct list_head windows;/* resource_entry */ struct list_head dma_ranges;/* dma ranges resource list */ u8 (*swizzle_irq)(struct pci_dev *,u8 *);/* Platform IRQ swizzler */
Signature · 1 line
2.30.2
RFC v3 2/7 PCI: Allow msi domain set-up at host probing time
In reply to Boqun FengFor GENERIC_MSI_IRQ_DOMAIN drivers, we can set up the msi domain via dev_set_msi_domain() at probing time, and drivers can use this more generic way to set up the msi domain for the host bridge.
This is the preparation for ARM64 Hyper-V PCI support.
--- drivers/pci/probe.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/pci/probe.c +4 -1
@@ -829,11 +829,14 @@ static struct irq_domain *pci_host_bridge_msi_domain(struct pci_bus *bus) {struct irq_domain *d; +/* Default set by host bridge driver */ + d =dev_get_msi_domain (bus->bridge);/* * Any firmware interface that can resolve the msi_domain * should be called from here. */ - d =pci_host_bridge_of_msi_domain (bus); +if (!d) + d =pci_host_bridge_of_msi_domain (bus);if (!d) d =pci_host_bridge_acpi_msi_domain (bus);
Signature · 1 line
2.30.2
RFC v3 3/7 PCI: hv: Generify PCI probing
In reply to Boqun FengFrom: Arnd Bergmann <[email protected]>
In order to support ARM64 Hyper-V PCI, we need to set up the bridge at probing time because ARM64 is a PCI_DOMAIN_GENERIC arch and we don't have pci_config_window (ARM64 sysdata) for a PCI root bus on Hyper-V, so it's impossible to retrieve the information (e.g. PCI domains, irq domains) from bus sysdata on ARM64 after creation.
Originally in create_root_hv_pci_bus(), pci_create_root_bus() is used to create the root bus and the corresponding bridge based on x86 sysdata. Now we create a bridge first and then call pci_scan_root_bus_bridge(), which allows us to do the necessary set-ups for the bridge.
--- drivers/pci/controller/pci-hyperv.c | 58 +++++++++++++++-------------- 1 file changed, 30 insertions(+), 28 deletions(-)
drivers/pci/controller/pci-hyperv.c +30 -28
@@ -450,6 +450,7 @@ enum hv_pcibus_state {struct hv_pcibus_device {struct pci_sysdata sysdata; +struct pci_host_bridge *bridge;/* Protocol version negotiated with the host */ enum pci_protocol_version_t protocol_version;enum hv_pcibus_state state;
@@ -462,13 +463,10 @@ struct hv_pcibus_device {struct resource *high_mmio_res;struct completion *survey_event;struct completion remove_event; -struct pci_bus *pci_bus;spinlock_t config_lock;/* Avoid two threads writing index page */ spinlock_t device_list_lock;/* Protect lists below */ void __iomem *cfg_addr; -struct list_head resources_for_children; -struct list_head children;struct list_head dr_list;
@@ -1803,7 +1801,7 @@ static void hv_pci_assign_slots(struct hv_pcibus_device *hbus) slot_nr =PCI_SLOT (wslot_to_devfn (hpdev->desc.win_slot.slot));snprintf (name,SLOT_NAME_SIZE ,"%u" , hpdev->desc.ser); - hpdev->pci_slot =pci_create_slot (hbus->pci_bus, slot_nr, + hpdev->pci_slot =pci_create_slot (hbus->bridge->bus, slot_nr, name,NULL );if (IS_ERR (hpdev->pci_slot)) {pr_warn ("pci_create slot %s failed\n" , name);
@@ -1833,7 +1831,7 @@ static void hv_pci_remove_slots(struct hv_pcibus_device *hbus)static void hv_pci_assign_numa_node (struct hv_pcibus_device *hbus) {struct pci_dev *dev; -struct pci_bus *bus = hbus->pci_bus; +struct pci_bus *bus = hbus->bridge->bus;struct hv_pci_dev *hv_dev;list_for_each_entry (dev, &bus->devices, bus_list) {
@@ -1856,21 +1854,22 @@ static void hv_pci_assign_numa_node(struct hv_pcibus_device *hbus)*/ static int create_root_hv_pci_bus (struct hv_pcibus_device *hbus) { -/* Register the device */ - hbus->pci_bus =pci_create_root_bus (&hbus->hdev->device, -0 ,/* bus number is always zero */ - &hv_pcifront_ops, - &hbus->sysdata, - &hbus->resources_for_children); -if (!hbus->pci_bus) -return -ENODEV ; +int error; +struct pci_host_bridge *bridge = hbus->bridge; + + bridge->dev.parent = &hbus->hdev->device; + bridge->sysdata = &hbus->sysdata; + bridge->ops = &hv_pcifront_ops; + + error =pci_scan_root_bus_bridge (bridge); +if (error) +return error;pci_lock_rescan_remove (); -pci_scan_child_bus (hbus->pci_bus);hv_pci_assign_numa_node (hbus); -pci_bus_assign_resources (hbus->pci_bus); +pci_bus_assign_resources (bridge->bus);hv_pci_assign_slots (hbus); -pci_bus_add_devices (hbus->pci_bus); +pci_bus_add_devices (bridge->bus);pci_unlock_rescan_remove (); hbus->state = hv_pcibus_installed;return 0 ;
@@ -2135,7 +2134,7 @@ static void pci_devices_present_work(struct work_struct *work)* because there may have been changes. */ pci_lock_rescan_remove (); -pci_scan_child_bus (hbus->pci_bus); +pci_scan_child_bus (hbus->bridge->bus);hv_pci_assign_numa_node (hbus);hv_pci_assign_slots (hbus);pci_unlock_rescan_remove ();
@@ -2306,8 +2305,8 @@ static void hv_eject_device_work(struct work_struct *work)/* * Ejection can come before or after the PCI bus has been set up, so * attempt to find it and tear down the bus state, if it exists. This -* must be done without constructs like pci_domain_nr(hbus->pci_bus) -* because hbus->pci_bus may not exist yet. +* must be done without constructs like pci_domain_nr(hbus->bridge->bus) +* because hbus->bridge->bus may not exist yet. */ wslot =wslot_to_devfn (hpdev->desc.win_slot.slot); pdev =pci_get_domain_bus_and_slot (hbus->sysdata.domain,0 , wslot);
@@ -2676,8 +2675,7 @@ static int hv_pci_allocate_bridge_windows(struct hv_pcibus_device *hbus)/* Modify this resource to become a bridge window. */ hbus->low_mmio_res->flags |=IORESOURCE_WINDOW ; hbus->low_mmio_res->flags &= ~IORESOURCE_BUSY ; -pci_add_resource (&hbus->resources_for_children, - hbus->low_mmio_res); +pci_add_resource (&hbus->bridge->windows, hbus->low_mmio_res); }if (hbus->high_mmio_space) {
@@ -2696,8 +2694,7 @@ static int hv_pci_allocate_bridge_windows(struct hv_pcibus_device *hbus)/* Modify this resource to become a bridge window. */ hbus->high_mmio_res->flags |=IORESOURCE_WINDOW ; hbus->high_mmio_res->flags &= ~IORESOURCE_BUSY ; -pci_add_resource (&hbus->resources_for_children, - hbus->high_mmio_res); +pci_add_resource (&hbus->bridge->windows, hbus->high_mmio_res); }return 0 ;
@@ -3027,6 +3024,7 @@ static void hv_put_dom_num(u16 dom)static int hv_pci_probe (struct hv_device *hdev,const struct hv_vmbus_device_id *dev_id) { +struct pci_host_bridge *bridge;struct hv_pcibus_device *hbus;u16 dom_req, dom;char *name;
@@ -3039,6 +3037,10 @@ static int hv_pci_probe(struct hv_device *hdev,*/ BUILD_BUG_ON (sizeof (*hbus) >HV_HYP_PAGE_SIZE ); + bridge =devm_pci_alloc_host_bridge (&hdev->device,0 ); +if (!bridge) +return -ENOMEM ; +/* * With the recent 59bb47985c1d ("mm, sl[aou]b: guarantee natural * alignment for kmalloc(power-of-two)"), kzalloc() is able to allocate
@@ -3060,6 +3062,8 @@ static int hv_pci_probe(struct hv_device *hdev, hbus =kzalloc (HV_HYP_PAGE_SIZE ,GFP_KERNEL );if (!hbus)return -ENOMEM ; + + hbus->bridge = bridge; hbus->state = hv_pcibus_init; hbus->wslot_res_allocated =-1 ;
@@ -3097,7 +3101,6 @@ static int hv_pci_probe(struct hv_device *hdev,refcount_set (&hbus->remove_lock,1 );INIT_LIST_HEAD (&hbus->children);INIT_LIST_HEAD (&hbus->dr_list); -INIT_LIST_HEAD (&hbus->resources_for_children);spin_lock_init (&hbus->config_lock);spin_lock_init (&hbus->device_list_lock);spin_lock_init (&hbus->retarget_msi_interrupt_lock);
@@ -3303,9 +3306,9 @@ static int hv_pci_remove(struct hv_device *hdev)if (hbus->state == hv_pcibus_installed) {/* Remove the bus from PCI's point of view. */ pci_lock_rescan_remove (); -pci_stop_root_bus (hbus->pci_bus); +pci_stop_root_bus (hbus->bridge->bus);hv_pci_remove_slots (hbus); -pci_remove_root_bus (hbus->pci_bus); +pci_remove_root_bus (hbus->bridge->bus);pci_unlock_rescan_remove (); hbus->state = hv_pcibus_removed; }
@@ -3316,7 +3319,6 @@ static int hv_pci_remove(struct hv_device *hdev)iounmap (hbus->cfg_addr);hv_free_config_window (hbus); -pci_free_resource_list (&hbus->resources_for_children);hv_pci_free_bridge_windows (hbus);irq_domain_remove (hbus->irq_domain);irq_domain_free_fwnode (hbus->sysdata.fwnode);
@@ -3402,7 +3404,7 @@ static int hv_pci_restore_msi_msg(struct pci_dev *pdev, void *arg)*/ static void hv_pci_restore_msi_state (struct hv_pcibus_device *hbus) { -pci_walk_bus (hbus->pci_bus, hv_pci_restore_msi_msg,NULL ); +pci_walk_bus (hbus->bridge->bus, hv_pci_restore_msi_msg,NULL ); }static int hv_pci_resume (struct hv_device *hdev)
Signature · 1 line
2.30.2
RFC v3 4/7 PCI: hv: Use pci_host_bridge::domain_nr for PCI domain
In reply to Boqun FengNo functional change, just store and maintain the PCI domain number in the generic pci_host_bridge instead of x86 specific pci_sysdata.
--- drivers/pci/controller/pci-hyperv.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/pci/controller/pci-hyperv.c +5 -4
@@ -2309,7 +2309,7 @@ static void hv_eject_device_work(struct work_struct *work)* because hbus->bridge->bus may not exist yet. */ wslot =wslot_to_devfn (hpdev->desc.win_slot.slot); - pdev =pci_get_domain_bus_and_slot (hbus->sysdata.domain,0 , wslot); + pdev =pci_get_domain_bus_and_slot (hbus->bridge->domain_nr,0 , wslot);if (pdev) {pci_lock_rescan_remove ();pci_stop_and_remove_bus_device (pdev);
@@ -3095,6 +3095,7 @@ static int hv_pci_probe(struct hv_device *hdev,"PCI dom# 0x%hx has collision, using 0x%hx" , dom_req, dom); + hbus->bridge->domain_nr = dom; hbus->sysdata.domain = dom; hbus->hdev = hdev;
@@ -3106,7 +3107,7 @@ static int hv_pci_probe(struct hv_device *hdev,spin_lock_init (&hbus->retarget_msi_interrupt_lock);init_completion (&hbus->remove_event); hbus->wq =alloc_ordered_workqueue ("hv_pci_%x" ,0 , - hbus->sysdata.domain); + hbus->bridge->domain_nr);if (!hbus->wq) { ret = -ENOMEM ; goto free_dom;
@@ -3233,7 +3234,7 @@ static int hv_pci_probe(struct hv_device *hdev, destroy_wq:destroy_workqueue (hbus->wq); free_dom: -hv_put_dom_num (hbus->sysdata.domain); +hv_put_dom_num (hbus->bridge->domain_nr); free_bus:kfree (hbus);return ret;
@@ -3326,7 +3327,7 @@ static int hv_pci_remove(struct hv_device *hdev)wait_for_completion (&hbus->remove_event);destroy_workqueue (hbus->wq); -hv_put_dom_num (hbus->sysdata.domain); +hv_put_dom_num (hbus->bridge->domain_nr);kfree (hbus);return ret;
Signature · 1 line
2.30.2
RFC v3 5/7 PCI: hv: Set up msi domain at bridge probing time
In reply to Boqun FengSince PCI_HYPERV depends on PCI_MSI_IRQ_DOMAIN which selects GENERIC_MSI_IRQ_DOMAIN, we can use dev_set_msi_domain() to set up the msi irq domain at probing time, and this works for both x86 and ARM64.
Therefore use it as the preparation for ARM64 Hyper-V PCI support.
As a result, there is no need to set the pci_sysdata::fwnode which is x86 specific. In addition, make hv_pcibus_device own the fwnode instead of sysdata to make the code generic.
--- drivers/pci/controller/pci-hyperv.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/pci/controller/pci-hyperv.c +8 -5
@@ -451,6 +451,7 @@ enum hv_pcibus_state {struct hv_pcibus_device {struct pci_sysdata sysdata;struct pci_host_bridge *bridge; +struct fwnode_handle *fwnode;/* Protocol version negotiated with the host */ enum pci_protocol_version_t protocol_version;enum hv_pcibus_state state;
@@ -1570,7 +1571,7 @@ static int hv_pcie_init_irq_domain(struct hv_pcibus_device *hbus) hbus->msi_info.handler = handle_edge_irq; hbus->msi_info.handler_name ="edge" ; hbus->msi_info.data = hbus; - hbus->irq_domain =pci_msi_create_irq_domain (hbus->sysdata.fwnode, + hbus->irq_domain =pci_msi_create_irq_domain (hbus->fwnode, &hbus->msi_info, x86_vector_domain);if (!hbus->irq_domain) {
@@ -1579,6 +1580,8 @@ static int hv_pcie_init_irq_domain(struct hv_pcibus_device *hbus)return -ENODEV ; } +dev_set_msi_domain (&hbus->bridge->dev, hbus->irq_domain); +return 0 ; }
@@ -3144,9 +3147,9 @@ static int hv_pci_probe(struct hv_device *hdev, goto unmap; } - hbus->sysdata.fwnode =irq_domain_alloc_named_fwnode (name); + hbus->fwnode =irq_domain_alloc_named_fwnode (name);kfree (name); -if (!hbus->sysdata.fwnode) { +if (!hbus->fwnode) { ret = -ENOMEM ; goto unmap; }
@@ -3224,7 +3227,7 @@ static int hv_pci_probe(struct hv_device *hdev, free_irq_domain:irq_domain_remove (hbus->irq_domain); free_fwnode: -irq_domain_free_fwnode (hbus->sysdata.fwnode); +irq_domain_free_fwnode (hbus->fwnode); unmap:iounmap (hbus->cfg_addr); free_config:
@@ -3322,7 +3325,7 @@ static int hv_pci_remove(struct hv_device *hdev)hv_free_config_window (hbus);hv_pci_free_bridge_windows (hbus);irq_domain_remove (hbus->irq_domain); -irq_domain_free_fwnode (hbus->sysdata.fwnode); +irq_domain_free_fwnode (hbus->fwnode);put_hvpcibus (hbus);wait_for_completion (&hbus->remove_event);destroy_workqueue (hbus->wq);
Signature · 1 line
2.30.2
RFC v3 6/7 arm64: PCI: Support root bridge preparation for Hyper-V PCI
In reply to Boqun FengCurrently at root bridge preparation, the corresponding ACPI device will be set as the companion, however for a Hyper-V virtual PCI root bridge, there is no corresponding ACPI device, because a Hyper-V virtual PCI root bridge is discovered via VMBus rather than ACPI table. In order to support this, we need to make pcibios_root_bridge_prepare() work with cfg->parent being NULL.
--- arch/arm64/kernel/pci.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
arch/arm64/kernel/pci.c +6 -1
@@ -84,7 +84,12 @@ int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge) {if (!acpi_disabled) {struct pci_config_window *cfg = bridge->bus->sysdata; -struct acpi_device *adev =to_acpi_device (cfg->parent); +/* +* On Hyper-V, there is no corresponding APCI device for a root +* bridge, therefore ->parent is set as NULL by the driver. Then +* 'adev' should be NULL in this case. +*/ +struct acpi_device *adev = cfg->parent ?to_acpi_device (cfg->parent) :NULL ;struct device *bus_dev = &bridge->bus->dev;ACPI_COMPANION_SET (&bridge->dev, adev);
Signature · 1 line
2.30.2
RFC v3 7/7 PCI: hv: Turn on the host bridge probing on ARM64
In reply to Boqun FengNow we have everything we need, just provide a proper sysdata type for the bus to use on ARM64 and everything else works.
--- drivers/pci/controller/pci-hyperv.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/pci/controller/pci-hyperv.c +7 -0
@@ -40,6 +40,7 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/pci.h> +#include <linux/pci-ecam.h> #include <linux/delay.h> #include <linux/semaphore.h> #include <linux/irqdomain.h>
@@ -449,7 +450,11 @@ enum hv_pcibus_state { };struct hv_pcibus_device { +#ifdef CONFIG_X86 struct pci_sysdata sysdata; +#elif defined(CONFIG_ARM64 ) +struct pci_config_window sysdata; +#endif struct pci_host_bridge *bridge;struct fwnode_handle *fwnode;/* Protocol version negotiated with the host */
@@ -3099,7 +3104,9 @@ static int hv_pci_probe(struct hv_device *hdev, dom_req, dom); hbus->bridge->domain_nr = dom; +#ifdef CONFIG_X86 hbus->sysdata.domain = dom; +#endif hbus->hdev = hdev;refcount_set (&hbus->remove_lock,1 );
Signature · 1 line
2.30.2
Quoted 3 lines · Boqun Feng
Hi Bjorn, Arnd and Marc,
Instead of cc'ing Arnd, you cc'ed me (Ard)
Quoted 51 lines
This is the v3 for the preparation of virtual PCI support on Hyper-V ARM64. Previous versions:
v1: https://lore.kernel.org/lkml/[email protected]/ v2: https://lore.kernel.org/lkml/[email protected]/Changes since last version:
* Use a sentinel value approach instead of calling
pci_bus_find_domain_nr()for everyCONFIG_PCI_DOMAIN_GENERIC=yarch as per suggestion from* Improve the commit log and comments for patch #6.
* Rebase to the latest mainline.
The basic problem we need to resolve is that ARM64 is an arch with PCI_DOMAINS_GENERIC=y, so the bus sysdata is
pci_config_window. However, Hyper-V PCI provides a paravirtualized PCI interface, so there is no actualpci_config_windowfor a PCI host bridge, so no information can be retrieve from thepci_config_windowof a Hyper-V virtual PCI bus. Also there is no corresponding ACPI device for the Hyper-V PCI root bridge.With this patchset, we could enable the virtual PCI on Hyper-V ARM64 guest with other code under development.
Comments and suggestions are welcome.
Regards,
BoqunArnd Bergmann (1):
PCI: hv: Generify PCI probingBoqun Feng (6):
PCI: Introducedomain_nrinpci_host_bridge
PCI: Allow msi domain set-up at host probing time
PCI: hv: Usepci_host_bridge::domain_nrfor PCI domain
PCI: hv: Set up msi domain at bridge probing time
arm64: PCI: Support root bridge preparation for Hyper-V PCI
PCI: hv: Turn on the host bridge probing on ARM64arch/arm64/kernel/pci.c | 7 ++- drivers/pci/controller/pci-hyperv.c | 87 +++++++++++++++++------------ drivers/pci/probe.c | 9 ++- include/linux/pci.h | 10 ++++ 4 files changed, 73 insertions(+), 40 deletions(-)--
2.30.2
Quoted 6 lines · Ard Biesheuvel
Quoted 3 lines · Boqun Feng
Hi Bjorn, Arnd and Marc,
Instead of cc'ing Arnd, you cc'ed me (Ard)
And I don't know if you intended to Cc me, but you definitely didn't.
Thanks,
M.
Quoted 58 lines
Quoted 50 lines
This is the v3 for the preparation of virtual PCI support on Hyper-V ARM64. Previous versions:
v1: https://lore.kernel.org/lkml/[email protected]/ v2: https://lore.kernel.org/lkml/[email protected]/Changes since last version:
* Use a sentinel value approach instead of calling
pci_bus_find_domain_nr()for everyCONFIG_PCI_DOMAIN_GENERIC=yarch as per suggestion from* Improve the commit log and comments for patch #6.
* Rebase to the latest mainline.
The basic problem we need to resolve is that ARM64 is an arch with PCI_DOMAINS_GENERIC=y, so the bus sysdata is
pci_config_window. However, Hyper-V PCI provides a paravirtualized PCI interface, so there is no actualpci_config_windowfor a PCI host bridge, so no information can be retrieve from thepci_config_windowof a Hyper-V virtual PCI bus. Also there is no corresponding ACPI device for the Hyper-V PCI root bridge.With this patchset, we could enable the virtual PCI on Hyper-V ARM64 guest with other code under development.
Comments and suggestions are welcome.
Regards,
BoqunArnd Bergmann (1):
PCI: hv: Generify PCI probingBoqun Feng (6):
PCI: Introducedomain_nrinpci_host_bridge
PCI: Allow msi domain set-up at host probing time
PCI: hv: Usepci_host_bridge::domain_nrfor PCI domain
PCI: hv: Set up msi domain at bridge probing time
arm64: PCI: Support root bridge preparation for Hyper-V PCI
PCI: hv: Turn on the host bridge probing on ARM64arch/arm64/kernel/pci.c | 7 ++- drivers/pci/controller/pci-hyperv.c | 87 +++++++++++++++++------------ drivers/pci/probe.c | 9 ++- include/linux/pci.h | 10 ++++ 4 files changed, 73 insertions(+), 40 deletions(-)Quoted 3 lines
--
2.30.2_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 1 line
Who you jivin' with that Cosmik Debris?
Quoted 10 lines · Marc Zyngier
Quoted 6 lines · Ard Biesheuvel
Quoted 3 lines · Boqun Feng
Hi Bjorn, Arnd and Marc,
Instead of cc'ing Arnd, you cc'ed me (Ard)
And I don't know if you intended to Cc me, but you definitely didn't.
Weird.. seems my sending script got somewhere wrong. Apologies for you both, and Arnd.. I did intend to Cc you and Arnd.
How do you want this to proceed? I could do a resend right now, or I could wait for a few days (and see others' feedback) and send a V4 next week. Sorry again ;-(
Regards,
Boqun
Quoted 67 lines
Thanks,
M.Quoted 60 lines
Quoted 52 lines
This is the v3 for the preparation of virtual PCI support on Hyper-V ARM64. Previous versions:
v1: https://lore.kernel.org/lkml/[email protected]/ v2: https://lore.kernel.org/lkml/[email protected]/Changes since last version:
* Use a sentinel value approach instead of calling
pci_bus_find_domain_nr()for everyCONFIG_PCI_DOMAIN_GENERIC=yarch as per suggestion from* Improve the commit log and comments for patch #6.
* Rebase to the latest mainline.
The basic problem we need to resolve is that ARM64 is an arch with PCI_DOMAINS_GENERIC=y, so the bus sysdata is
pci_config_window. However,
Hyper-V PCI provides a paravirtualized PCI interface, so there is no actualpci_config_windowfor a PCI host bridge, so no information can be
retrieve from thepci_config_windowof a Hyper-V virtual PCI bus. Also there is no corresponding ACPI device for the Hyper-V PCI root bridge.With this patchset, we could enable the virtual PCI on Hyper-V ARM64 guest with other code under development.
Comments and suggestions are welcome.
Regards,
BoqunArnd Bergmann (1):
PCI: hv: Generify PCI probingBoqun Feng (6):
PCI: Introducedomain_nrinpci_host_bridge
PCI: Allow msi domain set-up at host probing time
PCI: hv: Usepci_host_bridge::domain_nrfor PCI domain
PCI: hv: Set up msi domain at bridge probing time
arm64: PCI: Support root bridge preparation for Hyper-V PCI
PCI: hv: Turn on the host bridge probing on ARM64arch/arm64/kernel/pci.c | 7 ++- drivers/pci/controller/pci-hyperv.c | 87 +++++++++++++++++------------ drivers/pci/probe.c | 9 ++- include/linux/pci.h | 10 ++++ 4 files changed, 73 insertions(+), 40 deletions(-)Quoted 3 lines
--
2.30.2_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernelSignature · 1 line
Who you jivin' with that Cosmik Debris?
Quoted 7 lines · Boqun Feng
Quoted 6 lines · Marc Zyngier
Quoted 5 lines · Ard Biesheuvel
Quoted 3 lines · Boqun Feng
Hi Bjorn, Arnd and Marc,
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Instead of cc'ing Arnd, you cc'ed me (Ard)
And I don't know if you intended to Cc me, but you definitely didn't.
Weird.. seems my sending script got somewhere wrong. Apologies for you both, and Arnd.. I did intend to Cc you and Arnd.
No worries, it happens (I also used the wrong email address when replying, so we're even).
Quoted 3 lines
How do you want this to proceed? I could do a resend right now, or I could wait for a few days (and see others' feedback) and send a V4 next week. Sorry again ;-(
Let the current series simmer on the list for a few days, I can always eyeball it there if I'm short of patches to review... ;-)
Thanks,
M.
Signature · 1 line
Jazz is not dead. It just smells funny...