Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4372183pxf; Tue, 30 Mar 2021 06:24:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAiQos/j7WCiL3pjeo+bcPtnAFGQjUMNUGZ8dqlJR3gYVP0kPU9ZZvRd5QHWKCRUsUp280 X-Received: by 2002:a17:906:75a:: with SMTP id z26mr32943964ejb.22.1617110691834; Tue, 30 Mar 2021 06:24:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617110691; cv=none; d=google.com; s=arc-20160816; b=Q4BS4M2sePi0k/Mzdk8ouHHJBk8i63VOM7ZNj2Z3mhMu74GwFfDHAsTvMUvJolNfP8 o2F/XHbkrWTeRKTSDhu2NjV+XQi5ga/RVl38iT9O04Wa86ycGm8ufrRZ14+Kec/Osyla g9kJKEN0DoknA3+JKjQci9wnqOXYa4fdx921xOUqerQySRbOYxV3KLKBr/DkxUIfQUVk Qh8DK6taNKKfNlNSlj/R5NJOwtNS7hcCyvD+iOEoy7usbLWmnZdybdCUxfMIfXP4WFoN Tx1dCO0gLfRN9OF7a9KqEk/ZzHMXH6wnPqlqLpCtdU4GPwz52HT1ezDLIEycA3gxGK8b fhoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=K5RoGjv9dto0GFZHMUHC66uEbDEHJdBu5EWe5/L76Ss=; b=fKsZSWYGLHqVjbbS2cV4KQq8mXG5gZ9ws+Y+PvlqW4Y3nZEupIiOvRC76ymvAoFb4u SkckgaPPMx7dAW0wQxcKwv88ckHj6EwsVKKRDi4a5I8qbtrIYBJ54fX0haVUOUbk9x39 mpkSPNf9jxfReHtK1nW5tG5XbPM6UqIdkebU+KQI+r/WY//OQnwqo2wPgMHXe6VhjgdP ibmOxEVrsDmkriSh4zyThAHeBlMTcvz6dxur/JR6T6fUOiH1tpWGEZVq4Kg5IMSk2FIH 5Zq/BKnfFqGNSvXWD0OMD7Y6EPZ+ICNb/+3usLX+0FyTQCn+JB3UgL8NXiNVa87kBbmR px7A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d3si15100087eds.83.2021.03.30.06.24.29; Tue, 30 Mar 2021 06:24:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231794AbhC3NX3 (ORCPT + 99 others); Tue, 30 Mar 2021 09:23:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232079AbhC3NXC (ORCPT ); Tue, 30 Mar 2021 09:23:02 -0400 Received: from redcrew.org (redcrew.org [IPv6:2a02:2b88:2:1::1cde:1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52AEDC061574; Tue, 30 Mar 2021 06:23:02 -0700 (PDT) Received: from server.danny.cz (19.161.broadband4.iol.cz [85.71.161.19]) by redcrew.org (Postfix) with ESMTP id D4E3269; Tue, 30 Mar 2021 15:23:00 +0200 (CEST) Received: from talos.danny.cz (talos.danny.cz [192.168.160.68]) by server.danny.cz (Postfix) with SMTP id 65522DA004; Tue, 30 Mar 2021 15:23:00 +0200 (CEST) Date: Tue, 30 Mar 2021 15:23:00 +0200 From: Dan =?UTF-8?B?SG9yw6Fr?= To: Xi Ruoyao Cc: Christian =?UTF-8?B?S8O2bmln?= , Christian =?UTF-8?B?S8O2bmln?= , Alex Deucher , David Airlie , Felix Kuehling , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, Daniel Vetter , stable@vger.kernel.org Subject: Re: [PATCH] drm/amdgpu: fix an underflow on non-4KB-page systems Message-Id: <20210330152300.b790099debcd7659e30d9bfd@danny.cz> In-Reply-To: <63f5f6b39d22d9833a4c1503a34840eb08050f75.camel@mengyan1223.wang> References: <20210329175348.26859-1-xry111@mengyan1223.wang> <9a11c873-a362-b5d1-6d9c-e937034e267d@gmail.com> <84b3911173ad6beb246ba0a77f93d888ee6b393e.camel@mengyan1223.wang> <97c520ce107aa4d5fd96e2c380c8acdb63d45c37.camel@mengyan1223.wang> <7701fb71-9243-2d90-e1e1-d347a53b7d77@gmail.com> <368b9b1b7343e35b446bb1028ccf0ae75dc2adc4.camel@mengyan1223.wang> <71e3905a5b72c5b97df837041b19175540ebb023.camel@mengyan1223.wang> <63f5f6b39d22d9833a4c1503a34840eb08050f75.camel@mengyan1223.wang> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; powerpc64le-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 30 Mar 2021 21:09:12 +0800 Xi Ruoyao wrote: > On 2021-03-30 21:02 +0800, Xi Ruoyao wrote: > > On 2021-03-30 14:55 +0200, Christian König wrote: > > > > > > I rather see this as a kernel bug. Can you test if this code fragment > > > fixes your issue: > > > > > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c > > > b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c > > > index 64beb3399604..e1260b517e1b 100644 > > > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c > > > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c > > > @@ -780,7 +780,7 @@ int amdgpu_info_ioctl(struct drm_device *dev, void > > > *data, struct drm_file *filp) > > >                  } > > >                  dev_info->virtual_address_alignment = > > > max((int)PAGE_SIZE, AMDGPU_GPU_PAGE_SIZE); > > >                  dev_info->pte_fragment_size = (1 << > > > adev->vm_manager.fragment_size) * AMDGPU_GPU_PAGE_SIZE; > > > -               dev_info->gart_page_size = AMDGPU_GPU_PAGE_SIZE; > > > +               dev_info->gart_page_size = > > > dev_info->virtual_address_alignment; > > >                  dev_info->cu_active_number = adev->gfx.cu_info.number; > > >                  dev_info->cu_ao_mask = adev->gfx.cu_info.ao_cu_mask; > > >                  dev_info->ce_ram_size = adev->gfx.ce_ram_size; > > > > It works.  I've seen it at > > https://github.com/xen0n/linux/commit/84ada72983838bd7ce54bc32f5d34ac5b5aae191 > > before (with a common sub-expression, though :). > > Some comment: on an old version of Fedora ported by Loongson, Xorg just hangs > without this commit. But on the system I built from source, I didn't see any > issue before Linux 5.11. So I misbelieved that it was something already fixed. > > Dan: you can try it on your PPC 64 with non-4K page as well. yup, looks good here as well, ppc64le (Power9) system with 64KB pages Dan