Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1088592rbb; Sun, 25 Feb 2024 19:47:57 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCULIIkSM+NYNylA9vvob+F3QWuIqYhVClXDPN80+2W39+MyjHlQEVYJd0TRsfR57XcZJSFO3zDlaxfePMyDUJDtv/z92i2sH85oG+lTlA== X-Google-Smtp-Source: AGHT+IFlzqq0qu0nWXzMDEvpZzXglzYjyNaQdfteZMcOBHVYyUpWrzouuoONaiAcU7c9JSlxanyU X-Received: by 2002:a17:90a:1789:b0:29a:9dd1:d45b with SMTP id q9-20020a17090a178900b0029a9dd1d45bmr6380974pja.3.1708919276862; Sun, 25 Feb 2024 19:47:56 -0800 (PST) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id e21-20020a17090a9a9500b0029a47fc9cf9si4743439pjp.178.2024.02.25.19.47.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 19:47:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80479-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=m47QsHMO; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-80479-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80479-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 8C5AA281612 for ; Mon, 26 Feb 2024 03:47:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E2DB618EA1; Mon, 26 Feb 2024 03:47:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="m47QsHMO" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 27086DF44 for ; Mon, 26 Feb 2024 03:47:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=192.198.163.11 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708919270; cv=fail; b=NwjKQcugEnxPOZ3yiN62SFW6C4lWXhp6sV+O6/BjBuuVqq9waINqMMWEfCXO7i4Sax5WS9tNmEH/jayvikcSBNP1YyzORnSsauwzTTT8oOHIPZa+NpochvnpDrf5NIHgtf8kbIMu8uagtS1rbTDMa1ZSquZrbzv3fpNMT8GUenU= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708919270; c=relaxed/simple; bh=2iiW3naxHnEZK+lzSGzaAKebHL61cLXJIYV9IH4hNtw=; h=Date:From:To:CC:Subject:Message-ID:References:Content-Type: Content-Disposition:In-Reply-To:MIME-Version; b=NGZpSBAO966maJ1FjrlwY/gtNL9o4mwvhjXmdeE6LuNOu/r5MKul0SctYfmoOf20pksWwOU8fCo/+VFqWdqshiOYOxoBkoG2daIjWKq7zHGyNIsdwMjufE4q1qTfNs/gBmIgYNTsLDFcPYmUJNkLqPiG2EPNkH3vgYTeM3RPdkg= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=m47QsHMO; arc=fail smtp.client-ip=192.198.163.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1708919269; x=1740455269; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=2iiW3naxHnEZK+lzSGzaAKebHL61cLXJIYV9IH4hNtw=; b=m47QsHMOzoD152R/RerGPKI3+mc9YFtrMwuf2WaC2zSj2EiK+gTeAn2O OpAWqHkiEtebVAsuKP9mAGseRFSvb2IIlAZyeVq2yptPn04+jM1nWHwSr jg5VR+6rgLMO03lhfPDvIKr46jBBObdWPWjHjnq29QfzclY/tLRN6NOag MaRooX/bjqrrPG5XwkVGanL2jfl2ziphNSnAoCFOEcDEl53vF+kLOLpxW ggB4nmDQVDa95a0mdFYmzj0pLLuq+oiTA3Wpnjnv/4HlFKnSofAfAakD6 r0uPK3J3v8OAuwHaOyD6ZCpwQDjnH6Nipw/dT1yGy86karnZgZTqM59TS Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10995"; a="13829514" X-IronPort-AV: E=Sophos;i="6.06,185,1705392000"; d="scan'208";a="13829514" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Feb 2024 19:47:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,185,1705392000"; d="scan'208";a="6519582" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmviesa010.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 25 Feb 2024 19:47:48 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 25 Feb 2024 19:47:47 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Sun, 25 Feb 2024 19:47:47 -0800 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.40) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Sun, 25 Feb 2024 19:47:45 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N1EaO+W8Vq6ca3C+2ontvJrIDpdyw9tax3rvS6OiHvXJs4jXHvYUKE7yEDDm2M2a29as9wxnQUHLpSR5WLtlB3YH3rtu/5j1cegtAdp6oZ8JDswipjr47SjDML8ggLO0SEDis9G+NTHxIuALW9F/d7lUdQrCtDrCLtBz7pOvPr9VSXMNRRs6j+abOLTSOO+Um9D+/JV8dD2mhlIFyF7Cl6bvnzsIg/ikB0ysrqznBLyPFzSA1Kj1MMmI0cNBGMw6lUPpuqehbumV1KfiErvhf0apsUb6rEKCacsee0oxg6fuCh5QSDoF7ckqz5GgB0rDHzPzcXIALqsSRKUpgpfLNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=IX3+4965Qqt0TusY5+wtMrbN0YTPiUxzkTLTsiIV8FQ=; b=CVm5QKQMXCzGy5SRRi5uw1fEYq9hbmWT3OPkll1VeaIAWFMF6grKCRGCH04v/KXxN4sFasAIERbWcX5tCwmgzk2M4g0fG3Fiu7VnTim9fm2kBbroRwL2qxqBDh7o+Dp0UfuJpMGu8n9/qmdSsl9GgItKqDTKKXKkro7nbIumqrC0jQIGVOFwU3+x0By1YYBCz1CnpzshxZwlYDveIvdg2DlDESKMHy0GfR8epL12asHsfANACytWipd4qunxLcYnm8bHi6kWZmfwNVR+Uow5SWUxa8l1WHCO2t7jGHA0GEGjr1E3qNvlrchktGx2aMz4nQS/SGJjJKt631lTVQA/aw== 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 CY5PR11MB6139.namprd11.prod.outlook.com (2603:10b6:930:29::17) by DM4PR11MB6168.namprd11.prod.outlook.com (2603:10b6:8:ab::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.8; Mon, 26 Feb 2024 03:47:44 +0000 Received: from CY5PR11MB6139.namprd11.prod.outlook.com ([fe80::7352:aa4b:e13e:cb01]) by CY5PR11MB6139.namprd11.prod.outlook.com ([fe80::7352:aa4b:e13e:cb01%7]) with mapi id 15.20.7339.024; Mon, 26 Feb 2024 03:47:44 +0000 Date: Sun, 25 Feb 2024 21:47:41 -0600 From: Lucas De Marchi To: Arnd Bergmann CC: Oded Gabbay , Thomas =?utf-8?Q?Hellstr=C3=B6m?= , Arnd Bergmann , "Maarten Lankhorst" , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Rodrigo Vivi , Matt Roper , "Matthew Brost" , Himal Prasad Ghimiray , Francois Dugast , Dave Airlie , , , Subject: Re: [PATCH 3/3] drm/xe/xe2: fix 64-bit division in pte_update_size Message-ID: References: <20240224121528.1972719-1-arnd@kernel.org> <20240224121528.1972719-3-arnd@kernel.org> Content-Type: text/plain; charset="us-ascii"; format=flowed Content-Disposition: inline In-Reply-To: <20240224121528.1972719-3-arnd@kernel.org> X-ClientProxiedBy: SJ0PR03CA0084.namprd03.prod.outlook.com (2603:10b6:a03:331::29) To CY5PR11MB6139.namprd11.prod.outlook.com (2603:10b6:930:29::17) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY5PR11MB6139:EE_|DM4PR11MB6168:EE_ X-MS-Office365-Filtering-Correlation-Id: 0918f65e-447e-4dca-f7f7-08dc367db0a9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rz+5pz/zjRhRYOWzp8S2FQdFTWILDc0bMaf8eP2nnKOGdEqdL9fTznWk5Ex5qgiVSfyjj7T3v9tMMWJo6yHa94DAwOnlcp0ASw0PBoh2zVcWauXBEr1L+71wMAH8D/p1EydZQ1/3I+kvTV2m3lIYg0m1D51UQOS1wz8IqzuNnOfId8DF400/Xe11ERZLj6+BkmA1YEonw1fCwrzXTU2qNazGgMa7zYs+jNbjkIyJmeEqcVFkYn/44CrSL3dOSaSi07qu+Q9Bdj1j9ZFC6lwBE9M4v+F7Sl/NE+iesehW3fgCzCJgb1UXFf10a1SAvFl+ODhWEvcIT/Ob8/p429VpOtOruhCODM/rHcWOL0G9OBPMAxte21/qr9cIie1PyfHryWkIQwfooqSZl366z7MUF3sPbbEXiPSNoVpcO2F06gG7M3UFdbqBjJOwEZzC46dUqo1SVLwNG0HvmxjnQvNOY70wizQHKjVipAtRaYTh/MImg7MsrpPjoCkDCS7rXiC9ZIzrc75JrcuJqyXWsveNaJdPD4GK8/ZnL0qLgdyhjU4dMlEBpIIqI7T6NmyX8SvcIqpLCD0DqdNpxpwx1MksxL1EFa+ixEEEO+b8ace2FauGE0gbLEOngrkxIDdy74ES X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY5PR11MB6139.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ShSIiGvZtNEYvBQMlL353jTGwcXUeLvoDO6cjMBmapiYhhrr9q64UFAcd1Pu?= =?us-ascii?Q?c2GnoiKT0pX3JR9Bg7pr3dFeKFknLnKHAHdgNL0ESV5GXnT7173ylfP7hXgT?= =?us-ascii?Q?3jWzMKAeiYLaCVlwr9ayGaxzvj1sjoehrHep+fh09TaoeQBNbZoGk2EKVdNR?= =?us-ascii?Q?sug94q5BGCmt59Zbv7oSOIt4TK2sZiDyNurkn6CveLZs+3QBpFWYG+u6Q3h+?= =?us-ascii?Q?8g3taL+sDcBRrJmnhX6YhTiHxK9RrRSlY8HxbL0ju0It4NqlrheeMOBe81Kf?= =?us-ascii?Q?TMgNqOHaRbFQCzE1q4VMwwzPB3dIKrWpdJZwm4TQCa4sL3+XfrLegCUA/3a/?= =?us-ascii?Q?rVFNwx/etluOxPJWVmPAUGREWkEoJI6bxBhwuWRkjIV1oH7VVzgUOO+E4JdI?= =?us-ascii?Q?SMFcaFWT3old5SDh6rH5jy2a0zLytXFadZr5IpII6AYMeUGjh3eiGJD821L1?= =?us-ascii?Q?HiZaGx/Ytp2fonEauWvnnxwmoXRIlwyK4kzcRzma/T7RjnEEcvB1nue5kAjt?= =?us-ascii?Q?NB0hB8mqjVLy8DuPaxqZ2GgAEOd/na5Z4DF/bXsc1LvzhW1kWhCXZ2QqwiDP?= =?us-ascii?Q?26XHYu3gJ208rUy8hQk0b2a1CyzmLeyqCWeDvBvq/fGlb4Elc10Wbrn4dbMT?= =?us-ascii?Q?Kx4wKyiGm4iGDVRvPw/V3t8AtyqZXIjqqqJsDBcBPcKDC97rOmwMxrTJxZsv?=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kMZL6D8qugU1MTuCMdcEp8Zn9?= =?us-ascii?Q?mA=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 0918f65e-447e-4dca-f7f7-08dc367db0a9 X-MS-Exchange-CrossTenant-AuthSource: CY5PR11MB6139.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Feb 2024 03:47:44.3881 (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: 2cvj3nsZhUsVI6RT24GW5gG6wDFATcqOknVigrSCx0A9Ne1/uL+ApKAkG1Q4eQ3JK7uawQOOOI0ZN8Ovc4iO0BO4X/E7tZBaSmKBd3K2rbE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB6168 X-OriginatorOrg: intel.com On Sat, Feb 24, 2024 at 01:15:01PM +0100, Arnd Bergmann wrote: >From: Arnd Bergmann > >This function does not build on 32-bit targets when the compiler >fails to reduce DIV_ROUND_UP() into a shift: > >ld.lld: error: undefined symbol: __aeabi_uldivmod >>>> referenced by xe_migrate.c >>>> drivers/gpu/drm/xe/xe_migrate.o:(pte_update_size) in archive vmlinux.a > >There are two instances in this function. Change the first to >use an open-coded shift with the same behavior, and the second >one to a 32-bit calculation, which is sufficient here as the size >is never more than 2^32 pages (16TB). > >Fixes: ea97a66a2218 ("drm/xe: Disable 32bits build") same comment as in patch 2... should rather be the commit *enabling* 32b builds? Should this be something to be dealt with at the DIV_ROUND_UP() layer? Why did the compiler fail to reduce it here but didn't in the other 11 uses in the xe driver? thanks Lucas De Marchi >Signed-off-by: Arnd Bergmann >--- > drivers/gpu/drm/xe/xe_migrate.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c >index a66fdf2d2991..ee1bb938c493 100644 >--- a/drivers/gpu/drm/xe/xe_migrate.c >+++ b/drivers/gpu/drm/xe/xe_migrate.c >@@ -462,7 +462,7 @@ static u32 pte_update_size(struct xe_migrate *m, > } else { > /* Clip L0 to available size */ > u64 size = min(*L0, (u64)avail_pts * SZ_2M); >- u64 num_4k_pages = DIV_ROUND_UP(size, XE_PAGE_SIZE); >+ u32 num_4k_pages = (size + XE_PAGE_SIZE - 1) >> XE_PTE_SHIFT; > > *L0 = size; > *L0_ofs = xe_migrate_vm_addr(pt_ofs, 0); >-- >2.39.2 >