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 81232C369D1 for ; Mon, 28 Apr 2025 02:09:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ECF1310E2B2; Mon, 28 Apr 2025 02:09:11 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="iMFyOtFy"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by gabe.freedesktop.org (Postfix) with ESMTPS id AEB2110E2B2 for ; Mon, 28 Apr 2025 02:09:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1745806149; x=1777342149; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=fO+eG1jhAPNOVSJRpdsaHXkDish/2dzjiD4F2Us1VGI=; b=iMFyOtFyjFzVgWpz0LZvSxTp9gL3cmkuN2+tSHQ0+mEUGbPZ/9uqPntI GtwTrFECnS+Mn7j95ooE1yrvkYnLOL6nOcnsQERkrd5Ltk15uauC2ScWH +RIyzCbbXAFuEAADK1vXsEbNXmmuaGkA39wmEr5RA0SDn4on40khRr0X6 L57xpFZ9+qYWeoLzwBpIrLaegx/ctIwgmbD/Lw04c8hjmNG41xAf39cVF 45mr/byIxoBqfX4o1qIFCTT7R+kKuEYBwp6nobmIDzQtgyL9kMff52Jod D/dGv4GH3YzEaRuyStAXieqs8BrkmNPRwESmQrQ0jYrJd+m1E5dhCIAqS Q==; X-CSE-ConnectionGUID: 5GRas9a5RiiJnfYXsRxoqA== X-CSE-MsgGUID: 6nyAWazqRrqUNLQZnab97A== X-IronPort-AV: E=McAfee;i="6700,10204,11416"; a="72757761" X-IronPort-AV: E=Sophos;i="6.15,245,1739865600"; d="scan'208";a="72757761" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2025 19:09:09 -0700 X-CSE-ConnectionGUID: 53QxHPCkRS+TpHc/M9BEDQ== X-CSE-MsgGUID: CJXnB/YWQsa9Lw7diXjelQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,245,1739865600"; d="scan'208";a="138468670" Received: from orsmsx902.amr.corp.intel.com ([10.22.229.24]) by fmviesa004.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2025 19:09:08 -0700 Received: from ORSMSX901.amr.corp.intel.com (10.22.229.23) by ORSMSX902.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Sun, 27 Apr 2025 19:09:08 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by ORSMSX901.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14 via Frontend Transport; Sun, 27 Apr 2025 19:09:08 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.48) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.44; Sun, 27 Apr 2025 19:09:07 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DHoYZjaVL7H7y1mAZlfdbAUuAoGef6MzGqwt6GQWrEF7AyCKN/jJRB5OjlodSt/cs/UTpOL3XGFOtQX2ZaDgRCIXT3MyAPM4tfDvCR1+FAgozG/7d/UkV5ObMBbqLV9S/rztF2+Y4kDcaFC/VfNmITgI/1QjN8AcHSr4QBojqGUGEkLcWD4Rxgz90tYrOvyRtndauY8DVljLEIK/LlQb7krPzeaQ2e4EevDl0zpwR24PqJShfMLOijuw+S9kYEKCKNXd+di3besla7EK+iNWXokpf+NxW5oTL/kE8JUWW76bUQAGzIZp6oaSp9SXlcScLwe73L7CXPImShf+56FCqA== 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=sxYED5DkZhfOReqY8+ZpNTeAj8Ko6BcwvVXu3mi+894=; b=yWfmN87Djxi39CNBmlQnrc7Y3kRY9RBB5YNxq+TE6u2Iuij19lmXKe6KeUlwuF7sqUhOgu5syp99pi9e6hLSllRzQAG5o92Qjt3glZbFtq4t1ujhyf4x5U4tg1DYr509JladhLuX2tHwQA47u1IAabUMeI4MAcfz1WdMhJSozF75rd6RhXsFTtebAxUrgXXbKGYCYkTpAA5lTqfz0wDh66CZACsdAJY7xl3nxiHw8U4LGbMQM8oPy8F+eRQ+rERqanR6TCMpgAC43b5se/EBF4kOT3PctCD9mrnX19bwCCvs7VeypB68oNlLUgIvTtcwE7Vj0CDf8YnYBAUUofhI7g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH7PR11MB6522.namprd11.prod.outlook.com (2603:10b6:510:212::12) by PH8PR11MB7990.namprd11.prod.outlook.com (2603:10b6:510:259::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8678.27; Mon, 28 Apr 2025 02:08:24 +0000 Received: from PH7PR11MB6522.namprd11.prod.outlook.com ([fe80::9e94:e21f:e11a:332]) by PH7PR11MB6522.namprd11.prod.outlook.com ([fe80::9e94:e21f:e11a:332%4]) with mapi id 15.20.8678.028; Mon, 28 Apr 2025 02:08:24 +0000 Date: Sun, 27 Apr 2025 19:09:45 -0700 From: Matthew Brost To: Dafna Hirschfeld CC: Jonathan Cavitt , , , , , , , , , , , , , Subject: Re: [PATCH v23 2/5] drm/xe/xe_gt_pagefault: Move pagefault struct to header Message-ID: References: <20250424204917.172708-1-jonathan.cavitt@intel.com> <20250424204917.172708-3-jonathan.cavitt@intel.com> <7jwsm2mc6nb5khkhgql6tdb2nb6tlmutprs2x4fjboqoiqxne3@fayagpsyc4a6> Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-ClientProxiedBy: MW4PR03CA0206.namprd03.prod.outlook.com (2603:10b6:303:b8::31) To PH7PR11MB6522.namprd11.prod.outlook.com (2603:10b6:510:212::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR11MB6522:EE_|PH8PR11MB7990:EE_ X-MS-Office365-Filtering-Correlation-Id: 36890a26-8e3a-45e6-97a9-08dd85f98e6b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: =?iso-8859-1?Q?8puhs28dLXCkeU+d+Uh5i8CzdJQ1HQlZyxQajl9RD0dvJjQuf+DWpeb0y4?= =?iso-8859-1?Q?CLzl6sfIIhPq0bqq93cqnrc+bcjoGYEhEteOzRXEa+cXfP3acPxbchoKed?= =?iso-8859-1?Q?vVPI75wH4ZATDIx4KcGsjuIx3/BSMTjAPGTEMjpu3g4BJBk/nev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bBw5J+0SGM/ojKd7yHHeOaXo0WaKSDEnRcvp?= =?iso-8859-1?Q?YnbgJkw5hkPAHwxxJuPgoNs/V6pSYTLVIGtenBvVBfCL9hW3ZNljxh3T6h?= =?iso-8859-1?Q?g1qeHWxq1iuMkYw/BI7vEpaLW6YuS73Nc70A14K7G25yF03KoT5fpwvNxE?= =?iso-8859-1?Q?nEoXPW4o4P5JEaehzKDg+YUyaJb/XgnkO0hwL0GvPVxR68+sAsMdA5Q5XM?= =?iso-8859-1?Q?AUi+wlyC1ou2+KGaWGYmsl4Xupwe+psbEyvh/kpzBs13g0BCl1Ilqiv9Qb?= =?iso-8859-1?Q?UHvEETrbxMFud5JVzYneBfYDrs4nuiL4+Gm0dXj4iix44QwFrZmEquQK0d?= =?iso-8859-1?Q?J1dreVFtJilGqDqbVhIpaN8E7mRKSQda+0rksz9SKFYYhXyv5BYuwx0Gdv?= =?iso-8859-1?Q?stzGF3VIzUflQFO23ycHYg0dgRbNilvIRtzd2yNDTFueQ8n5ubjkRUURuE?= =?iso-8859-1?Q?Y=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH7PR11MB6522.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(376014)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?pQbuaAueP9mBq8eMMl9UfDOzw6h2l1IdzFwhtJANhAg/U2RmGXGhQaw3rj?= =?iso-8859-1?Q?maC9q3PxbWz9XtubSbU8p1ZhbjAEzGr2sGx2zBkycbuq0mfahs06hyYMtE?= =?iso-8859-1?Q?E0k015X6f/RbzvdaIwuV8V1yMD25cPZICHW5wVb5ITtIUEBUiYuSCZ3fI2?= =?iso-8859-1?Q?4SGZsYWKiu0FyqrzBJ+K3Yi4Bhe7/1VpGrcEsKHmV4IvIbZ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1LY9lzczw4zQwifg+M56U9P8+glFUS6QmXWS8Cg3thH?= =?iso-8859-1?Q?bpg3RJFLLcPU6u3kgQOnqhvDJnkPwp3nsYAffNMqZYawDhaaMllM5hBz5g?= =?iso-8859-1?Q?AzlPNfC6vSzG0TnlJ+S1P0Ei8ZswfGphy7idd9h0eix1NA+tVk0dx2EVwf?= =?iso-8859-1?Q?KDXn++DOzp33anE18C+HBWRI7gP03UhnIRXhypS2WMzWloTBU1W0c5Gty8?= =?iso-8859-1?Q?r63MEDGRK+QeQrPQ+HU/hprV6fpCZ4F+nDq8KVH+ReCtpjleg97T84sPU+?= =?iso-8859-1?Q?E2e3WiYBrF+Rw1ZBM+Of3zuCGKcM7kwLBq6AY7fLQZ3VmbwGPThyoYH5gG?= =?iso-8859-1?Q?QTJsEpUGajjjxqb6ziQxxxTBHqsOBl0CMoXKNhMm7A10Duq82IQUEPk9Jx?= =?iso-8859-1?Q?V7FwQt9wT2donHatsi9Q/5NVjJdLqW8im5UCrk1Ojo155O1eZGDKJVEuDC?= =?iso-8859-1?Q?6Tym57iWhTWw033kHtZ8DroTY+zwwXZ52A0Ifj6W294OnF+ZHBn5hQIJf8?= =?iso-8859-1?Q?mi0+ZiAtI00AC0WnGwrFGG3tdRCn4xJcEvWPfPqohTst4uMpU1D9cUxw?= =?iso-8859-1?Q?=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 36890a26-8e3a-45e6-97a9-08dd85f98e6b X-MS-Exchange-CrossTenant-AuthSource: PH7PR11MB6522.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Apr 2025 02:08:24.1677 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ur1smXn5sxT/TiQmGAkrdeW4UDnOnglcHYxUJSqMOo3P7XOLxxekbPV6See99qIpHVK2vNLB8lVEa0hS/DvHFg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR11MB7990 X-OriginatorOrg: intel.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Sun, Apr 27, 2025 at 06:51:30PM -0700, Matthew Brost wrote: Ignore this one... I screwed up the reply list as intel-xe is not include. Replying again to include intel-xe. Matt > On Sun, Apr 27, 2025 at 02:57:22PM +0300, Dafna Hirschfeld wrote: > > On 24.04.2025 20:49, Jonathan Cavitt wrote: > > > Move the pagefault struct from xe_gt_pagefault.c to the > > > xe_gt_pagefault_types.h header file, and move the associated enum values > > > into the regs folder under xe_pagefault_desc.h > > > > > > Since xe_pagefault_desc.h is being initialized here, also move the > > > xe_guc_pagefault_desc hardware formats to the new file. > > > > Hi, currently page fault is assumed to be handled by guc only. > > Yea, this is layered incorrectly - this is my bad. So in our TLB > invalidation code, also my bad. > > > In order to make the descriptor more general, I sent two patches moving > > the descriptor to xe_uc_fw_types.h. [1] > > Maybe my patches could be used instead of this one? > > [1] https://lore.kernel.org/intel-xe/20250209121217.1604458-1-dafna.hirschfeld@intel.com/ > > > > I think this patch is merged, or will be very shortly. I don't this is > worth holding up, but in general I think the flow should be adjusted to > roughly... > > - GuC (or any other PF client) parses PF into HW agnostic format and > passes it to GT page fault component - I think we drop any fields from > the current GuC format that are unused by the GT page fault component > - A vfunc is attached too the HW agnostic format which is used to signal > PF done, in the case of the GuC this issues H2G > - All GuC specific code is removed from GT page fault component > > This should allow other firmwares to hook into the generic page fault > code. > > Matt > > > Thanks, > > Dafna > > > > > > > > > > v2: > > > - Normalize names for common header (Matt Brost) > > > > > > v3: > > > - s/Migrate/Move (Michal W) > > > - s/xe_pagefault/xe_gt_pagefault (Michal W) > > > - Create new header file, xe_gt_pagefault_types.h (Michal W) > > > - Add kernel docs (Michal W) > > > > > > v4: > > > - Fix includes usage (Michal W) > > > - Reference Bspec (Michal W) > > > > > > v5: > > > - Convert enums to defines in regs folder (Michal W) > > > - Move xe_guc_pagefault_desc to regs folder (Michal W) > > > > > > Bspec: 77412 > > > Signed-off-by: Jonathan Cavitt > > > Reviewed-by: Shuicheng Lin > > > Acked-by: Matthew Brost > > > Cc: Michal Wajdeczko > > > --- > > > drivers/gpu/drm/xe/regs/xe_pagefault_desc.h | 49 +++++++++++++++++++++ > > > drivers/gpu/drm/xe/xe_gt_pagefault.c | 43 ++++-------------- > > > drivers/gpu/drm/xe/xe_gt_pagefault_types.h | 42 ++++++++++++++++++ > > > drivers/gpu/drm/xe/xe_guc_fwif.h | 28 ------------ > > > 4 files changed, 100 insertions(+), 62 deletions(-) > > > create mode 100644 drivers/gpu/drm/xe/regs/xe_pagefault_desc.h > > > create mode 100644 drivers/gpu/drm/xe/xe_gt_pagefault_types.h > > > > > > diff --git a/drivers/gpu/drm/xe/regs/xe_pagefault_desc.h b/drivers/gpu/drm/xe/regs/xe_pagefault_desc.h > > > new file mode 100644 > > > index 000000000000..a169ac274e14 > > > --- /dev/null > > > +++ b/drivers/gpu/drm/xe/regs/xe_pagefault_desc.h > > > @@ -0,0 +1,49 @@ > > > +/* SPDX-License-Identifier: MIT */ > > > +/* > > > + * Copyright © 2025 Intel Corporation > > > + */ > > > + > > > +#ifndef _XE_PAGEFAULT_DESC_H_ > > > +#define _XE_PAGEFAULT_DESC_H_ > > > + > > > +#include > > > +#include > > > + > > > +struct xe_guc_pagefault_desc { > > > + u32 dw0; > > > +#define PFD_FAULT_LEVEL GENMASK(2, 0) > > > +#define PFD_SRC_ID GENMASK(10, 3) > > > +#define PFD_RSVD_0 GENMASK(17, 11) > > > +#define XE2_PFD_TRVA_FAULT BIT(18) > > > +#define PFD_ENG_INSTANCE GENMASK(24, 19) > > > +#define PFD_ENG_CLASS GENMASK(27, 25) > > > +#define PFD_PDATA_LO GENMASK(31, 28) > > > + > > > + u32 dw1; > > > +#define PFD_PDATA_HI GENMASK(11, 0) > > > +#define PFD_PDATA_HI_SHIFT 4 > > > +#define PFD_ASID GENMASK(31, 12) > > > + > > > + u32 dw2; > > > +#define PFD_ACCESS_TYPE GENMASK(1, 0) > > > +#define PFD_FAULT_TYPE GENMASK(3, 2) > > > +#define PFD_VFID GENMASK(9, 4) > > > +#define PFD_RSVD_1 GENMASK(11, 10) > > > +#define PFD_VIRTUAL_ADDR_LO GENMASK(31, 12) > > > +#define PFD_VIRTUAL_ADDR_LO_SHIFT 12 > > > + > > > + u32 dw3; > > > +#define PFD_VIRTUAL_ADDR_HI GENMASK(31, 0) > > > +#define PFD_VIRTUAL_ADDR_HI_SHIFT 32 > > > +} __packed; > > > + > > > +#define FLT_ACCESS_TYPE_READ 0u > > > +#define FLT_ACCESS_TYPE_WRITE 1u > > > +#define FLT_ACCESS_TYPE_ATOMIC 2u > > > +#define FLT_ACCESS_TYPE_RESERVED 3u > > > + > > > +#define FLT_TYPE_NOT_PRESENT_FAULT 0u > > > +#define FLT_TYPE_WRITE_ACCESS_VIOLATION 1u > > > +#define FLT_TYPE_ATOMIC_ACCESS_VIOLATION 2u > > > + > > > +#endif > > > diff --git a/drivers/gpu/drm/xe/xe_gt_pagefault.c b/drivers/gpu/drm/xe/xe_gt_pagefault.c > > > index d4e3b7eb165a..93afa54c8780 100644 > > > --- a/drivers/gpu/drm/xe/xe_gt_pagefault.c > > > +++ b/drivers/gpu/drm/xe/xe_gt_pagefault.c > > > @@ -12,8 +12,10 @@ > > > #include > > > > > > #include "abi/guc_actions_abi.h" > > > +#include "regs/xe_pagefault_desc.h" > > > #include "xe_bo.h" > > > #include "xe_gt.h" > > > +#include "xe_gt_pagefault_types.h" > > > #include "xe_gt_stats.h" > > > #include "xe_gt_tlb_invalidation.h" > > > #include "xe_guc.h" > > > @@ -23,33 +25,6 @@ > > > #include "xe_trace_bo.h" > > > #include "xe_vm.h" > > > > > > -struct pagefault { > > > - u64 page_addr; > > > - u32 asid; > > > - u16 pdata; > > > - u8 vfid; > > > - u8 access_type; > > > - u8 fault_type; > > > - u8 fault_level; > > > - u8 engine_class; > > > - u8 engine_instance; > > > - u8 fault_unsuccessful; > > > - bool trva_fault; > > > -}; > > > - > > > -enum access_type { > > > - ACCESS_TYPE_READ = 0, > > > - ACCESS_TYPE_WRITE = 1, > > > - ACCESS_TYPE_ATOMIC = 2, > > > - ACCESS_TYPE_RESERVED = 3, > > > -}; > > > - > > > -enum fault_type { > > > - NOT_PRESENT = 0, > > > - WRITE_ACCESS_VIOLATION = 1, > > > - ATOMIC_ACCESS_VIOLATION = 2, > > > -}; > > > - > > > struct acc { > > > u64 va_range_base; > > > u32 asid; > > > @@ -61,9 +36,9 @@ struct acc { > > > u8 engine_instance; > > > }; > > > > > > -static bool access_is_atomic(enum access_type access_type) > > > +static bool access_is_atomic(u32 access_type) > > > { > > > - return access_type == ACCESS_TYPE_ATOMIC; > > > + return access_type == FLT_ACCESS_TYPE_ATOMIC; > > > } > > > > > > static bool vma_is_valid(struct xe_tile *tile, struct xe_vma *vma) > > > @@ -205,7 +180,7 @@ static struct xe_vm *asid_to_vm(struct xe_device *xe, u32 asid) > > > return vm; > > > } > > > > > > -static int handle_pagefault(struct xe_gt *gt, struct pagefault *pf) > > > +static int handle_pagefault(struct xe_gt *gt, struct xe_gt_pagefault *pf) > > > { > > > struct xe_device *xe = gt_to_xe(gt); > > > struct xe_vm *vm; > > > @@ -237,7 +212,7 @@ static int handle_pagefault(struct xe_gt *gt, struct pagefault *pf) > > > goto unlock_vm; > > > } > > > > > > - if (xe_vma_read_only(vma) && pf->access_type != ACCESS_TYPE_READ) { > > > + if (xe_vma_read_only(vma) && pf->access_type != FLT_ACCESS_TYPE_READ) { > > > err = -EPERM; > > > goto unlock_vm; > > > } > > > @@ -271,7 +246,7 @@ static int send_pagefault_reply(struct xe_guc *guc, > > > return xe_guc_ct_send(&guc->ct, action, ARRAY_SIZE(action), 0, 0); > > > } > > > > > > -static void print_pagefault(struct xe_device *xe, struct pagefault *pf) > > > +static void print_pagefault(struct xe_device *xe, struct xe_gt_pagefault *pf) > > > { > > > drm_dbg(&xe->drm, "\n\tASID: %d\n" > > > "\tVFID: %d\n" > > > @@ -291,7 +266,7 @@ static void print_pagefault(struct xe_device *xe, struct pagefault *pf) > > > > > > #define PF_MSG_LEN_DW 4 > > > > > > -static bool get_pagefault(struct pf_queue *pf_queue, struct pagefault *pf) > > > +static bool get_pagefault(struct pf_queue *pf_queue, struct xe_gt_pagefault *pf) > > > { > > > const struct xe_guc_pagefault_desc *desc; > > > bool ret = false; > > > @@ -378,7 +353,7 @@ static void pf_queue_work_func(struct work_struct *w) > > > struct xe_gt *gt = pf_queue->gt; > > > struct xe_device *xe = gt_to_xe(gt); > > > struct xe_guc_pagefault_reply reply = {}; > > > - struct pagefault pf = {}; > > > + struct xe_gt_pagefault pf = {}; > > > unsigned long threshold; > > > int ret; > > > > > > diff --git a/drivers/gpu/drm/xe/xe_gt_pagefault_types.h b/drivers/gpu/drm/xe/xe_gt_pagefault_types.h > > > new file mode 100644 > > > index 000000000000..b7d41b558de3 > > > --- /dev/null > > > +++ b/drivers/gpu/drm/xe/xe_gt_pagefault_types.h > > > @@ -0,0 +1,42 @@ > > > +/* SPDX-License-Identifier: MIT */ > > > +/* > > > + * Copyright © 2022-2025 Intel Corporation > > > + */ > > > + > > > +#ifndef _XE_GT_PAGEFAULT_TYPES_H_ > > > +#define _XE_GT_PAGEFAULT_TYPES_H_ > > > + > > > +#include > > > + > > > +/** > > > + * struct xe_gt_pagefault - Structure of pagefaults returned by the > > > + * pagefault handler > > > + */ > > > +struct xe_gt_pagefault { > > > + /** @page_addr: faulted address of this pagefault */ > > > + u64 page_addr; > > > + /** @asid: ASID of this pagefault */ > > > + u32 asid; > > > + /** @pdata: PDATA of this pagefault */ > > > + u16 pdata; > > > + /** @vfid: VFID of this pagefault */ > > > + u8 vfid; > > > + /** @access_type: access type of this pagefault */ > > > + u8 access_type; > > > + /** @fault_type: fault type of this pagefault */ > > > + u8 fault_type; > > > + /** @fault_level: fault level of this pagefault */ > > > + u8 fault_level; > > > + /** @engine_class: engine class this pagefault was reported on */ > > > + u8 engine_class; > > > + /** @engine_instance: engine instance this pagefault was reported on */ > > > + u8 engine_instance; > > > + /** @fault_unsuccessful: flag for if the pagefault recovered or not */ > > > + u8 fault_unsuccessful; > > > + /** @prefetch: unused */ > > > + bool prefetch; > > > + /** @trva_fault: is set if this is a TRTT fault */ > > > + bool trva_fault; > > > +}; > > > + > > > +#endif > > > diff --git a/drivers/gpu/drm/xe/xe_guc_fwif.h b/drivers/gpu/drm/xe/xe_guc_fwif.h > > > index 6f57578b07cb..30ac21bb4f15 100644 > > > --- a/drivers/gpu/drm/xe/xe_guc_fwif.h > > > +++ b/drivers/gpu/drm/xe/xe_guc_fwif.h > > > @@ -290,34 +290,6 @@ enum xe_guc_response_desc_type { > > > FAULT_RESPONSE_DESC > > > }; > > > > > > -struct xe_guc_pagefault_desc { > > > - u32 dw0; > > > -#define PFD_FAULT_LEVEL GENMASK(2, 0) > > > -#define PFD_SRC_ID GENMASK(10, 3) > > > -#define PFD_RSVD_0 GENMASK(17, 11) > > > -#define XE2_PFD_TRVA_FAULT BIT(18) > > > -#define PFD_ENG_INSTANCE GENMASK(24, 19) > > > -#define PFD_ENG_CLASS GENMASK(27, 25) > > > -#define PFD_PDATA_LO GENMASK(31, 28) > > > - > > > - u32 dw1; > > > -#define PFD_PDATA_HI GENMASK(11, 0) > > > -#define PFD_PDATA_HI_SHIFT 4 > > > -#define PFD_ASID GENMASK(31, 12) > > > - > > > - u32 dw2; > > > -#define PFD_ACCESS_TYPE GENMASK(1, 0) > > > -#define PFD_FAULT_TYPE GENMASK(3, 2) > > > -#define PFD_VFID GENMASK(9, 4) > > > -#define PFD_RSVD_1 GENMASK(11, 10) > > > -#define PFD_VIRTUAL_ADDR_LO GENMASK(31, 12) > > > -#define PFD_VIRTUAL_ADDR_LO_SHIFT 12 > > > - > > > - u32 dw3; > > > -#define PFD_VIRTUAL_ADDR_HI GENMASK(31, 0) > > > -#define PFD_VIRTUAL_ADDR_HI_SHIFT 32 > > > -} __packed; > > > - > > > struct xe_guc_pagefault_reply { > > > u32 dw0; > > > #define PFR_VALID BIT(0) > > > -- > > > 2.43.0 > > >