lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 10 May 2021 15:04:49 +0800
From:   Boqun Feng <boqun.feng@...il.com>
To:     Bjorn Helgaas <helgaas@...nel.org>
Cc:     Bjorn Helgaas <bhelgaas@...gle.com>, Arnd Bergmann <arnd@...db.de>,
        Marc Zyngier <maz@...nel.org>,
        Russell King <linux@...linux.org.uk>,
        Andrew Lunn <andrew@...n.ch>,
        Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>,
        Gregory Clement <gregory.clement@...tlin.com>,
        Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will@...nel.org>,
        Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
        Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
        Rob Herring <robh@...nel.org>,
        "K. Y. Srinivasan" <kys@...rosoft.com>,
        Haiyang Zhang <haiyangz@...rosoft.com>,
        Stephen Hemminger <sthemmin@...rosoft.com>,
        Wei Liu <wei.liu@...nel.org>,
        Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
        Mike Rapoport <rppt@...nel.org>,
        Robin Murphy <robin.murphy@....com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Jon Derrick <jonathan.derrick@...el.com>,
        Sunil Muthuswamy <sunilmut@...rosoft.com>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        linux-mips@...r.kernel.org, linux-pci@...r.kernel.org,
        linux-hyperv@...r.kernel.org
Subject: Re: [RFC v2 6/7] PCI: arm64: Allow pci_config_window::parent to be
 NULL

On Thu, May 06, 2021 at 05:25:30PM -0500, Bjorn Helgaas wrote:
> Make your subject something like this so it matches previous practice:
> 
>   arm64: PCI: ...
> 

Got it.

> The "::" notation probably comes from C++, but doesn't really apply in
> C.  In C, we would say "cfg.parent" or "cfg->parent".
> 
> But pci_config_window and cfg->parent are probably too low-level for
> the subject anyway.  Seems like it should mention Hyper-V, for
> instance.
> 

I'm going to make the title something like:

   arm64: PCI: Support root bridge preparation for Hyper-V PCI

works for you? Also I will add comment inside the function as
explanation.

> On Mon, May 03, 2021 at 10:46:34PM +0800, Boqun Feng wrote:
> > This is purely a hack, for ARM64 Hyper-V guest, there is no
> > corresponding ACPI device for the root bridge, so the best we can
> > provide is an all-zeroed pci_config_window, and in this case make
> > pcibios_root_bridge_prepare() act as the ACPI device is NULL.
> 
> Why is there no ACPI device?  Is this a needless arch dependency?  Or
> is this related to using DT instead of ACPI?
> 

For Hyper-V virtual PCI host bridges, neither DT or ACPI is used to
describe them, a hypervisor-specific mechanism (VMBus) is used to
enumerate PCI host bridges. So actually on x86, Hyper-V PCI host
bridge's ACPI companion is set as NULL.

> The cover letter hints that this might be related to
> PCI_DOMAINS_GENERIC=y, but that doesn't sound like a very convincing
> reason (and the cover letter can provide an overview, but the commit
> logs of individual patches shouldn't assume knowledge of the cover
> letter).
> 

Ok, I will add a better explanation in the commit log in the next
version. Thanks!

Regards,
Boqun

> > Signed-off-by: Boqun Feng <boqun.feng@...il.com>
> > ---
> >  arch/arm64/kernel/pci.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c
> > index e9a6eeb6a694..f159df903ccb 100644
> > --- a/arch/arm64/kernel/pci.c
> > +++ b/arch/arm64/kernel/pci.c
> > @@ -83,7 +83,7 @@ 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);
> > +		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);
> > -- 
> > 2.30.2
> > 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ