Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp16712lqt; Wed, 5 Jun 2024 15:37:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWu4DmgN8bKAC/WsJU+4YcjV6vrLMkJRpOu71uaAkgQ82+VY+Q0vPIu3iYDsg8k7kauAf8q24PkcOR4acrVc4W3R3HMusLxUDzsMsG6fw== X-Google-Smtp-Source: AGHT+IHEcr75YPV1TCR+VsEKC1A+YWzsVO+ob/05jOl8Ubsb7psFpjDZoeY1kQdNGVmdXZ7t4dHO X-Received: by 2002:a05:6358:904c:b0:199:8a22:a835 with SMTP id e5c5f4694b2df-19c6ca1abd7mr438206255d.29.1717627038669; Wed, 05 Jun 2024 15:37:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717627038; cv=pass; d=google.com; s=arc-20160816; b=wXdd91l/b5GpNzBARRLPAqrW19rfKAnHpGpU9bTd2TvWb+zFEpJviy5D1Nvrruhync Kbwrvv6k6VRaZYd+aJU0ldR+hrxfIDC0u5wtERiXEQkfudXpmH9V8Br6sG907d3TK/f/ WZyALW6U664REJFqIzu3sVZRA934rtIqbJOK9yZa+ShCSRrVGi4vdWsRzd5sxEr5bPhs 3FRrOi9aRY29Z6Hddd3TFFssyHHs1wONw7nRSz9PDy+ydHHymqFKI0yDNY0Bfd5sw2Wh HhDnevveDqGapmhWbI77n0SIdxV27E76JVflV3vXuRl+QDzZUlX3Hb3tolqzT+Lw5Dab QhGg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :in-reply-to:date:dkim-signature; bh=HvR2KzRbeN2y+kQBsoY3woptqhul8uQMwsNjpEueFQI=; fh=A61CdZ1uO9lVCoXseD1ODGLgQvb/Qv3YczahK3v81ZY=; b=JZg/XvvnPgm6HU3LEghbVyyLJYvN1sjOTjklDTOILiy6pVZViOYz8PQ9gBKJjyFFjX H4t4OyIhk3JPl62QClIz0+IVzSsRxvLLNHVhM4GYmDlWnBIOMhlr/DiJfdCfNR4AblDc /cVzkqgcrIvBEWwU89TFUMddEXobT1WnEmHhHh0lUMTD7PLbFAXd4KZsK5dMFj8bLu9x ncVdIBDhZJwEbrVS4kQw82sE+UzAyZLfxIYULoUCtoT8yzMLXH5lekH6Xkc4ct956Pvw NF1vmWccStll1JMfO9Qx6ijZ7jl/YQtDbchQXqnFbPQvCo4SVM/TlWQQbrn/kyjjlGgT /qyw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=4lbkGThx; arc=pass (i=1 spf=pass spfdomain=flex--edliaw.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-203359-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203359-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6b04fa1d326si808946d6.467.2024.06.05.15.37.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 15:37:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203359-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=4lbkGThx; arc=pass (i=1 spf=pass spfdomain=flex--edliaw.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-203359-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203359-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 66ACE1C229F3 for ; Wed, 5 Jun 2024 22:37:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 875FD161331; Wed, 5 Jun 2024 22:36:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="4lbkGThx" Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.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 521241607BD for ; Wed, 5 Jun 2024 22:36:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717627015; cv=none; b=KqyRTslXy2kpsRY63FX4ZeVqUrsv8Kqh+Ihk4iQQo/G1cEQr0ISUNM1jcMD02xuV/HGyHg4NvjZ4hAuyFkmMaiK7NuKWfiJebOAAsPZ+QjkTN54EpMYk+EGgGOsvrkjFpAz1eFOwK1JhBx2ZC/l6NWraHqdaDWbhANfBfrJecRs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717627015; c=relaxed/simple; bh=9eIW5Nk9I4U8j48RPo1MRyDNbVsR5OYHwY3uM3dehXE=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=FsGPH6qAHBGvwDmxnfu0B4O973MWbeLOlflN+WD5U2AD5SGZA7lkUnLKlZdIh4n7WKD/QBrWGuX/PSWM7xGWj0+TDgbA+pGdn4dvM9VyOg1jBWuigL74dDcK2xeVfn0INnktO3ufzvgK2YXPRzrj/0hnuxbwHKz8ZzFyvRGPo7s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--edliaw.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=4lbkGThx; arc=none smtp.client-ip=209.85.128.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--edliaw.bounces.google.com Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-62a088faef7so18481227b3.0 for ; Wed, 05 Jun 2024 15:36:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717627013; x=1718231813; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=HvR2KzRbeN2y+kQBsoY3woptqhul8uQMwsNjpEueFQI=; b=4lbkGThxkiUpMN/0jwXCXsnJX3PCW4UQENIqDyWnmGotw02/rp5TiIapCC7+pqP/nn EaNCX+m6x1uIQ1OS0qB9q+1feW16DiFlasAh6Yu+A1t143SClI5OL+mny+4YHSZDm/Qz iDlpVVG4c9LjVKyRSX8Zphr352aFBj7rfg9tgukQ50EF97uPyMceZnjz+foFGoMjZsCV 65EqqkxAgsg8GyhAlTSNfYY5t4NuHkuuOQEd9Dil8SBn0FUZctsUuoYXr6Y1GTN/9Nyb lmWmhL5eAfB/QsQKpjWkGQ0m2DlZoz7AeNn6QJTjdAVael8nbB5fSWsr0DThu56v1Y0+ WW8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717627013; x=1718231813; h=content-transfer-encoding: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=HvR2KzRbeN2y+kQBsoY3woptqhul8uQMwsNjpEueFQI=; b=WmugFlwRoQpaRV31ZppXmk4zS0rCzkf3QnlHIUKu6j+v0uOy3iUJMlDW0Xqpem7xh3 k4Wsq6NQKwM+qy77o63ed3lDc86DCjDJmawcTPl54UJKkBp/R1OaU/9IbsjNv57+DraH eOpPvmyR4DGMFe7Xdcye1jbzJfamkNV3Ptp+Og+JDrQ9iEekOTBnfluVg34hi/OMwKmL uUkyU3iYKCv/4AVtlnwHnNOeoyrRcdBePtR6IA5AMnaLVcD1FtjKDg6aooR3y9RTiIIH WWiPgH4FbvOAXkEb7AWdzyfO1IuQUKI40lahUVbc1Avn4rzXvT19OKryF2cqZ230J0DX kPQg== X-Forwarded-Encrypted: i=1; AJvYcCW7/0oUGV5S+rIYGI/+L03HpgVA1PJTSBn6z75BFL5uKoQPfGffXTdZgs7ePONEw8MzRsLwjr/mxgWiGZpkHkhPT2baweEV0llVxNyu X-Gm-Message-State: AOJu0YyZjJMm1cDjl2i+UMTOFe3uIsmDysl0zT0LhwhE5UR+MlvIwQ3j dlFAo/JKeYzB4Ck0z8siveVywdbRIoq/taqqQMVg+Ccelv/LrikaeeBqrnBdemV+oNj+0CuwC9R Dxg== X-Received: from edliaw.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:305d]) (user=edliaw job=sendgmr) by 2002:a05:690c:6413:b0:620:32ea:e1d4 with SMTP id 00721157ae682-62cc6f92037mr2991207b3.0.1717627013381; Wed, 05 Jun 2024 15:36:53 -0700 (PDT) Date: Wed, 5 Jun 2024 22:36:35 +0000 In-Reply-To: <20240605223637.1374969-1-edliaw@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240605223637.1374969-1-edliaw@google.com> X-Mailer: git-send-email 2.45.1.467.gbab1589fc0-goog Message-ID: <20240605223637.1374969-3-edliaw@google.com> Subject: [PATCH v1 2/2] selftests/mm: Guard defines from shm From: Edward Liaw To: shuah@kernel.org, Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Andrew Morton Cc: cmllamas@google.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kernel-team@android.com, Edward Liaw , llvm@lists.linux.dev, linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable thuge-gen.c defines SHM_HUGE_* macros that are provided by the uapi since 4.14. These macros get redefined when compiling with Android's bionic because its sys/shm.h will import the uapi definitions. However if linux/shm.h is included, with glibc, sys/shm.h will clash on some struct definitions: /usr/include/linux/shm.h:26:8: error: redefinition of =E2=80=98struct shm= id_ds=E2=80=99 26 | struct shmid_ds { | ^~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/bits/shm.h:45, from /usr/include/x86_64-linux-gnu/sys/shm.h:30: /usr/include/x86_64-linux-gnu/bits/types/struct_shmid_ds.h:24:8: note: or= iginally defined here 24 | struct shmid_ds | ^~~~~~~~ For now, guard the SHM_HUGE_* defines with ifndef to prevent redefinition warnings on Android bionic. Signed-off-by: Edward Liaw --- tools/testing/selftests/mm/thuge-gen.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/testing/selftests/mm/thuge-gen.c b/tools/testing/selftes= ts/mm/thuge-gen.c index 034635317935..d50dc71cac32 100644 --- a/tools/testing/selftests/mm/thuge-gen.c +++ b/tools/testing/selftests/mm/thuge-gen.c @@ -34,10 +34,18 @@ #endif =20 #define SHM_HUGETLB 04000 /* segment will use huge TLB pages */ +#ifndef SHM_HUGE_SHIFT #define SHM_HUGE_SHIFT 26 +#endif +#ifndef SHM_HUGE_MASK #define SHM_HUGE_MASK 0x3f +#endif +#ifndef SHM_HUGE_2MB #define SHM_HUGE_2MB (21 << SHM_HUGE_SHIFT) +#endif +#ifndef SHM_HUGE_1GB #define SHM_HUGE_1GB (30 << SHM_HUGE_SHIFT) +#endif =20 #define NUM_PAGESIZES 5 #define NUM_PAGES 4 --=20 2.45.1.467.gbab1589fc0-goog