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:   Tue, 2 May 2017 12:01:15 +0530
From:   Geetha Akula <geethasowjanya.akula@...il.com>
To:     Will Deacon <will.deacon@....com>
Cc:     Mark Rutland <mark.rutland@....com>,
        Geetha sowjanya <gakula@...iumnetworks.com>,
        robin.murphy@....com, lorenzo.pieralisi@....com,
        hanjun.guo@...aro.org, sudeep.holla@....com,
        iommu@...ts.linux-foundation.org, jcm@...hat.com,
        Linu Cherian <linu.cherian@...ium.com>,
        linux-kernel@...r.kernel.org, linux-acpi@...r.kernel.org,
        robert.richter@...ium.com, catalin.marinas@....com,
        Geetha <gakula@...ium.com>, sgoutham@...ium.com,
        linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH 2/3] iommu/arm-smmu-v3: Add workaround for Cavium
 ThunderX2 erratum #74

Hi Will,

SMMU_IIDR register is broken on T99, that the reason we are using MIDR.
If using MIDR is not accepted, can we enable errata based on SMMU resource size?
some thing like below.

static bool page0_reg_only = false;
+static unsigned long arm_smmu_resource_size(void)
+{
+       if (page0_reg_only)
+               return SZ_64K;
+       else
+               return SZ_128K;
+}
+
 static int arm_smmu_device_probe(struct platform_device *pdev)
 {
        int irq, ret;
@@ -2674,7 +2692,13 @@ static int arm_smmu_device_probe(struct
platform_device *pdev)

        /* Base address */
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);

+       /*
+     * Setting page0_reg_only flag, for Cavium CN99xx implementations
+     * which doesn't support the page 1 SMMU register space.
+     */
+       if (resource_size(res) == SZ_64K)
+                       page0_reg_only = true;
-        if (resource_size(res) + 1 < SZ_128K) {
+       if (resource_size(res) + 1 < arm_smmu_resource_size()) {
                dev_err(dev, "MMIO region too small (%pr)\n", res);
                return -EINVAL;
        }


Thank you,
Geetha.

On Thu, Apr 27, 2017 at 10:30 PM, Will Deacon <will.deacon@....com> wrote:
> On Thu, Apr 27, 2017 at 05:42:37PM +0100, Mark Rutland wrote:
>> On Thu, Apr 27, 2017 at 05:16:23PM +0530, Geetha sowjanya wrote:
>> > +   /*
>> > +    * Override the size, for Cavium CN99xx implementations
>> > +    * which doesn't support the page 1 SMMU register space.
>> > +    */
>> > +   cpu_model = read_cpuid_id() & MIDR_CPU_MODEL_MASK;
>> > +   if (cpu_model == MIDR_THUNDERX_99XX ||
>> > +       cpu_model == MIDR_BRCM_VULCAN)
>> > +           size = SZ_64K;
>>
>> If you're trying to identify an SMMU erratum, identify the SMMU, not the
>> CPU it happens to be paired with this time.
>>
>> There are ID registers in the SMMU you can use to do so.
>>
>> NAK to using the CPU ID here.
>
> Agreed. I had some off-list discussion with Geetha where we agreed to use
> the "silicon ID", which I assumed was the SMMU IIDR register.
>
> Will

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ