Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4471854pxf; Tue, 30 Mar 2021 08:36:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEIl/Bo3hzQVrE4x11HCzDKOsemrWLYvpg9f8Zllw76XoItdVOPDxG4+zbqHdkYjFGO939 X-Received: by 2002:a50:82c5:: with SMTP id 63mr33925577edg.97.1617118576872; Tue, 30 Mar 2021 08:36:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617118576; cv=none; d=google.com; s=arc-20160816; b=fsDypRlBVJaWXunO+zp1hFEntZD+kOAYzmt157dE9qQsSxaWw9VIemKT85PcgfP4cL otHgry9CMsnam18RQm98eqtvYzYPPeAvhGnVYADQRKe81Uaj/RfHotS/zzBHIJ6D0CEn yT0DHRenRtbX1+r1Y2KkzJ8lJz5+lF69zyT8zOTv1LpoaqUCBPa/Lx2T2u8yWid/SE4J lgd2J/C7U21BEIqYdtkY50umsrLnfuMDdEZtnZi2c50jSL//wzFpv3QUZZRKttZtxxxm MNtgRuH86QoIBWBTsS1jK7Bo5dQpvTNJ+WDfj2yMp4QDqlK0VkzZewOtNWRKp13Xbxn5 g6hg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=E9uzJ2n1hFC18R1jMFthKg1gWzK5bofu21stYTwkJoo=; b=Ec/eQ0Brqm1CaAjmqQIKFOe/liC0EXIJPqu/pxQdFMomb3Nwg89x8NMJ31MT/XIyTy deZDdBFAGq07oyNnEGqV+nuR4uy8PNImkpPcOZtCs0BBx0+c7ZnPWQajD735MUkYJlKy nWHzbippkQrB69CCMudE7S4xfzFAdPevWHj6dMPNh9MAQj/JdcNXYAQWFxXzCqRaJlMm a61Uksb1WK8HifYtNWdFMBFTZkI+yMWLZbgjGSv1eT7o45f9JLVTjkZHwKSKOnVbq+t3 n5wIsWNImofYSvtlNpABDTnLSxnXMu092PRrjyFxufHKM7CxJChb2Es08gCvGJH2kMcP /TZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mengyan1223.wang header.s=mail header.b=1S7zq7qy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mengyan1223.wang Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l26si2201480ejc.536.2021.03.30.08.35.52; Tue, 30 Mar 2021 08:36:16 -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; dkim=pass header.i=@mengyan1223.wang header.s=mail header.b=1S7zq7qy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mengyan1223.wang Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231794AbhC3Pe4 (ORCPT + 99 others); Tue, 30 Mar 2021 11:34:56 -0400 Received: from mengyan1223.wang ([89.208.246.23]:33038 "EHLO mengyan1223.wang" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232374AbhC3Pef (ORCPT ); Tue, 30 Mar 2021 11:34:35 -0400 Received: from xry111-X57S1.. (unknown [IPv6:240e:35a:1037:8a00:70b2:e35d:833c:af3e]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@mengyan1223.wang) by mengyan1223.wang (Postfix) with ESMTPSA id 536386594D; Tue, 30 Mar 2021 11:34:20 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mengyan1223.wang; s=mail; t=1617118474; bh=E9uzJ2n1hFC18R1jMFthKg1gWzK5bofu21stYTwkJoo=; h=From:To:Cc:Subject:Date:From; b=1S7zq7qygFhaboB0wDdtkxcOCCrRWc5zG0DVbbjctvEIh2YPWGepr16K+DKQ34QtO vZSvzH2VaHuHvjBxj7zcRVXhBgXzh1+PmbhnayfNvWzih1l8VDztADbPCX3uG1ybP8 X8HnU/OJPhli25bFWf2SZVE+U9XL1e28LecLCmY8ugdt7pB05IzVhYV1eG/zkWDH5v wNv58IpgrCL4B65Jthj8YqUnuccF7a4HxI2/ECrXnZXer38PDq5+MUzmuyjkjZ0esv FwXABm/1Uu1V9BtG2JWXIJpRgzeaWEsm23FAGerbK03jKG0HKuXKC6kcRnqay4c9+Y cte5a3GQ2R+Nw== From: =?UTF-8?q?X=E2=84=B9=20Ruoyao?= To: amd-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Christian=20K=C3=B6nig?= , Huacai Chen , =?UTF-8?q?Dan=20Hor=C3=A1k?= , Alex Deucher , David Airlie , =?UTF-8?q?X=E2=84=B9=20Ruoyao?= Subject: [PATCH 0/2] ensure alignment on CPU page for bo mapping Date: Tue, 30 Mar 2021 23:33:32 +0800 Message-Id: <20210330153334.44570-1-xry111@mengyan1223.wang> X-Mailer: git-send-email 2.31.1 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 In AMDGPU driver, the bo mapping should always align to CPU page or the page table is corrupted. The first patch is cherry-picked from Loongson community, which sets a suitable dev_info.gart_page_size so Mesa will handle the alignment correctly. The second patch is added to ensure an ioctl with unaligned parameter to be rejected -EINVAL, instead of causing page table corruption. The patches should be applied for drm-next. Huacai Chen (1): drm/amdgpu: Set a suitable dev_info.gart_page_size Xℹ Ruoyao (1): drm/amdgpu: check alignment on CPU page for bo map drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) base-commit: a0c8b193bfe81cc8e9c7c162bb8d777ba12596f0 -- 2.31.1