From nobody Wed Oct 8 15:58:30 2025 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 692D11991DD for ; Thu, 26 Jun 2025 05:48:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750916915; cv=none; b=BltFHkjzL2r2hSNkCxc4EFXt6d8WYy1nUuVpotg2DvbwU8fzsZDEC9p82x7gYs2uL7il1/EzCgwTDPnpMjlQ/Otaj7P3opLMRp5iWhIjzNMvz3a1K4siUobTVFVzJSzYMzZk3LO3QUCZ0eihABcNLUHU0+rx2B5sE7yeurbUZjA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750916915; c=relaxed/simple; bh=NUQiHaB/oRFvduMBrU+FyUVv6t6Xgm9DuO0q9cjaySQ=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=MCUYEI91t2ucCZA2LCHCz5EG7D73X+2f9Gar5omPW6HJNQCYzNMZjq123SPcQR6jTS25Wk23+7zMOs5/zqWLoTV03fWSLAm+stn9mF1f4oPzjJb2ltp+eH5er0t1+Ud3+wdfl8z2kUtz3xxsYs+S9WL7dOMUyLTD2Y30sZCd3IA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=sD7pKzYr; arc=none smtp.client-ip=209.85.216.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="sD7pKzYr" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-3132e7266d3so579520a91.2 for ; Wed, 25 Jun 2025 22:48:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1750916914; x=1751521714; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=R1vSzONkvWVxKMWdZPze+udgL8T24sLZ921TIUfWjXQ=; b=sD7pKzYr4gCmmQyqLYn4JkEluNyEz5B0TZTFFjysiO/UZaeRR9UrsR0NiF+xUAkSKM jY9CAKRCOBQ5k7ysSvEmcbO8LYHZPDEnIlS4GjdZA8xonlb3ryOg2EoD3ib6sF5Ff0I6 oPKG0UXIKUSyOI9Aqz1vvaP4Rtz5SbXeouzC3SJpP2yE9tMOLtynHK77R8/RgZCJW3/Z 4rFerA7y7gwr/IMzNgouQxUFgVxKJXNf2DtW0JcLPW6vZI01DOQ9vYpfL4oA6S/8VtVV OUAKSqkuCBSfXoCEA54RcWVid4UEu3cuWi+MItb3Ejzi7OmQ2AuzU/psO3Be985iTUS3 +HoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750916914; x=1751521714; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=R1vSzONkvWVxKMWdZPze+udgL8T24sLZ921TIUfWjXQ=; b=b3+tWLbgllGmPKdblM9HVTGZwP/l/C8umIvo+mM/p5xtVFyV+fbMXL6agE2ZfO+JeZ Wv5/0YemVLFS4yRKfw4bb4sRiZqPXEd3xJ4eLUWn3X6Yz/Fpm8yD9V68FIdm7YJBQvZp itHHvS2dX2wZOYBE+QuMm+/hk5EVBtmo2B6qf7jTMTxOrD+4eb8+5In4VZ7Ob2UhB4VA wFmv8bXLZv8QFPpO4ZLCKQFRFRyC2J8hm5vDP65du5bhZFdLz//tQpZwINzrTG72lT6P 4jVwv4NLUKnfefXxe3t9AxDUPwfyI5QUnudhkEPaRgSXJR4FlwZIAP+j9gKFaJZf+WIw u7eQ== X-Forwarded-Encrypted: i=1; AJvYcCWF+VK4uCsxsVArx48zg6JNTEKrdMMhhMw5k3pqgqW2Qjqaa99HqAJcF/nE465pJcRDEDGOUTg9ANIPIT0=@vger.kernel.org X-Gm-Message-State: AOJu0Yzq3TclY3Ji7C7MLjhrlDiFivaaxg5CYLZQAxCXAABqnD2zO9eS 4snf6WX3uSIE9+J2ZIaV3egeSgeh4JuANqRNPb1VENIOUsOUlvKiLuu+iQzGh+z2rs+SzkB8qp1 6hUaIzMW3yQ== X-Google-Smtp-Source: AGHT+IEs8IO1q36YQk0nSSiSi5GU+GN5WZXfosdQGqxbw2barm/yUUYBYTVH1YWmhz9R0wChcSGLtxRfAZXS X-Received: from pjbsv14.prod.google.com ([2002:a17:90b:538e:b0:312:fb53:41c0]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:2f0c:b0:312:26d9:d5b4 with SMTP id 98e67ed59e1d1-315f2674a05mr9030490a91.17.1750916913698; Wed, 25 Jun 2025 22:48:33 -0700 (PDT) Date: Wed, 25 Jun 2025 22:48:24 -0700 In-Reply-To: <20250626054826.433453-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250626054826.433453-1-irogers@google.com> X-Mailer: git-send-email 2.50.0.727.gbf7dc18ff4-goog Message-ID: <20250626054826.433453-2-irogers@google.com> Subject: [PATCH v3 1/3] vdso: Switch get/put unaligned from packed struct to memcpy From: Ian Rogers To: Eric Biggers , Yuzhuo Jing , Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnaldo Carvalho de Melo , Al Viro , Christophe Leroy , "Jason A. Donenfeld" , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Cc: Ian Rogers Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Type punning is necessary for get/put unaligned but the use of a packed struct violates strict aliasing rules, requiring -fno-strict-aliasing to be passed to the C compiler. Switch to using memcpy so that -fno-strict-aliasing isn't necessary. Signed-off-by: Ian Rogers --- include/vdso/unaligned.h | 39 +++++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/include/vdso/unaligned.h b/include/vdso/unaligned.h index ff0c06b6513e..0ccbcc9aa493 100644 --- a/include/vdso/unaligned.h +++ b/include/vdso/unaligned.h @@ -2,14 +2,41 @@ #ifndef __VDSO_UNALIGNED_H #define __VDSO_UNALIGNED_H =20 -#define __get_unaligned_t(type, ptr) ({ \ - const struct { type x; } __packed * __get_pptr =3D (typeof(__get_pptr))(p= tr); \ - __get_pptr->x; \ +#include + +/** + * __get_unaligned_t - read an unaligned value from memory. + * @type: the type to load from the pointer. + * @ptr: the pointer to load from. + * + * Use memcpy to affect an unaligned type sized load avoiding undefined be= havior + * from approaches like type punning that require -fno-strict-aliasing in = order + * to be correct. As type may be const, use __unqual_scalar_typeof to map = to a + * non-const type - you can't memcpy into a const type. The void* cast sil= ences + * ubsan warnings. + */ +#define __get_unaligned_t(type, ptr) ({ \ + type __get_unaligned_ctrl_type __always_unused; \ + __unqual_scalar_typeof(__get_unaligned_ctrl_type) __get_unaligned_val; \ + __builtin_memcpy(&__get_unaligned_val, (void *)(ptr), \ + sizeof(__get_unaligned_val)); \ + __get_unaligned_val; \ }) =20 -#define __put_unaligned_t(type, val, ptr) do { \ - struct { type x; } __packed * __put_pptr =3D (typeof(__put_pptr))(ptr); \ - __put_pptr->x =3D (val); \ +/** + * __put_unaligned_t - write an unaligned value to memory. + * @type: the type of the value to store. + * @val: the value to store. + * @ptr: the pointer to store to. + * + * Use memcpy to affect an unaligned type sized store avoiding undefined + * behavior from approaches like type punning that require -fno-strict-ali= asing + * in order to be correct. The void* cast silences ubsan warnings. + */ +#define __put_unaligned_t(type, val, ptr) do { \ + type __put_unaligned_val =3D (val); \ + __builtin_memcpy((void *)(ptr), &__put_unaligned_val, \ + sizeof(__put_unaligned_val)); \ } while (0) =20 #endif /* __VDSO_UNALIGNED_H */ --=20 2.50.0.727.gbf7dc18ff4-goog From nobody Wed Oct 8 15:58:30 2025 Received: from mail-pl1-f201.google.com (mail-pl1-f201.google.com [209.85.214.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 15B32221DB2 for ; Thu, 26 Jun 2025 05:48:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750916917; cv=none; b=U4bLQ96It3Ws/FPR6UN6/PtTTEMi6Q+A8S+FnkC7d54HFohj9/VT/OdWvPfvU4zYtQxGgsUCTo4hty/ahdQlzOBcflUibFaYdFqoMhMoQZnSzvASuY5H0ECwDBQgei2Z4a7427x0AOJXSv8yroFXh57n4O/W7a1cawcMGVxQG68= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750916917; c=relaxed/simple; bh=I2DV6rRx2Cjv+IUAW0F5JSmoyWJANossHcJsAVjMTU8=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=LunYG2MdjqDPwVuezscmHyzltHPfjUXbmDkE13LOnvVZwasQRe1vhxjiArQRghIYxs6ioIVCvD6zWBag2hU3MZIAN+ZR6J1NmP1zMYLUtXlhxIzgeI49nBxbYaR8vg7T9QUqgHXhuOI2LhFehMfJrVqU3+V0UpWy5k/g3ONsns4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=WVb5VnCv; arc=none smtp.client-ip=209.85.214.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="WVb5VnCv" Received: by mail-pl1-f201.google.com with SMTP id d9443c01a7336-237f8d64263so6289035ad.1 for ; Wed, 25 Jun 2025 22:48:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1750916915; x=1751521715; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=No7VYJnrsaMBClQyRTA21U4NQdkCFvGbDpgoUA5SP00=; b=WVb5VnCvREVkiQCpG7w21OmHZdDFpF5K2Goe006se2Kfad2K7x2IrqEFTMvhpa6+Cu SjUafPDIO+K/GAJDqN7E9W5E+M8JEBd30ufj4XTGeezubNjLyaG8k9BxSkWapXbVCzy6 jy50rzu4qsrzs+o/sIAZyWqvmszrN0uxyPYgxe1m8CLaOFtdTsEz1nsiq9/MMKzw+DIB MTTEIV8HB5LQmh0Lbo3GEE85iiSuT9XNnJqdWDhh9sj7I9E05dwdVP/Z0jXiss4/rBw8 CDs1/r/ZMD8gLCjEl/c6rdXBBne9HJHOfjDlhFBfvZW10aqdB1polgEsIGcrEAVTRkmu U/8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750916915; x=1751521715; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=No7VYJnrsaMBClQyRTA21U4NQdkCFvGbDpgoUA5SP00=; b=mHwmleHi9azzehQtgeBDcCAFydeLFdodbAjoJ2u9yXE/s0lp4AZQFNgZQBJauDoca4 y53Seozb+q5lPwgGfofVM2MyaEdsHkAjgRTUpXsLSRI3hpj4pDaQD4HdROonvJrdTu7A /NtlYMgzNwXwZvEkW8PQrl58LVGJeVJmeNZ3YOEAysgZv+4q2f113qAJq9oSePn5sopq r7Xdvn066NwlrNdfIVePMvQL0foB81KKcyDT5LuozzG50Z1GjUSAbelxkL7fvlbhevsJ btQJrV3sDnosdf+A0M/+rQz7GtrLQ0sHJUQF2BowIsP0T5piTEMwenSeMWU7jgkAsytp AVYw== X-Forwarded-Encrypted: i=1; AJvYcCV6h17/si2mPuOPXl7jX2W5SXbNr3Ss2FH94lB8oKIM5NfH3kQUk20Ra6yYFZLrLIHRKMKsaqgydh8xM3Q=@vger.kernel.org X-Gm-Message-State: AOJu0YzWwN1gKz92WbvAoRbaOz3DZ+KB1aw5ay4i4gH33V5+5EspwPQ4 E36rEahMH1/H8KOahu+CIUGAlQUabydNINqjG2SI3xK4wISiehSf+lnGH75KUf9cT/a4nWWRLML 4WoRC1weaIw== X-Google-Smtp-Source: AGHT+IEsY38vIXEEuF4IRkd5xvRhTuGPG8ULpVkQr9FeQ29MCI+w1O99arFqY6BeYv2pTQt//M6Fxu4UQHw5 X-Received: from plof2.prod.google.com ([2002:a17:902:8602:b0:234:d477:3b7a]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:2f92:b0:234:88f5:c0d1 with SMTP id d9443c01a7336-238c86ee242mr41530295ad.10.1750916915313; Wed, 25 Jun 2025 22:48:35 -0700 (PDT) Date: Wed, 25 Jun 2025 22:48:25 -0700 In-Reply-To: <20250626054826.433453-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250626054826.433453-1-irogers@google.com> X-Mailer: git-send-email 2.50.0.727.gbf7dc18ff4-goog Message-ID: <20250626054826.433453-3-irogers@google.com> Subject: [PATCH v3 2/3] tools headers: Update the linux/unaligned.h copy with the kernel sources From: Ian Rogers To: Eric Biggers , Yuzhuo Jing , Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnaldo Carvalho de Melo , Al Viro , Christophe Leroy , "Jason A. Donenfeld" , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Cc: Ian Rogers Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" To pick up the changes in: fe9b2b7b3583 vdso: Switch get/put unaligned from packed struct to memcpy As the code is dependent on __unqual_scalar_typeof, update the tools version of compiler_types.h to include this. Signed-off-by: Ian Rogers --- tools/include/linux/compiler_types.h | 22 ++++++++++++++++ tools/include/vdso/unaligned.h | 39 +++++++++++++++++++++++----- 2 files changed, 55 insertions(+), 6 deletions(-) diff --git a/tools/include/linux/compiler_types.h b/tools/include/linux/com= piler_types.h index d09f9dc172a4..890982283a5e 100644 --- a/tools/include/linux/compiler_types.h +++ b/tools/include/linux/compiler_types.h @@ -40,4 +40,26 @@ #define asm_goto_output(x...) asm goto(x) #endif =20 +/* + * __unqual_scalar_typeof(x) - Declare an unqualified scalar type, leaving + * non-scalar types unchanged. + */ +/* + * Prefer C11 _Generic for better compile-times and simpler code. Note: 'c= har' + * is not type-compatible with 'signed char', and we define a separate cas= e. + */ +#define __scalar_type_to_expr_cases(type) \ + unsigned type: (unsigned type)0, \ + signed type: (signed type)0 + +#define __unqual_scalar_typeof(x) typeof( \ + _Generic((x), \ + char: (char)0, \ + __scalar_type_to_expr_cases(char), \ + __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), \ + default: (x))) + #endif /* __LINUX_COMPILER_TYPES_H */ diff --git a/tools/include/vdso/unaligned.h b/tools/include/vdso/unaligned.h index ff0c06b6513e..0ccbcc9aa493 100644 --- a/tools/include/vdso/unaligned.h +++ b/tools/include/vdso/unaligned.h @@ -2,14 +2,41 @@ #ifndef __VDSO_UNALIGNED_H #define __VDSO_UNALIGNED_H =20 -#define __get_unaligned_t(type, ptr) ({ \ - const struct { type x; } __packed * __get_pptr =3D (typeof(__get_pptr))(p= tr); \ - __get_pptr->x; \ +#include + +/** + * __get_unaligned_t - read an unaligned value from memory. + * @type: the type to load from the pointer. + * @ptr: the pointer to load from. + * + * Use memcpy to affect an unaligned type sized load avoiding undefined be= havior + * from approaches like type punning that require -fno-strict-aliasing in = order + * to be correct. As type may be const, use __unqual_scalar_typeof to map = to a + * non-const type - you can't memcpy into a const type. The void* cast sil= ences + * ubsan warnings. + */ +#define __get_unaligned_t(type, ptr) ({ \ + type __get_unaligned_ctrl_type __always_unused; \ + __unqual_scalar_typeof(__get_unaligned_ctrl_type) __get_unaligned_val; \ + __builtin_memcpy(&__get_unaligned_val, (void *)(ptr), \ + sizeof(__get_unaligned_val)); \ + __get_unaligned_val; \ }) =20 -#define __put_unaligned_t(type, val, ptr) do { \ - struct { type x; } __packed * __put_pptr =3D (typeof(__put_pptr))(ptr); \ - __put_pptr->x =3D (val); \ +/** + * __put_unaligned_t - write an unaligned value to memory. + * @type: the type of the value to store. + * @val: the value to store. + * @ptr: the pointer to store to. + * + * Use memcpy to affect an unaligned type sized store avoiding undefined + * behavior from approaches like type punning that require -fno-strict-ali= asing + * in order to be correct. The void* cast silences ubsan warnings. + */ +#define __put_unaligned_t(type, val, ptr) do { \ + type __put_unaligned_val =3D (val); \ + __builtin_memcpy((void *)(ptr), &__put_unaligned_val, \ + sizeof(__put_unaligned_val)); \ } while (0) =20 #endif /* __VDSO_UNALIGNED_H */ --=20 2.50.0.727.gbf7dc18ff4-goog From nobody Wed Oct 8 15:58:30 2025 Received: from mail-pf1-f202.google.com (mail-pf1-f202.google.com [209.85.210.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 02D482264B7 for ; Thu, 26 Jun 2025 05:48:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750916919; cv=none; b=IbmsjHn2muDJveCoVIveZFppH1LVRvn4x1sKTOvkcoVPZ78t91Lv12erQqLdK21tXXuurKCBFMO6WFAKVsrRKBxKzYyrDkHHUrmJh8mQekwc+KiYMs+V/IcUpPyhZfxKLMesB846puaaxcFVwhiv8Mt6ddlW/neef5pY+1nhKRw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750916919; c=relaxed/simple; bh=Y9rAwk43R5Qu/XneIvtPPaxorqlg9IJwfPk0mko3rAw=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=U9WD0uRdCpaoNiz36aUHSuMCb1h4AYU0GbpKAwOwnoFomcv4F/hP2HWoAY3kNHnFeVHlW9MEIaHtUj+WY+ww7AUac1JTE5fQQh5GdU9z6rfuzMdXgyKTg2QWfnAcCD2gW66T1gv0JdZueI+diJtm8QFqTJZUvvS/ZKm6beVDEls= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=1TLyXauv; arc=none smtp.client-ip=209.85.210.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="1TLyXauv" Received: by mail-pf1-f202.google.com with SMTP id d2e1a72fcca58-747cebffd4eso590922b3a.2 for ; Wed, 25 Jun 2025 22:48:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1750916917; x=1751521717; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=06wlXYRsyscOOukfm0BoHmWOsjunsh8IZmbqRpcqtRo=; b=1TLyXauv0hSwcmp0Hyyig6+luqbkAyysSytClcC/r+u+yUjI/pJZfvyDxVbU1LaoMs 7j+851Vb/z/Xw8//K31iveAZ6SqEXuoc6zu2pzLdjKwWicbSC5OwL9QvV3+JFgwf5nE0 gXRgP5EY8A8g7Rp22kpVKIBfM56ndTirXLSbYQXhvLydG65PXRxf8W/TLiRMeI+nhaC9 inZclZg8Kjo0ZwU0sJfWkRkWCkLIj4onIFaf28uaWD/XUTChrKIg3yh0haRijJ4CYZwl /iNrb+wr+VVLRN8pQeDA97ZxwIK/1Yc4279e2vmN4K5Z7kYot7WlPlCq2lm9oZ59Cxq6 6Z8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750916917; x=1751521717; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=06wlXYRsyscOOukfm0BoHmWOsjunsh8IZmbqRpcqtRo=; b=F7QYr5mlDHNbwqGTXQ/yfcAIC/j0aVQAyFksLj/U5MSsPU+qMbfwKlW4GFcNm9rRsu jWNa0nNDr7Ltgb60eWsS9xEYft+eE7sV7Jnt7E0okFV/7TnZHY8N8gdt7xyKGMVy6eU/ 6+32f0otMIQahuk1LJ+jWfjahYRG2PPjh4igjm3kR/YWQRsG0j7JXmsP3HWZA4u5eKnm jTGKaArvpuBstgFwwnjsc1JTlmmZS5Dq99q6IUwgrBzfPVwslSciEbNLB7ULmqCsqunR Ca91yWIkRzsSxwUrajtebYusEbkV2md9INymAVmmBkjZdjEL0VUSQlVO4PJKBHp98oU/ uEaQ== X-Forwarded-Encrypted: i=1; AJvYcCVZNi3a0o2vHm4dptnh09NmD/ijO/Q7rnqnyRn5xvgYFX24ObiaLSE08dSnj/YnioOFxhWN/Ssvdc3IZsE=@vger.kernel.org X-Gm-Message-State: AOJu0YwsBP09FCTDCsanB8pp+UFeQlbkFXCgo8Ge7agWxn9qjZd7X7OL HBybgGqnicZoVKMp94KN61LJr3PQmBA6WPTli61wT2ys4wvfCKFpML1R1JtJjcDtVpEu4Pcgucz d6P/7WN9IuQ== X-Google-Smtp-Source: AGHT+IH+oNNAMV2NVtWwXyNOB/xwSiYb7Vtrnxbr8iZKkclF7b16D26wDNw57BukJDxDJDBIx0CIDLYPgWdi X-Received: from pfbde4.prod.google.com ([2002:a05:6a00:4684:b0:741:8e1a:2d09]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:3d85:b0:220:193b:913 with SMTP id adf61e73a8af0-2207f33227bmr11024525637.34.1750916917233; Wed, 25 Jun 2025 22:48:37 -0700 (PDT) Date: Wed, 25 Jun 2025 22:48:26 -0700 In-Reply-To: <20250626054826.433453-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250626054826.433453-1-irogers@google.com> X-Mailer: git-send-email 2.50.0.727.gbf7dc18ff4-goog Message-ID: <20250626054826.433453-4-irogers@google.com> Subject: [PATCH v3 3/3] tools headers: Remove unneeded ignoring of warnings in unaligned.h From: Ian Rogers To: Eric Biggers , Yuzhuo Jing , Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnaldo Carvalho de Melo , Al Viro , Christophe Leroy , "Jason A. Donenfeld" , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Cc: Ian Rogers Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Now the get/put unaligned use memcpy the -Wpacked and -Wattributes warnings don't need disabling. Signed-off-by: Ian Rogers --- tools/include/linux/unaligned.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tools/include/linux/unaligned.h b/tools/include/linux/unaligne= d.h index 395a4464fe73..d51ddafed138 100644 --- a/tools/include/linux/unaligned.h +++ b/tools/include/linux/unaligned.h @@ -6,9 +6,6 @@ * This is the most generic implementation of unaligned accesses * and should work almost anywhere. */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wpacked" -#pragma GCC diagnostic ignored "-Wattributes" #include =20 #define get_unaligned(ptr) __get_unaligned_t(typeof(*(ptr)), (ptr)) @@ -143,6 +140,5 @@ static inline u64 get_unaligned_be48(const void *p) { return __get_unaligned_be48(p); } -#pragma GCC diagnostic pop =20 #endif /* __LINUX_UNALIGNED_H */ --=20 2.50.0.727.gbf7dc18ff4-goog