Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CB7CBCD8CA8 for ; Tue, 9 Jun 2026 11:15:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4F4D310E06D; Tue, 9 Jun 2026 11:15:46 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="uIMJNay5"; dkim-atps=neutral Received: from BYAPR05CU005.outbound.protection.outlook.com (mail-westusazon11010012.outbound.protection.outlook.com [52.101.85.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7710810E06D for ; Tue, 9 Jun 2026 11:15:44 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZqZNa8NPSNXxw+H6TDtKJNsTfAnUMcAoXELD31LK30jT1lYqu/C8uYeHC1NXbQIYvWCbWNcDkNgoLHFpi7Y0KOZcvggtAHHsontoAxOTsLe4UWmUhZoYGAQ0FG1d21BbjWhLWmjYtEploqHSTICRnFlFxY4/+FXRjxLMyGoW6pbnVYSuf0BD4pJsTAksDaCWDpnFiXXD07p7lIk6Kyw4CnDwGKgsk+CLlLghjsX21ZcBuYnIF+6G+hPI/ii5iIQlCSE57r4Q+10fp9WLDr7KtETrKBt8Avw4bWJeRAbc5xdGVIR2KKY4akfDXgVGqPqsmU0ZH5qz1rOn9UnSIzzLeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=O75Z9HI+ZFbvhUkUM6ZoJ1LLeDBFtVFpuLVpvH6xEGk=; b=riDSYkuHo1T4GchlsB91GLn1yQmD5snP7WtjrvftJ3sGK99eQw1hFpjlwiQO4PVEkGzyKSF6Gvj+VVuDFqbdZfI9hogRmSgCVyvJuQJAVM0IfZZGygcujqIu7X4phLLko6thC6ZfD/Jm6baGQxhXbOcUsZFTZRS1D+gULQO/TEkRG1jMklPiULqMRNb43Nd0m/CrAAtwUPLNtVkoybHAjBQDZ+3o3nAtj0t2JeY0U80DrRet3VB680zGOqhW8O4QPhOxaIf8BVSNz7DAJbqMFjMpwp9zvqdEUM2oMMMVhq51cRLgkUn4vzv5kLd7Mq4BvAtr7hTkrHrhlZcygBFV3w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=O75Z9HI+ZFbvhUkUM6ZoJ1LLeDBFtVFpuLVpvH6xEGk=; b=uIMJNay5eIVJo7tzY3p1WQJMoIHbgK8A+bRv4FtpB9L6qoaN6Oz+lxr1oc3kr4alc6ncjmL4okNJtxg5p/Dv1rb5LmTzrryqmnbkg91U8+5SW2KdheV2VO9P7eOoZOS3zcUrOkCuTBaMnGqz06utXivmHQiRPCZaTBfxfGuABE4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from PH7PR12MB5685.namprd12.prod.outlook.com (2603:10b6:510:13c::22) by SJ0PR12MB6735.namprd12.prod.outlook.com (2603:10b6:a03:479::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.92.13; Tue, 9 Jun 2026 11:15:41 +0000 Received: from PH7PR12MB5685.namprd12.prod.outlook.com ([fe80::ce69:cfae:774d:a65c]) by PH7PR12MB5685.namprd12.prod.outlook.com ([fe80::ce69:cfae:774d:a65c%5]) with mapi id 15.21.0092.006; Tue, 9 Jun 2026 11:15:41 +0000 Message-ID: Date: Tue, 9 Jun 2026 13:15:37 +0200 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V3] drm/amdgpu: implement per-process MES context To: Zhu Lingshan , Alexander.Deucher@amd.com Cc: amd-gfx@lists.freedesktop.org, Ray.Huang@amd.com References: <20260601064112.172432-1-lingshan.zhu@amd.com> Content-Language: en-US From: =?UTF-8?Q?Christian_K=C3=B6nig?= In-Reply-To: <20260601064112.172432-1-lingshan.zhu@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: FR3P281CA0093.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a1::13) To PH7PR12MB5685.namprd12.prod.outlook.com (2603:10b6:510:13c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR12MB5685:EE_|SJ0PR12MB6735:EE_ X-MS-Office365-Filtering-Correlation-Id: 58200901-401f-4aef-6ae2-08dec61870dd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|18002099003|22082099003|11063799006|56012099006; X-Microsoft-Antispam-Message-Info: cimVhFb796Dt1SzVI1BF2IaVKhflbAxMRqWwCKmSzr37qcGJJH7YAxF88F7hdb28v14zaQk9+S7AD+YbQ2T58sNA/bIQ/LblfEAREiQJ6GuK78UisC4QwNcFFfPVJiMietWb0d8yHhyMvZzJCRacgAk2cNaPTlS4URaledzABzmDtfqxz1B0SuZMPWJ56rRlObpHfxe6y1zOoVEBpn2g+uDNCqGeGXZasD832BdvIfa1LlhKH0XQyaVlskA/SeZIF/C+wv30JKsJmLdY+OLw7o+pxIl2fVYKWkaa1hR4towJkycoqrM1ub8BxNHtWg5fkDf8Vr5w9zDSCXguZh+vNEq2QzNAd892TvVfp2J/x54ToJGBVsmARs+ZICEIYoYaRMCXhfwrn9IfdZVFHfdycH9pGWINwgox9W1GZWbwpmC+rVYOdgHKFpdXofc8E8jWIRR16eKddQhCJoFukQHKk7VmDPRdtube3p2dEOe74fSxd8kb5P0hmfFfR3Hh7+ppobrZHILIXDm1tLOBEKExLVZcBxg4dc6AKJYHwQZPEFYMYsCQx7Q1FJQvUCnd19p5keM8YJgPKWUbcFedV7PTRGLa6c3NwvcaRAchDH9/KcD56nF2XIi5m9jh+aR7zWaf8DBA8T+vRPAyHAXne9dAeXH2XfWn5nYlr0CDgAytFYtAildBwqlyKTieRKoXAVb9 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH7PR12MB5685.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(18002099003)(22082099003)(11063799006)(56012099006); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?QmxWdjZpMEFZQVYrYlJubi9yNEpldFk4TTR4OGtGa0Rna2FEMmd2eEN6SmFo?= =?utf-8?B?VzFzK2J3Z3U5RlRYT2w3bXFVUE55UzZsQlZXNjNTVmdkSlpwM2tjNFFoU3A2?= =?utf-8?B?MmwvY3puT2pWVEVSZEFBeEt1Si85Q1RKTDJxMnJqelZlM3RaMG1IbjNPN3lw?= =?utf-8?B?SVp2aUlBTGJVY0lRLzdMcm1YTUJiL1RiK1IrVDJMbFR3UC8rQkp6TTF2VVRX?= =?utf-8?B?STNyUEt1QWJoazlTQ2FGd3RVN3NscDZzbTRzRlJrY3F6eThyZmI1REpWSDMw?= =?utf-8?B?N3VLdHFEemc1d2xyNnlMQmZDWmtZMTZ3W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Y3RIN3FoTGJxWU9za2Z0Zll6M01XVTUvai85anp2YUJvV0p3QUcvY1gw?= =?utf-8?B?cE5XVEFGMlpZaGFEZng3SnBaSjFqVHJndnExcXlCeGZ4UmtWUWExYzNQa0JN?= =?utf-8?B?YmdmV21meXdqcmFJNG1zOEwxdmFEZjY4YnFRVFhNekFuMWNJWUw1OXFralBw?= =?utf-8?Q?gsnJ8BrDbURUb/sRUe?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 58200901-401f-4aef-6ae2-08dec61870dd X-MS-Exchange-CrossTenant-AuthSource: PH7PR12MB5685.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2026 11:15:41.1489 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: EVt6huBhbef0Xh5LS8Hhhe/6K4g6Co1q2/iIbVr3sNTtIukZFxBdiFAZ8+mCj+cj X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6735 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" On 6/1/26 08:41, Zhu Lingshan wrote: > MES process context is a process-level page > where process specific context is saved for > MES scheduler. > > However, current user-queue code path assigns > fw_obj of a queue to MES process_context_addr > when adding the queue to MES. > > This means every new queue from the same process > would replace the previous process context address > with that queue's fw_obj address. > What's worse is, when user space frees a queue, > its fw_obj will be freed as well, causing MES > working on a NULL page pointer. > > This issue leads to inconsistency and crash > in the scheduler. > > This commit allocates a process-level page for > MES process contexts for a process other than queue-level > > Signed-off-by: Zhu Lingshan Reviewed-by: Christian König > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 6 +++ > drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h | 2 + > drivers/gpu/drm/amd/amdgpu/mes_userqueue.c | 51 +++++++++++++++++----- > 3 files changed, 47 insertions(+), 12 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c > index 38e310a8694d..951d5da850be 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c > @@ -1172,6 +1172,7 @@ int amdgpu_userq_mgr_init(struct amdgpu_userq_mgr *userq_mgr, struct drm_file *f > xa_init_flags(&userq_mgr->userq_xa, XA_FLAGS_ALLOC); > userq_mgr->adev = adev; > userq_mgr->file = file_priv; > + mutex_init(&userq_mgr->proc_ctx_lock); > > INIT_DELAYED_WORK(&userq_mgr->resume_work, amdgpu_userq_restore_worker); > INIT_WORK(&userq_mgr->reset_work, amdgpu_userq_mgr_reset_work); > @@ -1225,6 +1226,11 @@ void amdgpu_userq_mgr_fini(struct amdgpu_userq_mgr *userq_mgr) > */ > cancel_work_sync(&userq_mgr->reset_work); > > + amdgpu_bo_free_kernel(&userq_mgr->proc_ctx_obj.obj, > + &userq_mgr->proc_ctx_obj.gpu_addr, > + &userq_mgr->proc_ctx_obj.cpu_ptr); > + > + mutex_destroy(&userq_mgr->proc_ctx_lock); > mutex_destroy(&userq_mgr->userq_mutex); > } > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h > index 28cfc6682333..a5867ffe6988 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h > @@ -127,6 +127,8 @@ struct amdgpu_userq_mgr { > struct amdgpu_device *adev; > struct delayed_work resume_work; > struct drm_file *file; > + struct mutex proc_ctx_lock; > + struct amdgpu_userq_obj proc_ctx_obj; > > /** > * @reset_work: > diff --git a/drivers/gpu/drm/amd/amdgpu/mes_userqueue.c b/drivers/gpu/drm/amd/amdgpu/mes_userqueue.c > index e9189f07c6dc..6c8a44cee34b 100644 > --- a/drivers/gpu/drm/amd/amdgpu/mes_userqueue.c > +++ b/drivers/gpu/drm/amd/amdgpu/mes_userqueue.c > @@ -133,8 +133,8 @@ static int mes_userq_map(struct amdgpu_usermode_queue *queue) > queue_input.gang_quantum = 10000; > queue_input.paging = false; > > - queue_input.process_context_addr = ctx->gpu_addr; > - queue_input.gang_context_addr = ctx->gpu_addr + AMDGPU_USERQ_PROC_CTX_SZ; > + queue_input.process_context_addr = uq_mgr->proc_ctx_obj.gpu_addr; > + queue_input.gang_context_addr = ctx->gpu_addr; > queue_input.inprocess_gang_priority = AMDGPU_MES_PRIORITY_LEVEL_NORMAL; > queue_input.gang_global_priority_level = convert_to_mes_priority(queue->priority); > > @@ -169,7 +169,7 @@ static int mes_userq_unmap(struct amdgpu_usermode_queue *queue) > > memset(&queue_input, 0x0, sizeof(struct mes_remove_queue_input)); > queue_input.doorbell_offset = queue->doorbell_index; > - queue_input.gang_context_addr = ctx->gpu_addr + AMDGPU_USERQ_PROC_CTX_SZ; > + queue_input.gang_context_addr = ctx->gpu_addr; > > amdgpu_mes_lock(&adev->mes); > r = adev->mes.funcs->remove_hw_queue(&adev->mes, &queue_input); > @@ -186,12 +186,8 @@ static int mes_userq_create_ctx_space(struct amdgpu_userq_mgr *uq_mgr, > struct amdgpu_userq_obj *ctx = &queue->fw_obj; > int r, size; > > - /* > - * The FW expects at least one page space allocated for > - * process ctx and gang ctx each. Create an object > - * for the same. > - */ > - size = AMDGPU_USERQ_PROC_CTX_SZ + AMDGPU_USERQ_GANG_CTX_SZ; > + /* The FW expects at least one page space allocated for gang ctx. */ > + size = AMDGPU_USERQ_GANG_CTX_SZ; > r = amdgpu_bo_create_kernel(uq_mgr->adev, size, 0, > AMDGPU_GEM_DOMAIN_GTT, > &ctx->obj, &ctx->gpu_addr, > @@ -257,6 +253,30 @@ static int mes_userq_detect_and_reset(struct amdgpu_device *adev, > return r; > } > > +static int mes_userq_create_proc_ctx_space(struct amdgpu_userq_mgr *uq_mgr) > +{ > + int r = 0; > + > + mutex_lock(&uq_mgr->proc_ctx_lock); > + /* This check is a necessary because amdgpu_bo_create_kernel() > + * calls helpers like amdgpu_bo_pin() and memset() unconditionally > + */ > + if (!uq_mgr->proc_ctx_obj.obj) { > + r = amdgpu_bo_create_kernel(uq_mgr->adev, AMDGPU_USERQ_PROC_CTX_SZ, > + 0, AMDGPU_GEM_DOMAIN_GTT, > + &uq_mgr->proc_ctx_obj.obj, > + &uq_mgr->proc_ctx_obj.gpu_addr, > + &uq_mgr->proc_ctx_obj.cpu_ptr); > + > + if (!r) > + memset(uq_mgr->proc_ctx_obj.cpu_ptr, 0, AMDGPU_USERQ_PROC_CTX_SZ); > + } > + > + mutex_unlock(&uq_mgr->proc_ctx_lock); > + > + return r; > +} > + > static int mes_userq_mqd_create(struct amdgpu_usermode_queue *queue, > struct drm_amdgpu_userq_in *args_in) > { > @@ -429,7 +449,14 @@ static int mes_userq_mqd_create(struct amdgpu_usermode_queue *queue, > goto free_mqd; > } > > - /* Create BO for FW operations */ > + /* Create per-process MES process context BO */ > + r = mes_userq_create_proc_ctx_space(uq_mgr); > + if (r) { > + DRM_ERROR("Failed to allocate MES process context space bo, error: %d\n", r); > + goto free_mqd; > + } > + > + /* Create BO of a gang for FW operations */ > r = mes_userq_create_ctx_space(uq_mgr, queue, mqd_user); > if (r) { > DRM_ERROR("Failed to allocate BO for userqueue (%d)", r); > @@ -492,7 +519,7 @@ static int mes_userq_preempt(struct amdgpu_usermode_queue *queue) > *fence_ptr = 0; > > memset(&queue_input, 0x0, sizeof(struct mes_suspend_gang_input)); > - queue_input.gang_context_addr = ctx->gpu_addr + AMDGPU_USERQ_PROC_CTX_SZ; > + queue_input.gang_context_addr = ctx->gpu_addr; > queue_input.suspend_fence_addr = fence_gpu_addr; > queue_input.suspend_fence_value = 1; > amdgpu_mes_lock(&adev->mes); > @@ -529,7 +556,7 @@ static int mes_userq_restore(struct amdgpu_usermode_queue *queue) > return 0; > > memset(&queue_input, 0x0, sizeof(struct mes_resume_gang_input)); > - queue_input.gang_context_addr = ctx->gpu_addr + AMDGPU_USERQ_PROC_CTX_SZ; > + queue_input.gang_context_addr = ctx->gpu_addr; > > amdgpu_mes_lock(&adev->mes); > r = adev->mes.funcs->resume_gang(&adev->mes, &queue_input);