From nobody Sun Nov 24 23:20:58 2024 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2043.outbound.protection.outlook.com [40.107.100.43]) (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 EE0EA1CCB50 for ; Fri, 1 Nov 2024 16:23:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.100.43 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730478223; cv=fail; b=ceY1OcABd6lEcGz0/astAvjy5h3b3YAPCxmOTT8pjEPEU+Lr1VNUUjqIp3T6EhOaOlQOQr6Y4M+HOK/bhdJuGpFO0s58m6mSGzd2ieIFMRoAdhG7VBG1U8+mSpV5KvxCR/oiNShb4GpbqRTQlEgkvNo1EzYUyCGtP9aK6fseq7s= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730478223; c=relaxed/simple; bh=ZO9mKCEHnUVcv2smGEZRLFJh9CdlQX9zoJETQejkZq0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=c9co+yPZuv9j80+bHY9WOm2COaQiqitcYmkvTwVimfEYJ+X75cvVvvUk3ra7OCBJU6gcVdyo1NYcTFKMzu9MdHJpa+ldvwh4tUr0+wEb2636HC9K+eCBH7pGIBVz/xSXXLI2w1t5Jm03FADBKqbfw/vKIHSF3w8pd80O8kYsWIU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=wa+9j0kn; arc=fail smtp.client-ip=40.107.100.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="wa+9j0kn" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YE3gGFuPBdQngU0XyEGRbgnxfKtXxMlJ+keEDBBKoWsG9rJhP9cesUHhYR8+Vlp/7uDAE2vCt2KQdkLvmFGXYPczxQX7aQ2EB75zg5N0bCLTj3283n46lpCmsXIyvCfvwX5hLG9JeQ9kZGgEQ21fQThRuvo5+rIYN2DuaDdo1W5chGDDzz4Sb75pNEZOqeMBZTc3eCUZu82zLdBsaWDJNvTjdiP6i2dacmS5koNsI9JuQ3orTnc5uO/awuEZ08KMZV5IS0W/ctUvXPjkQxXqayV6XpHkLLaMDt39bZB8QdZbKLX/qOtKH0gRp0lRqYcvJRRYfkaNXOAbaVRISXb33w== 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=n9jPtNcs+tWTzm8P4fh+2iZVSqTuTyq1Q3rqecNaUQ4=; b=gxKHd4bqEixVWun+c/xxN7Adk+vVs/Qz1vlElNk4U2HUg/lKHi+6rroauA3DPM5xYIxkMQ5cRknvq8ZsCyDCYkBPbHCbgvPWGm6a5pxm6ECPzImnxE0RbzWTdAnRuVjo6JveOti47sMoVsTAkMxUB6yzXLacKtsPQLCTffHAIS/Ut+eiEEhIuoiP/ALEayY/nsILx/CNCZKEScUpOCKsBxlnU+Uy71F63k0IFn9Xl+bFXuwQA8wxxun6M+V1iUzAS8r5aj/i8pxpVYod8TfohdEgus/2vMh9h1CUAIcIW/8s0DFN6y0NeX+bVFewfklOC6o6jlgrwsUOhQCP0x26Xw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) 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=n9jPtNcs+tWTzm8P4fh+2iZVSqTuTyq1Q3rqecNaUQ4=; b=wa+9j0knrLnwifZOOp1xUMMk91NQ1DdOKFLLQ+ptp9Xtbmc26Aaevnm/qD5QgBmxS4EgBC8d74S2PfdLCudOMUH+VsyeEtDs8xxWV51y0JZDJb2Gt2TaVa9Q67rdKfOYWavBTGpq1AdBTGcENRfdmAMp+G2gz2fnHJrY674Ps50= Received: from SA1P222CA0032.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:2d0::13) by DS0PR12MB9057.namprd12.prod.outlook.com (2603:10b6:8:c7::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.20; Fri, 1 Nov 2024 16:23:33 +0000 Received: from SN1PEPF0002636D.namprd02.prod.outlook.com (2603:10b6:806:2d0:cafe::8d) by SA1P222CA0032.outlook.office365.com (2603:10b6:806:2d0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.26 via Frontend Transport; Fri, 1 Nov 2024 16:23:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SN1PEPF0002636D.mail.protection.outlook.com (10.167.241.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8114.16 via Frontend Transport; Fri, 1 Nov 2024 16:23:33 +0000 Received: from purico-ed03host.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 1 Nov 2024 11:23:29 -0500 From: Suravee Suthikulpanit To: , CC: , , , , , , , , , "Uros Bizjak" , Suravee Suthikulpanit Subject: [PATCH v9 03/10] asm/rwonce: Introduce [READ|WRITE]_ONCE() support for __int128 Date: Fri, 1 Nov 2024 16:22:57 +0000 Message-ID: <20241101162304.4688-4-suravee.suthikulpanit@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241101162304.4688-1-suravee.suthikulpanit@amd.com> References: <20241101162304.4688-1-suravee.suthikulpanit@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002636D:EE_|DS0PR12MB9057:EE_ X-MS-Office365-Filtering-Correlation-Id: d63ef0b2-485c-4f97-84dd-08dcfa9187e9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?AS8Mi5kRnL9ykhNkc3BwivF557+YtUfw/D6zDvphpRiJ3ZnleDNZeqb191Lk?= =?us-ascii?Q?KnwndrvG1ULuKKZkXwtGKeYqO607WZEJyWU/E6A4fu3hJPjULMtIPGuQq3d3?= =?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8Cz3TUqj2GXSjU+r12lXpSYB?= =?us-ascii?Q?WWNw+gInjgADv8HpgK6hN9xpw4/HxvXW/1fH4ERbKVo5bkcF9MDr5ekstClL?= =?us-ascii?Q?nCwF2ift0RS7+rK5OGl8e+bkiXl2C8MeDRT8hP3icA4GdDg9OMWTiZ7BbZZF?= =?us-ascii?Q?s67ktoTUj+NFkITQHf/RDvmn4mnyzklrt6MVN5JDQ4+4CagqlApKiVt0FGCu?= =?us-ascii?Q?3S6E0vLa1KsNCuVqG2sk3OW98Xp5dbpqIkAEpepU8sKotf0TudorWhB/OMvg?= =?us-ascii?Q?LvUOuVAbMvqiBYlUkkPy2bYWeWLj5DT++JrJyjYQwFRzhMbdPjDEKoGC+9CW?= =?us-ascii?Q?yhr1i1eaeSSzNPlXzY46Ivk4Lwr70sOJxh/l3C4osoMxk1odSqz54isRL0Oy?= =?us-ascii?Q?nnxUtOHJJu614XB+Cubi1I7b6R2m5+BCh/2MGXQJyNb8Gruscw=3D=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(1800799024)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2024 16:23:33.6260 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d63ef0b2-485c-4f97-84dd-08dcfa9187e9 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002636D.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB9057 Content-Type: text/plain; charset="utf-8" From: Uros Bizjak Currently, [READ|WRITE]_ONCE() do not support variable of type __int128. Re-define "__dword_type" from type "long long" to __int128 if supported. Reviewed-by: Jason Gunthorpe Signed-off-by: Uros Bizjak Signed-off-by: Suravee Suthikulpanit --- include/asm-generic/rwonce.h | 2 +- include/linux/compiler_types.h | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/asm-generic/rwonce.h b/include/asm-generic/rwonce.h index 8d0a6280e982..8bf942ad5ef3 100644 --- a/include/asm-generic/rwonce.h +++ b/include/asm-generic/rwonce.h @@ -33,7 +33,7 @@ * (e.g. a virtual address) and a strong prevailing wind. */ #define compiletime_assert_rwonce_type(t) \ - compiletime_assert(__native_word(t) || sizeof(t) =3D=3D sizeof(long long)= , \ + compiletime_assert(__native_word(t) || sizeof(t) =3D=3D sizeof(__dword_ty= pe), \ "Unsupported access size for {READ,WRITE}_ONCE().") =20 /* diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h index 1a957ea2f4fe..54b56ae25db7 100644 --- a/include/linux/compiler_types.h +++ b/include/linux/compiler_types.h @@ -469,6 +469,12 @@ struct ftrace_likely_data { unsigned type: (unsigned type)0, \ signed type: (signed type)0 =20 +#ifdef __SIZEOF_INT128__ +#define __dword_type __int128 +#else +#define __dword_type long long +#endif + #define __unqual_scalar_typeof(x) typeof( \ _Generic((x), \ char: (char)0, \ @@ -476,7 +482,7 @@ struct ftrace_likely_data { __scalar_type_to_expr_cases(short), \ __scalar_type_to_expr_cases(int), \ __scalar_type_to_expr_cases(long), \ - __scalar_type_to_expr_cases(long long), \ + __scalar_type_to_expr_cases(__dword_type), \ default: (x))) =20 /* Is this type a native word size -- useful for atomic operations */ --=20 2.34.1