Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp640974pxv; Thu, 15 Jul 2021 12:13:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxN9p0nxpkpCOfsWl+SDmcmy9TTjIiPnOBW0OD8UMPUDb8zGAvZC+T4J1WsEQLn4OU8oI41 X-Received: by 2002:a17:906:b104:: with SMTP id u4mr6936790ejy.201.1626376420220; Thu, 15 Jul 2021 12:13:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626376420; cv=none; d=google.com; s=arc-20160816; b=wnmDUuAn2xpPf1MYZj18+suD4lQbBUvfoKItDuC2IDQkDXHw9rImngD34ZhJWzRUPO IS3XGMerYr1yMQpQLLQO4af5vfwvQPo5GCgkPpxqWc/uqu9OIgRgYW09YVlvIKIWWovW TulQXNozbtqd3K+jHCAu5iPmNhh6soa0lCHRFpSmDmGPGQxHgyA15szOtazFb8SyPrAr uEeqvmx408IT2Xe3nY4NbtdDaYO1Rglrd2z+corotYjA+2v8E9aMr5LlD37M8AKBAhmg Oefd39OmE9e6Iz1zgr52NW4smsC2TCof4hWNQphbdn4zYA7TREtMqt48DtsFFcBejD++ E4sg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BjAidMBteVDznlHCTZnceh7WbG2g6B9ipE6+dMskS7E=; b=gc+5/z9gl/bItXbv5e7ErIgPWNVYjuGsZKJCXIMV7Nc7Ol1vuMAGQwz6DAZuWZruzd aAD787r/0eE4y0LBomXy6rBC6CYDb8y3/CT10tMADn+s53y+iMHk0AYkTEWEx7JA5lxE O840/KPllboik4ovP1oYsPRGfXpu5BzfNxDvEE6gVoj7+uZAEMCyBGocIajwiaBKldIO rk7K8FYf5jgFvpZW5fT9FdL3xY0aYVAlA1i5rqTfbXSDc5VswmLFNubHonty8fr7x9Nb gnVCrUyHDXsZKJYi9xCjcKH6/0letr0tqrZ26uwAvBpEDmlqtetUsqRQZWaqNRQR/01b Cajw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dzgrHjSt; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s10si2221449edd.421.2021.07.15.12.13.16; Thu, 15 Jul 2021 12:13:40 -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=@linuxfoundation.org header.s=korg header.b=dzgrHjSt; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243909AbhGOTOI (ORCPT + 99 others); Thu, 15 Jul 2021 15:14:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:37174 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242668AbhGOS7v (ORCPT ); Thu, 15 Jul 2021 14:59:51 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9A039601FE; Thu, 15 Jul 2021 18:56:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375417; bh=6Pe3Em6kE4JJlEwA3HTV1164fS7XY/99EINE0V7ZPww=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dzgrHjStwqRte7+O+q3ca+6K4oaaYTPm/wr56FP7E7hcZ2KC2rY03W233RQem/qdp WSxuJTtQJzIf+WOUfIrembK/Px0qGwiSi3SF5KJe0Ak0y0AhRje76xM2Ekb63kIbs3 5ofqW17DoRjJmPKsaz/aTvilLlt8bGnwgdgYctN0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nirmoy Das , =?UTF-8?q?Christian=20K=C3=B6nig?= , Felix Kuehling , Alex Deucher , Sasha Levin Subject: [PATCH 5.12 079/242] drm/amdkfd: use allowed domain for vmbo validation Date: Thu, 15 Jul 2021 20:37:21 +0200 Message-Id: <20210715182606.879659667@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182551.731989182@linuxfoundation.org> References: <20210715182551.731989182@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Nirmoy Das [ Upstream commit bc05716d4fdd065013633602c5960a2bf1511b9c ] Fixes handling when page tables are in system memory. v3: remove struct amdgpu_vm_parser. v2: remove unwanted variable. change amdgpu_amdkfd_validate instead of amdgpu_amdkfd_bo_validate. Signed-off-by: Nirmoy Das Reviewed-by: Christian König Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 21 ++++--------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c index ac0a432a9bf7..3c3f05d1f4da 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c @@ -49,12 +49,6 @@ static struct { spinlock_t mem_limit_lock; } kfd_mem_limit; -/* Struct used for amdgpu_amdkfd_bo_validate */ -struct amdgpu_vm_parser { - uint32_t domain; - bool wait; -}; - static const char * const domain_bit_to_string[] = { "CPU", "GTT", @@ -337,11 +331,9 @@ validate_fail: return ret; } -static int amdgpu_amdkfd_validate(void *param, struct amdgpu_bo *bo) +static int amdgpu_amdkfd_validate_vm_bo(void *_unused, struct amdgpu_bo *bo) { - struct amdgpu_vm_parser *p = param; - - return amdgpu_amdkfd_bo_validate(bo, p->domain, p->wait); + return amdgpu_amdkfd_bo_validate(bo, bo->allowed_domains, false); } /* vm_validate_pt_pd_bos - Validate page table and directory BOs @@ -355,20 +347,15 @@ static int vm_validate_pt_pd_bos(struct amdgpu_vm *vm) { struct amdgpu_bo *pd = vm->root.base.bo; struct amdgpu_device *adev = amdgpu_ttm_adev(pd->tbo.bdev); - struct amdgpu_vm_parser param; int ret; - param.domain = AMDGPU_GEM_DOMAIN_VRAM; - param.wait = false; - - ret = amdgpu_vm_validate_pt_bos(adev, vm, amdgpu_amdkfd_validate, - ¶m); + ret = amdgpu_vm_validate_pt_bos(adev, vm, amdgpu_amdkfd_validate_vm_bo, NULL); if (ret) { pr_err("failed to validate PT BOs\n"); return ret; } - ret = amdgpu_amdkfd_validate(¶m, pd); + ret = amdgpu_amdkfd_validate_vm_bo(NULL, pd); if (ret) { pr_err("failed to validate PD\n"); return ret; -- 2.30.2