Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp311430ybv; Wed, 5 Feb 2020 06:04:36 -0800 (PST) X-Google-Smtp-Source: APXvYqzJ0vKhhvvwbPDhQAhUo8RMeOsuG15xl7qmSqBWK6wzMGyH0/yVg8Ca4dS42aRn5nQVlicF X-Received: by 2002:aca:ad11:: with SMTP id w17mr2970161oie.85.1580911476022; Wed, 05 Feb 2020 06:04:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580911476; cv=none; d=google.com; s=arc-20160816; b=tmovSRCcvxXkMfvUcOqlMjVUEgYBxnBb63eoGnyibKQQY3WauFRUDglJsCisBSk/3X OO6eOHYmB8upihYLeNUI7NZp4AXiEu6AO87Ha7C/4UdaK5KWn6eE94a+xNgOryM6rWsx l7yWn9wUXNKqc6YMCcHyEboIRiqHjV+P2VrgNYSGiNYP60di4lZsDj6NcezvTzEuTrvv f3ak9z45QdmlY5OkcSLyhfuG7V4pNXCkGpqHg/0xEtNrWv/8mDFiBdvmeWepOG5D15f2 1dd4Zn7xpIgd0I1HWaVYaWVpnWbvlM2b6T0jP6bU2NJnLFqtuygcnxWJHfFnUubJPwKo i9zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=6eJyI9aLVOlaHchnfPEx1CqoE+SBQbkxk8iQj/YL3lg=; b=KQExTVNf+87cNdxl3N3yv2il2HwnQmm/+uj7xMnO86mwUDevL40tCR2K6A+4j+388u 4CpoDVGteholSDWeARvgQwyCCO6uHcFxHnrdDjvnmMoLzLJuyCxvQb3zEscyr0A2D7MM nuf8/6SedrVsukWk0A/B9vwv8ks22PxX3P8yHaPXPT/3Hw3K9n+UvVCwpUTahHMaJDbF jowvyN5FF3tNnmnRSGUFS+5yQ+K1gWaxnZnBPJ1MUfjX+DKN+jiBjWll7cy/nwxya0gC MM3dD6SkijZO+NGFp/4ATUuS+Er+KurXT7la2vjeq2diJ6k5C3Yjflua1D2r13aS/AHo +Mzw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v26si14286866otj.0.2020.02.05.06.04.07; Wed, 05 Feb 2020 06:04:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727441AbgBEOBt (ORCPT + 99 others); Wed, 5 Feb 2020 09:01:49 -0500 Received: from foss.arm.com ([217.140.110.172]:47588 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726748AbgBEOBt (ORCPT ); Wed, 5 Feb 2020 09:01:49 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EB65731B; Wed, 5 Feb 2020 06:01:48 -0800 (PST) Received: from [10.1.195.32] (e112269-lin.cambridge.arm.com [10.1.195.32]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 27F733F68E; Wed, 5 Feb 2020 06:01:48 -0800 (PST) Subject: Re: [PATCH] drm/panfrost: Don't try to map on error faults To: Robin Murphy , Tomeu Vizoso , linux-kernel@vger.kernel.org Cc: David Airlie , Alyssa Rosenzweig , dri-devel@lists.freedesktop.org References: <20200205100719.24999-1-tomeu.vizoso@collabora.com> <3500c501-b166-6a1e-267b-31a4e5c62619@arm.com> From: Steven Price Message-ID: <565bac84-9e3c-21de-9043-f508e98ae6bf@arm.com> Date: Wed, 5 Feb 2020 14:01:47 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <3500c501-b166-6a1e-267b-31a4e5c62619@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/02/2020 13:25, Robin Murphy wrote: > On 05/02/2020 10:07 am, Tomeu Vizoso wrote: >> If the exception type isn't one of the normal faults, don't try to map >> and instead go straight to a terminal fault. > > "One of the the normal faults" seems a rather vague way of saying "a > translation fault", which is what we're specifically handling here, and > logically the only fault reflecting something not yet mapped rather than > mapped inappropriately ;) > > (Who knows how the level ended up as 1-4 rather than 0-3 as it really > should be - another Mali Mystery(TM)...) Ah, but you're thinking of LPAE not Mali Magic Page Tables ('inspired by' LPAE but not actually compatible....) ;) However I do wonder what will happen when we enable aarch64 page tables in Bifrost. >> Otherwise, we can get flooded by kernel warnings and further faults. > > Either way, > > Reviewed-by: Robin Murphy > >> Signed-off-by: Tomeu Vizoso >> --- >>   drivers/gpu/drm/panfrost/panfrost_mmu.c | 5 +++-- >>   1 file changed, 3 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c >> b/drivers/gpu/drm/panfrost/panfrost_mmu.c >> index 763cfca886a7..80abddb4544c 100644 >> --- a/drivers/gpu/drm/panfrost/panfrost_mmu.c >> +++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c >> @@ -596,8 +596,9 @@ 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); >> +        if ((status & mask) == BIT(i) && >> +             exception_type >= 0xC1 && >> +             exception_type <= 0xC4) { I would suggest the best option here is to copy mali_kbase and check against a mask, in kbase[1] we have: switch (fault_status & AS_FAULTSTATUS_EXCEPTION_CODE_MASK) { case AS_FAULTSTATUS_EXCEPTION_CODE_TRANSLATION_FAULT: [1] https://gitlab.freedesktop.org/panfrost/linux-panfrost/blob/a864e6b9fbd093a033a90d5bbdd6dcc79a0667b2/mali_kbase_mmu.c#L108 Where: #define AS_FAULTSTATUS_EXCEPTION_CODE_MASK (0x7<<3) #define AS_FAULTSTATUS_EXCEPTION_CODE_TRANSLATION_FAULT (0x0<<3) Steve >>                 ret = panfrost_mmu_map_fault_addr(pfdev, i, addr); >>               if (!ret) { >> > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel