Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp650932pxv; Thu, 15 Jul 2021 12:29:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLhvUCslixi3HxiYp35zQpDhEIVsrrZRsiN+XVtzfwNXYz3XK2MUJODrfGGfu+Fr7jpKl1 X-Received: by 2002:a50:fa94:: with SMTP id w20mr9203323edr.275.1626377367830; Thu, 15 Jul 2021 12:29:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626377367; cv=none; d=google.com; s=arc-20160816; b=ocfTKb0NnYs03HN/GWSA8jE8mJ8vu1C9ckl4z+FpCN2BiNAj1CnODzj/Wm82OQYQMx amDb924LdNpN8jDvDsgeq/wo6mG3pAEE4ZTDDiKGIUY2T9R+KI0XLti2l/SVcR//byB8 JFmKX+3MXx2WFNEnDG1qncEAzP2ghmmLlB1+PEFncDi/zzoF3EOqi8vnAL1NstlCHOoR SM2JS6c4ukADoaT8IkW2UaXBQGflp8Ik+xEjsmDvidNwKmV9EHnJHAFpGprKSCfuwHB1 hGXw9AJAOik2qeaIXGLMqn4nkAmKKFn0Q2qvZHDQ273aos0QhpdSnxbii1nadthgQZr5 9gPg== 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=5B5a2VuGyaim6dTix36EI4bPY5CX2Vu5rZIDmZNMMBE=; b=I+NdV6Mk6/xEhoy96XZLUFmdYxkxP39Ch1QwxNZpy/gB3ZwoodrkRvgoMcQx2O52bV F+967ndtfTwahCYQeYXzY2YafwuHJdzAHLALvU1/2RERoHe2VTJwT6+IoiSGuDqp+77c f6ZZqG9f3VbCmfKyuN4CCMDeEuC8vbTiTRFaV8Tw0EmCcxfDavx5T7wxMEYrfe3EYA6o lWLTezDD4ehbMsetq9qol8Y7/Iyu89mdevzC10kKPV/6owqgnVLoNtFq4uoUij8RNSsP iIOmccsUQl7u8OFxr98/8vaRxS+hm6PQcENmXqc3Aj64fykyv/4EnZ/sM4xZjvv9rTJ6 CoVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ic+Qgb5o; 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 k9si10200134eje.496.2021.07.15.12.29.04; Thu, 15 Jul 2021 12:29:27 -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=ic+Qgb5o; 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 S1343720AbhGOT3h (ORCPT + 99 others); Thu, 15 Jul 2021 15:29:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:46398 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243865AbhGOTKL (ORCPT ); Thu, 15 Jul 2021 15:10:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F17DE613ED; Thu, 15 Jul 2021 19:06:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626376019; bh=8UCjUJXA1kDEPzF5QxBKUvj3rBGngKFUqSYqj9bQQd0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ic+Qgb5oke8igluXu9g6qczraP+6xMOyi1lG8igB4zj+IhycjtqRvJLMCceqDl7aj EKAzIBRsvPiYVVX4DCUisPx7m8mY5OV/u/XzB3tLnZlTTAR13uZnTXbzLhYRFsVaEu 9Ve9ypmt2wTacUvCSE8I7S0MHbfQuoNEYt7V8Nzg= 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.13 092/266] drm/amdkfd: use allowed domain for vmbo validation Date: Thu, 15 Jul 2021 20:37:27 +0200 Message-Id: <20210715182630.390479387@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182613.933608881@linuxfoundation.org> References: <20210715182613.933608881@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 7d4118c8128a..5e69b5b50a19 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c @@ -50,12 +50,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", @@ -346,11 +340,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 @@ -364,20 +356,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