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]
Message-ID: <20200131110610.GA32701@e121166-lin.cambridge.arm.com>
Date:   Fri, 31 Jan 2020 11:06:10 +0000
From:   Lorenzo Pieralisi <lorenzo.pieralisi@....com>
To:     Makarand Pawagi <makarand.pawagi@....com>
Cc:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
        "linux@...linux.org.uk" <linux@...linux.org.uk>,
        "jon@...id-run.com" <jon@...id-run.com>,
        Cristi Sovaiala <cristian.sovaiala@....com>,
        Laurentiu Tudor <laurentiu.tudor@....com>,
        Ioana Ciornei <ioana.ciornei@....com>,
        Varun Sethi <V.Sethi@....com>,
        Calvin Johnson <calvin.johnson@....com>,
        Pankaj Bansal <pankaj.bansal@....com>,
        "guohanjun@...wei.com" <guohanjun@...wei.com>,
        "sudeep.holla@....com" <sudeep.holla@....com>,
        "rjw@...ysocki.net" <rjw@...ysocki.net>,
        "lenb@...nel.org" <lenb@...nel.org>,
        "stuyoder@...il.com" <stuyoder@...il.com>,
        "tglx@...utronix.de" <tglx@...utronix.de>,
        "jason@...edaemon.net" <jason@...edaemon.net>,
        "maz@...nel.org" <maz@...nel.org>,
        "shameerali.kolothum.thodi@...wei.com" 
        <shameerali.kolothum.thodi@...wei.com>,
        "will@...nel.org" <will@...nel.org>,
        "robin.murphy@....com" <robin.murphy@....com>,
        "nleeder@...eaurora.org" <nleeder@...eaurora.org>,
        Andy Wang <Andy.Wang@....com>, Paul Yang <Paul.Yang@....com>
Subject: Re: [EXT] Re: [PATCH] bus: fsl-mc: Add ACPI support for fsl-mc

On Fri, Jan 31, 2020 at 10:35:48AM +0000, Makarand Pawagi wrote:
> > -----Original Message-----
> > From: Lorenzo Pieralisi <lorenzo.pieralisi@....com>
> > Sent: Tuesday, January 28, 2020 4:39 PM
> > To: Makarand Pawagi <makarand.pawagi@....com>
> > Cc: netdev@...r.kernel.org; linux-kernel@...r.kernel.org; linux-arm-
> > kernel@...ts.infradead.org; linux-acpi@...r.kernel.org; linux@...linux.org.uk;
> > jon@...id-run.com; Cristi Sovaiala <cristian.sovaiala@....com>; Laurentiu
> > Tudor <laurentiu.tudor@....com>; Ioana Ciornei <ioana.ciornei@....com>;
> > Varun Sethi <V.Sethi@....com>; Calvin Johnson <calvin.johnson@....com>;
> > Pankaj Bansal <pankaj.bansal@....com>; guohanjun@...wei.com;
> > sudeep.holla@....com; rjw@...ysocki.net; lenb@...nel.org;
> > stuyoder@...il.com; tglx@...utronix.de; jason@...edaemon.net;
> > maz@...nel.org; shameerali.kolothum.thodi@...wei.com; will@...nel.org;
> > robin.murphy@....com; nleeder@...eaurora.org
> > Subject: [EXT] Re: [PATCH] bus: fsl-mc: Add ACPI support for fsl-mc
> > 
> > Caution: EXT Email
> > 
> > On Tue, Jan 28, 2020 at 01:38:45PM +0530, Makarand Pawagi wrote:
> > > ACPI support is added in the fsl-mc driver. Driver will parse MC DSDT
> > > table to extract memory and other resorces.
> > >
> > > Interrupt (GIC ITS) information will be extracted from MADT table by
> > > drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c.
> > >
> > > IORT table will be parsed to configure DMA.
> > >
> > > Signed-off-by: Makarand Pawagi <makarand.pawagi@....com>
> > > ---
> > >  drivers/acpi/arm64/iort.c                   | 53 +++++++++++++++++++++
> > >  drivers/bus/fsl-mc/dprc-driver.c            |  3 +-
> > >  drivers/bus/fsl-mc/fsl-mc-bus.c             | 48 +++++++++++++------
> > >  drivers/bus/fsl-mc/fsl-mc-msi.c             | 10 +++-
> > >  drivers/bus/fsl-mc/fsl-mc-private.h         |  4 +-
> > >  drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c | 71
> > ++++++++++++++++++++++++++++-
> > >  include/linux/acpi_iort.h                   |  5 ++
> > >  7 files changed, 174 insertions(+), 20 deletions(-)
> > >
> > > diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
> > > index 33f7198..beb9cd5 100644
> > > --- a/drivers/acpi/arm64/iort.c
> > > +++ b/drivers/acpi/arm64/iort.c
> > > @@ -15,6 +15,7 @@
> > >  #include <linux/kernel.h>
> > >  #include <linux/list.h>
> > >  #include <linux/pci.h>
> > > +#include <linux/fsl/mc.h>
> > >  #include <linux/platform_device.h>
> > >  #include <linux/slab.h>
> > >
> > > @@ -622,6 +623,29 @@ static int iort_dev_find_its_id(struct device
> > > *dev, u32 req_id,  }
> > >
> > >  /**
> > > + * iort_get_fsl_mc_device_domain() - Find MSI domain related to a
> > > +device
> > > + * @dev: The device.
> > > + * @mc_icid: ICID for the fsl_mc device.
> > > + *
> > > + * Returns: the MSI domain for this device, NULL otherwise  */ struct
> > > +irq_domain *iort_get_fsl_mc_device_domain(struct device *dev,
> > > +                                                     u32 mc_icid) {
> > > +     struct fwnode_handle *handle;
> > > +     int its_id;
> > > +
> > > +     if (iort_dev_find_its_id(dev, mc_icid, 0, &its_id))
> > > +             return NULL;
> > > +
> > > +     handle = iort_find_domain_token(its_id);
> > > +     if (!handle)
> > > +             return NULL;
> > > +
> > > +     return irq_find_matching_fwnode(handle, DOMAIN_BUS_FSL_MC_MSI);
> > > +}
> > 
> > NAK
> > 
> > I am not willing to take platform specific code in the generic IORT layer.
> > 
> > ACPI on ARM64 works on platforms that comply with SBSA/SBBR guidelines:
> > 
> > 
> > https://developer.arm.com/architectures/platform-design/server-systems
> >
> > Deviating from those requires butchering ACPI specifications (ie IORT) and
> > related kernel code which goes totally against what ACPI is meant for on ARM64
> > systems, so there is no upstream pathway for this code I am afraid.
> > 
> Reason of adding this platform specific function in the generic IORT
> layer is That iort_get_device_domain() only deals with PCI bus
> (DOMAIN_BUS_PCI_MSI).
> 
> fsl-mc objects when probed, need to find irq_domain which is
> associated with the fsl-mc bus (DOMAIN_BUS_FSL_MC_MSI). It will not be
> possible to do that if we do not add this function because there are
> no other suitable APIs exported by IORT layer to do the job.

And that's by design.

I don't know what the FSL bus is and I don't want to know, what
I am telling you is that the ACPI code in the mainline is sufficient
to support SBSA compliant HW and that's what we support with ACPI
on ARM64.

We won't hack the kernel (and ACPI tables) up to boot with ACPI on
non-compliant platforms, I don't know how I can be any clearer than
that.

All is needed to configure the (platform dev/PCI->IOMMU->ITS) chain is
in the ACPI/IORT specifications and again, that's by design, adding
DSDT objects and hacking the kernel to make it work "like DT" won't
cut it, you are solving the wrong problem here, boot this platform
with a device tree, it is a problem that has been solved a long time
ago and it is supported in the mainline kernel.

Thanks,
Lorenzo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ