Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1335897
| From | Jake Oshins <jakeo@microsoft.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | RE: [PATCH RESEND v2 3/3] PCI: hv: New paravirtual PCI front-end for Hyper-V VMs |
| Date | 2016-02-16 23:50 +0100 |
| Message-ID | <r2WBr-5LU-1@gated-at.bofh.it> (permalink) |
| References | <r0m94-8qa-15@gated-at.bofh.it> <r0m94-8qa-13@gated-at.bofh.it> <r2QZ4-1Yc-9@gated-at.bofh.it> <r2VYK-5w0-17@gated-at.bofh.it> <r2WBr-5LU-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
> -----Original Message----- > From: Bjorn Helgaas [mailto:helgaas@kernel.org] > Sent: Tuesday, February 16, 2016 2:44 PM > To: Jake Oshins <jakeo@microsoft.com> > Cc: bhelgaas@google.com; linux-pci@vger.kernel.org; > gregkh@linuxfoundation.org; KY Srinivasan <kys@microsoft.com>; linux- > kernel@vger.kernel.org; devel@linuxdriverproject.org; olaf@aepfle.de; > apw@canonical.com; vkuznets@redhat.com; tglx@linutronix.de; Haiyang > Zhang <haiyangz@microsoft.com>; marc.zyngier@arm.com; Hadden > Hoppert <haddenh@microsoft.com> > Subject: Re: [PATCH RESEND v2 3/3] PCI: hv: New paravirtual PCI front-end > for Hyper-V VMs > > On Tue, Feb 16, 2016 at 09:46:55PM +0000, Jake Oshins wrote: > > > -----Original Message----- > > > From: Bjorn Helgaas [mailto:helgaas@kernel.org] > > > Sent: Tuesday, February 16, 2016 8:46 AM > > > To: Jake Oshins <jakeo@microsoft.com> > > > Cc: bhelgaas@google.com; linux-pci@vger.kernel.org; > > > gregkh@linuxfoundation.org; KY Srinivasan <kys@microsoft.com>; > > > linux- kernel@vger.kernel.org; devel@linuxdriverproject.org; > > > olaf@aepfle.de; apw@canonical.com; vkuznets@redhat.com; > > > tglx@linutronix.de; Haiyang Zhang <haiyangz@microsoft.com>; > > > marc.zyngier@arm.com; Hadden Hoppert <haddenh@microsoft.com> > > > Subject: Re: [PATCH RESEND v2 3/3] PCI: hv: New paravirtual PCI > > > front-end for Hyper-V VMs > > > > > > Hi Jake, > > > > > > Looks good to me overall; I marked a few nits below. > > > > > > The only real question I have is about domain number allocation. > > > See the note below. > > > > > [snip] > > > > + > > > > + /* > > > > + * The PCI bus "domain" is what is called "segment" in > > > > + * ACPI and other specs. Pull it from the instance ID, > > > > + * to get something unique. Bytes 8 and 9 are what is used > > > > + * in Windows guests, so do the same thing for consistency. > > > > + */ > > > > + > > > > + hbus->sysdata.domain = hdev->dev_instance.b[9] | > > > > + hdev->dev_instance.b[8] << 8; > > > > > > How do we know this is unique? We don't have any idea what the > > > platform will put in _SEG, so I think there's a potential conflict > > > here. The Intel VMD driver (arch/x86/pci/vmd.c) has a similar > > > problem, and it looks for unused domain numbers starting at 0x10000 > > > (see vmd_find_free_domain()). > > > > > > > Bjorn, thank you for your very thorough reviews. I deeply appreciate it. I > checked the Hyper-V code and it currently does guarantee that these values > are unique. When I resend the series, I'll add a comment to that effect. I'll > also add a comment to Hyper-V that says that it has to stay that way. > > I'm not familiar with how Hyper-V works, but I guess you're saying that > Hyper-V controls what the guest sees via _SEG as well as what it sees via the > instance ID. > > Bjorn Yes, exactly. To the point, the Hyper-V Generation 1 VM (which is an emulation of a 440BX/PIIX4 platform) has one root PCI bus with no _SEG object at all, which implies a value of zero. The Hyper-V Generation 2 VM (which doesn't emulate any existing machine) doesn't have any root PCI bus at all until a device is passed through and this driver is loaded. -- Jake
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH RESEND v2 0/3] PCI: hv: New paravirtual PCI front-end driver jakeo@microsoft.com - 2016-02-09 20:30 +0100
[PATCH RESEND v2 1/3] PCI: Add fwnode_handle to pci_sysdata jakeo@microsoft.com - 2016-02-09 20:30 +0100
[PATCH RESEND v2 2/3] PCI: irqdomain: Look up IRQ domain by fwnode_handle jakeo@microsoft.com - 2016-02-09 20:30 +0100
RE: [PATCH RESEND v2 3/3] PCI: hv: New paravirtual PCI front-end for Hyper-V VMs Jake Oshins <jakeo@microsoft.com> - 2016-02-16 23:10 +0100
RE: [PATCH RESEND v2 3/3] PCI: hv: New paravirtual PCI front-end for Hyper-V VMs Jake Oshins <jakeo@microsoft.com> - 2016-02-16 23:50 +0100
Re: [PATCH RESEND v2 3/3] PCI: hv: New paravirtual PCI front-end for Hyper-V VMs Bjorn Helgaas <helgaas@kernel.org> - 2016-02-16 23:50 +0100
csiph-web