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: <CAAObsKB8e2MN-VJKYSeX1iibmA4d4i+GL+SWYiLHpg3g_Qby7g@mail.gmail.com>
Date:   Mon, 24 Feb 2020 08:22:38 +0100
From:   Tomeu Vizoso <tomeu.vizoso@...labora.com>
To:     Rob Herring <robh@...nel.org>
Cc:     open list <linux-kernel@...r.kernel.org>,
        David Airlie <airlied@...ux.ie>,
        dri-devel <dri-devel@...ts.freedesktop.org>,
        Steven Price <steven.price@....com>,
        Alyssa Rosenzweig <alyssa.rosenzweig@...labora.com>,
        Robin Murphy <robin.murphy@....com>
Subject: Re: [PATCH v2] drm/panfrost: Don't try to map on error faults

On Wed, 12 Feb 2020 at 21:22, Rob Herring <robh@...nel.org> wrote:
>
> From: Tomeu Vizoso <tomeu.vizoso@...labora.com>
>
> If the exception type isn't a translation fault, don't try to map and
> instead go straight to a terminal fault.
>
> Otherwise, we can get flooded by kernel warnings and further faults.
>
> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@...labora.com>
> Signed-off-by: Rob Herring <robh@...nel.org>
> ---
> I rewrote this some simplifying the code and somewhat following Steven's
> suggested. Still not using defines though. No defines here was good
> enough before IMO.
>
> Only compile tested.

Looks good, I also tested it on RK3399.

Reviewed-by: Tomeu Vizoso <tomeu.vizoso@...labora.com>

Thanks,

Tomeu

>  drivers/gpu/drm/panfrost/panfrost_mmu.c | 44 +++++++++++--------------
>  1 file changed, 19 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c
> index 763cfca886a7..4f2836bd9215 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_mmu.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c
> @@ -596,33 +596,27 @@ static irqreturn_t panfrost_mmu_irq_handler_thread(int irq, void *data)
>                 source_id = (fault_status >> 16);
>
>                 /* Page fault only */
> -               if ((status & mask) == BIT(i)) {
> -                       WARN_ON(exception_type < 0xC1 || exception_type > 0xC4);
> -
> +               ret = -1;
> +               if ((status & mask) == BIT(i) && (exception_type & 0xF8) == 0xC0)
>                         ret = panfrost_mmu_map_fault_addr(pfdev, i, addr);
> -                       if (!ret) {
> -                               mmu_write(pfdev, MMU_INT_CLEAR, BIT(i));
> -                               status &= ~mask;
> -                               continue;
> -                       }
> -               }
>
> -               /* terminal fault, print info about the fault */
> -               dev_err(pfdev->dev,
> -                       "Unhandled Page fault in AS%d at VA 0x%016llX\n"
> -                       "Reason: %s\n"
> -                       "raw fault status: 0x%X\n"
> -                       "decoded fault status: %s\n"
> -                       "exception type 0x%X: %s\n"
> -                       "access type 0x%X: %s\n"
> -                       "source id 0x%X\n",
> -                       i, addr,
> -                       "TODO",
> -                       fault_status,
> -                       (fault_status & (1 << 10) ? "DECODER FAULT" : "SLAVE FAULT"),
> -                       exception_type, panfrost_exception_name(pfdev, exception_type),
> -                       access_type, access_type_name(pfdev, fault_status),
> -                       source_id);
> +               if (ret)
> +                       /* terminal fault, print info about the fault */
> +                       dev_err(pfdev->dev,
> +                               "Unhandled Page fault in AS%d at VA 0x%016llX\n"
> +                               "Reason: %s\n"
> +                               "raw fault status: 0x%X\n"
> +                               "decoded fault status: %s\n"
> +                               "exception type 0x%X: %s\n"
> +                               "access type 0x%X: %s\n"
> +                               "source id 0x%X\n",
> +                               i, addr,
> +                               "TODO",
> +                               fault_status,
> +                               (fault_status & (1 << 10) ? "DECODER FAULT" : "SLAVE FAULT"),
> +                               exception_type, panfrost_exception_name(pfdev, exception_type),
> +                               access_type, access_type_name(pfdev, fault_status),
> +                               source_id);
>
>                 mmu_write(pfdev, MMU_INT_CLEAR, mask);
>
> --
> 2.20.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@...ts.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ