From nobody Mon Jun 8 07:22:48 2026 Received: from mail-dl1-f73.google.com (mail-dl1-f73.google.com [74.125.82.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 5C9C73C5842 for ; Thu, 4 Jun 2026 19:56:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780602978; cv=none; b=C07SgPNnsCaGugr1QvXw5RYyio+rEZZ5pIX7IQre5DLNWIXwVS6OPsL+XlDOyBoSsd3OnUCA/ZmU24n5vZ3LrlYaOgjBkXSjGUnvdGVi9gH9NbN+h4O1HNjOhmTuefKwVd9LE2NJuHM16pHeCBsA2dbNUNIKTuq9XVVU9BU7NNQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780602978; c=relaxed/simple; bh=ALDVVdFoylq7o2r85tA1n/hqs9RaRelCbsQQ0XyQREQ=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=BtARVwtdWEDPHXZXoFIxG/iUIBbCSmYXD22mAiPpmr9SbIsDzSaenyYVLE7lnXQMhXmdwQ5ZygW/UTP/1ruarDfOUeUfUCHeMrEtH82r7NENjNf7SRTgtkGBJ94fojpr8X8xgrgLjBw2h7YbmyYU3MAyn7SjKGCM+M17napGHXI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--xur.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=BobC0uch; arc=none smtp.client-ip=74.125.82.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--xur.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="BobC0uch" Received: by mail-dl1-f73.google.com with SMTP id a92af1059eb24-137dbe27199so80120c88.1 for ; Thu, 04 Jun 2026 12:56:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1780602975; x=1781207775; 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=8+SbulTiJWlvIk3jVLfJBqtlKmu5w1xAGHRbaSG4jXs=; b=BobC0uchrF7THxR9XqJc7q1vN+lwr1BmLAKyGbrb2u2GYgFaqvPShVT/xKha6fYQsA taz3bZFFDujb/BbvT3cS3/YzzmPHrZxeq8qWOoHOVKyyLJd/XJvKWqSn70OKQfm02OWb TSFZETtLPyiDcPGov/3a8HK8jX4zbNgiHGP+VZTy0Gp2hAds5BugWY2PGFLulU5e0I4e ICD9QelNFuRbd7auC/hB5vNYRdTCReAHEotofXLlo79K9MBmDZ3nZG74WXGWBLWwtsw1 9WGsOnG3LDcXXDd0SZNKf+jYKez/afpEq9pd2IIHlY5Ro6jjprgY8OHu96pYaWOjOB9g gXNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780602975; x=1781207775; 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=8+SbulTiJWlvIk3jVLfJBqtlKmu5w1xAGHRbaSG4jXs=; b=Cdh+KAyBJUH64ImjCRTFVcMKgmGMS/F0bERk3WmLlTLloK71R6mxC0+6P6I65+IzCB VYBxCLSWKVVx/w3Jv5XrEXuMkn5L9On07Vi9JiUeD/MaV2HrHNrKoicxOPQm7p3OHfZ2 BvIyjXQlprzoToBKmCeWnI6eMQzC7SNZ/HQP6JIZh2TBiqbeCj7UhGlTAdUuoGBIWi9P YN//uz4KQ98yUmjRu+2hnYidEP5rivcs97mNRy3Z65dUc+G/YuyYBIwWtPffAGrxqG2v rN+CdBYLycFv9ygWC0QP7dedb79RRw9vXG7UkwCkhqNWp7+g9Vj0fQdszEwMh+D4X1CD SL8A== X-Forwarded-Encrypted: i=1; AFNElJ8f8FPBc1oAmbGpw9vecEXswrk7+/YtfNr3T5s4CEuNOhIkqndCg3nWo6E7hs2uUzBaAFRkdYXkJyWxuVg=@vger.kernel.org X-Gm-Message-State: AOJu0YxUHueW7VvuQVvmwjUp9IGh3QEaZE9XK81QRtVJkcZxT4V/uQ0q fSqW+/jkx03K52EEjN7CJNOR7JAfeOUplvEiec+3Rw/Ru6u4lhZ6wIC2Msnc99LLOJQIVA== X-Received: from dlbrp10.prod.google.com ([2002:a05:7022:160a:b0:137:e7d3:1490]) (user=xur job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7022:6b99:b0:137:e532:f53f with SMTP id a92af1059eb24-1380672bf32mr266541c88.34.1780602975084; Thu, 04 Jun 2026 12:56:15 -0700 (PDT) Date: Thu, 4 Jun 2026 12:56:07 -0700 In-Reply-To: <20260604195612.3757860-1-xur@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260604195612.3757860-1-xur@google.com> X-Mailer: git-send-email 2.54.0.1032.g2f8565e1d1-goog Message-ID: <20260604195612.3757860-2-xur@google.com> Subject: [PATCH v4 1/2] kconfig: Remove the architecture specific config for AutoFDO From: xur@google.com To: Yabin Cui , Will Deacon , Han Shen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Kees Cook , Nathan Chancellor , Nicolas Schier , Linus Walleij , Arnd Bergmann , Mathieu Desnoyers , Rong Xu , Miguel Ojeda , Peter Zijlstra , Jinjie Ruan , Lukas Bulwahn , linux-kernel@vger.kernel.org, Juergen Gross , Helge Deller , Ryan Roberts , Marc Zyngier , Ard Biesheuvel , Vincent Donnefort , Alice Ryhl Cc: x86@kernel.org, linux-arm-kernel@lists.infradead.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Rong Xu The CONFIG_AUTOFDO_CLANG option currently depends on ARCH_SUPPORTS_AUTOFDO_CLANG, but this dependency seems unnecessary. Remove ARCH_SUPPORTS_AUTOFDO_CLANG and allow users to control AutoFDO builds solely through CONFIG_AUTOFDO_CLANG. This simplifies the kconfig and avoids potential confusion. Expand the AutoFDO documentation to include instructions for arm64. Contributor acknowledgments: * SPE instructions: Daniel Hoekwater * ETM instructions: Yabin Cui Signed-off-by: Rong Xu Suggested-by: Will Deacon Tested-by: Yabin Cui Reviewed-by: Kees Cook --- Documentation/dev-tools/autofdo.rst | 41 +++++++++++++++++++++++++++++ arch/Kconfig | 4 --- arch/x86/Kconfig | 1 - 3 files changed, 41 insertions(+), 5 deletions(-) diff --git a/Documentation/dev-tools/autofdo.rst b/Documentation/dev-tools/= autofdo.rst index bcf06e7d6ffa..ae03c4dfedc1 100644 --- a/Documentation/dev-tools/autofdo.rst +++ b/Documentation/dev-tools/autofdo.rst @@ -61,6 +61,9 @@ process consists of the following steps: the AutoFDO profile via offline tools. =20 The support requires a Clang compiler LLVM 17 or later. +Current supported architectures include x86/x86_64 (via LBR) and +arm64 (via SPE or ETM). + =20 Preparation =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D @@ -141,6 +144,35 @@ Here is an example workflow for AutoFDO kernel: =20 $ perf record --pfm-events RETIRED_TAKEN_BRANCH_INSTRUCTIONS:k -a -N= -b -c -o -- =20 + - For arm64 with SPE: + + There are a few kernel features that must be enabled to collect SPE p= rofiles on Arm. + Below is a list of the required features: + + - CONFIG_ARM_SPE_PMU=3Dy + - CONFIG_PID_IN_CONTEXTIDR=3Dy + - kpti=3Doff + + Use the following command to generate SPE perf data file:: + + $ perf record -e ' arm_spe_0/branch_filter=3D1,load_filter=3D0,store= _filter=3D0/' -a -c -N --no-switch-events -o -- + + - For arm64 with ETM trace: + + Follow the instructions in `Linaro OpenCSD document + `_ + to record ETM traces for AutoFDO:: + + $ perf record -e cs_etm/@tmc_etr0/k -a -o -- + $ perf inject -i -o --itrace=3Di500009il + + For ARM platforms running Android, follow the instructions in `Androi= d simpleperf + document `_ + to record ETM traces for AutoFDO:: + + $ simpleperf record -e cs-etm:k -a -o -- + $ simpleperf inject -i -o --symdir = + 4) (Optional) Download the raw perf file to the host machine. =20 5) To generate an AutoFDO profile, two offline tools are available: @@ -162,6 +194,15 @@ Here is an example workflow for AutoFDO kernel: =20 $ llvm-profdata merge -o ... = =20 + For arm64 SPE, use the following command:: + + $ create_llvm_prof --binary=3D --profile=3D --pr= ofiler=3Dperf_spe --format=3Dextbinary --out=3D + + For arm64 ETM, use the following command:: + + $ create_llvm_prof --binary=3D --profile=3D= --profiler=3Dtext -format=3Dextbinary -out=3D + + 6) Rebuild the kernel using the AutoFDO profile file with the same config = as step 1, (Note CONFIG_AUTOFDO_CLANG needs to be enabled):: =20 diff --git a/arch/Kconfig b/arch/Kconfig index 0848932d1c8e..5e878924939a 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -879,12 +879,8 @@ config LTO_CLANG_THIN_DIST module-specific compiler options, and simplifies debugging. endchoice =20 -config ARCH_SUPPORTS_AUTOFDO_CLANG - bool - config AUTOFDO_CLANG bool "Enable Clang's AutoFDO build (EXPERIMENTAL)" - depends on ARCH_SUPPORTS_AUTOFDO_CLANG depends on CC_IS_CLANG help This option enables Clang=E2=80=99s AutoFDO build. When diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index f3f7cb01d69d..10bf3984102e 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -130,7 +130,6 @@ config X86 select ARCH_SUPPORTS_LTO_CLANG select ARCH_SUPPORTS_LTO_CLANG_THIN select ARCH_SUPPORTS_RT - select ARCH_SUPPORTS_AUTOFDO_CLANG select ARCH_SUPPORTS_PROPELLER_CLANG if X86_64 select ARCH_USE_BUILTIN_BSWAP select ARCH_USE_CMPXCHG_LOCKREF if X86_CX8 --=20 2.54.0.1032.g2f8565e1d1-goog From nobody Mon Jun 8 07:22:48 2026 Received: from mail-dl1-f74.google.com (mail-dl1-f74.google.com [74.125.82.74]) (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 22F2233B96B for ; Thu, 4 Jun 2026 19:56:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780602979; cv=none; b=iAxHLY0SM9NxwOxB/Gz6uVJbM8BbWAuPYtIe5GIEQx8ywXfssP1mGrq0HkcDcsAIr2Cd5XE0hETq32WUTXV8S/jmGypvv43aQv8V5uocMIc5wTwnA6Aaa+ygb2m5f6rIvpXwAy2zzy0FhrJjrjHVTRNFrHzrXjddWCAWf/QkVvg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780602979; c=relaxed/simple; bh=ZfzlCFZrgnaN/hqVdNawFSoSLN4pDmDpuqJ6MFEHpF0=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=S8QEm1rUYiy7D1w+whtubZSGo/obeN9zenIGG1/yYexHWOLPz1NX8UenUKsvNilbhqIyyAF5dXt+fuS3JdJlE03umZLVJIGkry970UiAaje63VS5q899nJbR/KKTs3vO0SbhUz5UDwaCZsXCqOvacvzD2YzMUJi74h589LOlg08= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--xur.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=jA1VXaV3; arc=none smtp.client-ip=74.125.82.74 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--xur.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="jA1VXaV3" Received: by mail-dl1-f74.google.com with SMTP id a92af1059eb24-137dbe27199so80160c88.1 for ; Thu, 04 Jun 2026 12:56:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1780602976; x=1781207776; 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=faQACawi8ZyxkQpSee/aQP+EiOFWCp1/ZOduWnEXuQs=; b=jA1VXaV37+ATosFx+GtA1CUJ8x/i1w3Eo5NlxAa8ECi96p/u6ZDxNGAvY2/5Tkur4X DSr8GrINrke1j8OkoWVCy83jRtIUrqb+2eVrJSqI1aDLk/0GSFqfAhev9ETO64JgAsTw dpfL5Z+GyOPK7Cnu5zBUKSjyB/VNtyEdOseFLChNqfr65zm3tlw9EI25N+SL6E0DC0Yg evAvAluv75GzLaJl26DUN3FJ9Hqbaiu2HbIfbe8KCnZgZ/wOU53qisShRz8QL0sZuRlj kmmD6RU0bWJboXXUdsD3kMkyQeWagTHW2A8kkg7PSAmjEsNEqGx1VJMFo07V3baM28+M lcCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780602976; x=1781207776; 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=faQACawi8ZyxkQpSee/aQP+EiOFWCp1/ZOduWnEXuQs=; b=q4Jkt4JHvoT1wC1YCwhVQi6DKCqKJLCiSE57jJOSCmvawAMV6FhM1trI9+eTxwDdLF jETIt4sEiWBY/pftng4NNFe/c0C0fkryjQColS0VjibKKxqVG1ew3FzJQcIS0gZ9eKoB b4BZTEG26uhWsKQiYM6QIDkx2Bt/NLi4n64vEeIJjrwX/aGyyrHC/izllk5cPKQ3Bf35 b4AcXIMhDd+QKVsFAiEJhSCyoljg7OKm5++G0HGanhsw2QNEi3oTfpiEbzMJHFRw5lSQ CYIYtjsm66N690TUFYaWk5t+DYS7Ph7lz5oaW5FeKp3IlhcN+iobZV6kXXvoYc28uz/4 Y7Bg== X-Forwarded-Encrypted: i=1; AFNElJ+Bdcl5mgyAZQR+zTrGUdYnPqgVnmz8VbuFqBozHZ+Q/LLXG9DALSO9jMyZVIQ4NqUPIBL7Aed6EPQnmPw=@vger.kernel.org X-Gm-Message-State: AOJu0YwIemLXb/PM1Qr91QN6LEXwtVNF7c6FTyG9FCdznPVovYcGB+LK 1xA9XG1hK63anWMStKMqaERgU2y8bCFRDCzXgvOcHoiZSyRSCkA1kI5u2XfsBn9jsCQm7Q== X-Received: from dlbdm20.prod.google.com ([2002:a05:7022:6b94:b0:137:f72e:e889]) (user=xur job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7022:f9c:b0:138:576:fe with SMTP id a92af1059eb24-13806686d92mr251095c88.6.1780602975988; Thu, 04 Jun 2026 12:56:15 -0700 (PDT) Date: Thu, 4 Jun 2026 12:56:08 -0700 In-Reply-To: <20260604195612.3757860-1-xur@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260604195612.3757860-1-xur@google.com> X-Mailer: git-send-email 2.54.0.1032.g2f8565e1d1-goog Message-ID: <20260604195612.3757860-3-xur@google.com> Subject: [PATCH v4 2/2] kconfig: Remove the architecture specific config for Propeller From: xur@google.com To: Yabin Cui , Will Deacon , Han Shen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Kees Cook , Nathan Chancellor , Nicolas Schier , Linus Walleij , Arnd Bergmann , Mathieu Desnoyers , Rong Xu , Miguel Ojeda , Peter Zijlstra , Jinjie Ruan , Lukas Bulwahn , linux-kernel@vger.kernel.org, Juergen Gross , Helge Deller , Ryan Roberts , Marc Zyngier , Ard Biesheuvel , Vincent Donnefort , Alice Ryhl Cc: x86@kernel.org, linux-arm-kernel@lists.infradead.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Rong Xu The CONFIG_PROPELLER_CLANG option currently depends on ARCH_SUPPORTS_PROPELLER_CLANG, but this dependency seems unnecessary. Remove ARCH_SUPPORTS_PROPELLER_CLANG and allow users to control Propeller builds solely through CONFIG_PROPELLER_CLANG. This simplifies the kconfig and avoids potential confusion. Move the .llvm_bb_addr_map sections grouping to include/asm-generic/vmlinux.lds.h. The Propeller documentation has been updated to reflect the most recent tool location and now includes instructions for arm64. Contributor Acknowledgments: * SPE instructions: Daniel Hoekwater Signed-off-by: Rong Xu Suggested-by: Will Deacon Suggested-by: Nathan Chancellor Tested-by: Yabin Cui Reviewed-by: Kees Cook --- Documentation/dev-tools/propeller.rst | 49 ++++++++++++++++++++------- arch/Kconfig | 5 +-- arch/arm64/kernel/vmlinux.lds.S | 1 + arch/x86/Kconfig | 1 - arch/x86/kernel/vmlinux.lds.S | 5 +-- include/asm-generic/vmlinux.lds.h | 6 ++++ 6 files changed, 46 insertions(+), 21 deletions(-) diff --git a/Documentation/dev-tools/propeller.rst b/Documentation/dev-tool= s/propeller.rst index 92195958e3db..e927319941c9 100644 --- a/Documentation/dev-tools/propeller.rst +++ b/Documentation/dev-tools/propeller.rst @@ -28,8 +28,10 @@ A few important notes about adopting Propeller optimizat= ion: and the linker(ld.lld). =20 #. In addition to LLVM toolchain, Propeller requires a profiling - conversion tool: https://github.com/google/autofdo with a release - after v0.30.1: https://github.com/google/autofdo/releases/tag/v0.30.1. + conversion tool: https://github.com/google/llvm-propeller. + +Current supported architectures include x86/X86_64 (via LBR), +and arm64 (via SPE). =20 The Propeller optimization process involves the following steps: =20 @@ -124,17 +126,30 @@ Here is an example workflow for building an AutoFDO+P= ropeller kernel: =20 $ perf record --pfm-event RETIRED_TAKEN_BRANCH_INSTRUCTIONS:k -a -N = -b -c -o -- =20 - Note you can repeat the above steps to collect multiple s. + - For arm64 with SPE:: + There are a few kernel features that must be enabled to collect SPE p= rofiles on Arm. + Below is a list of the required features: + + - CONFIG_ARM_SPE_PMU=3Dy + - CONFIG_PID_IN_CONTEXTIDR=3Dy + - kpti=3Doff + + Use the following command to generate SPE perf data file:: + + $ perf record -e 'arm_spe_0/branch_filter=3D1,load_filter=3D0,store_= filter=3D0/' -a -N -c --no-switch-events -o -- + + Note you can repeat the above steps to collect multiple s. =20 4) (Optional) Download the raw perf file(s) to the host machine. =20 -5) Use the create_llvm_prof tool (https://github.com/google/autofdo) to +5) Use the generate_propeller_profiles tool (https://github.com/google/llv= m-propeller) to generate Propeller profile. :: =20 - $ create_llvm_prof --binary=3D --profile=3D - --format=3Dpropeller --propeller_output_module_na= me - --out=3D_cc_profile.txt - --propeller_symorder=3D= _ld_profile.txt + $ generate_propeller_profiles \ + --binary=3D --profile=3D \ + --format=3Dpropeller --propeller_output_module_name \ + --out=3D_cc_profile.txt \ + --propeller_symorder=3D_ld_profile.= txt =20 "" can be something like "/home/user/dir/any_= string". =20 @@ -146,10 +161,20 @@ Here is an example workflow for building an AutoFDO+P= ropeller kernel: you can create a temp list file "" with each line containing one perf file name and run:: =20 - $ create_llvm_prof --binary=3D --profile=3D@ - --format=3Dpropeller --propeller_output_module_na= me - --out=3D_cc_profile.txt - --propeller_symorder=3D= _ld_profile.txt + $ generate_propeller_profiles \ + --binary=3D --profile=3D@ \ + --format=3Dpropeller --propeller_output_module_name \ + --out=3D_cc_profile.txt \ + --propeller_symorder=3D_ld_profile.= txt + + For arm64 SPE, add the option '--profiler=3Dperf_spe', like:: + + $ generate_propeller_profiles \ + --binary=3D --profile=3D \ + --profiler=3Dperf_spe \ + --format=3Dpropeller --propeller_output_module_name \ + --out=3D_cc_profile.txt \ + --propeller_symorder=3D_ld_profile.= txt =20 6) Rebuild the kernel using the AutoFDO and Propeller profiles. :: diff --git a/arch/Kconfig b/arch/Kconfig index 5e878924939a..99c2017eb515 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -895,13 +895,10 @@ config AUTOFDO_CLANG =20 If unsure, say N. =20 -config ARCH_SUPPORTS_PROPELLER_CLANG - bool - config PROPELLER_CLANG bool "Enable Clang's Propeller build" - depends on ARCH_SUPPORTS_PROPELLER_CLANG depends on CC_IS_CLANG && CLANG_VERSION >=3D 190000 + depends on $(cc-option,-fbasic-block-sections=3Dlist=3D/dev/null) help This option enables Clang=E2=80=99s Propeller build. When the Propeller profiles is specified in variable CLANG_PROPELLER_PROFILE_PREFIX diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.ld= s.S index e1ac876200a3..8aaf404980a7 100644 --- a/arch/arm64/kernel/vmlinux.lds.S +++ b/arch/arm64/kernel/vmlinux.lds.S @@ -368,6 +368,7 @@ SECTIONS =20 STABS_DEBUG DWARF_DEBUG + PROPELLER_DATA MODINFO ELF_DETAILS =20 diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 10bf3984102e..b875d2f27e48 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -130,7 +130,6 @@ config X86 select ARCH_SUPPORTS_LTO_CLANG select ARCH_SUPPORTS_LTO_CLANG_THIN select ARCH_SUPPORTS_RT - select ARCH_SUPPORTS_PROPELLER_CLANG if X86_64 select ARCH_USE_BUILTIN_BSWAP select ARCH_USE_CMPXCHG_LOCKREF if X86_CX8 select ARCH_USE_MEMTEST diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S index 4711a35e706c..74e336d7f9dd 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S @@ -423,10 +423,7 @@ SECTIONS =20 STABS_DEBUG DWARF_DEBUG -#ifdef CONFIG_PROPELLER_CLANG - .llvm_bb_addr_map : { *(.llvm_bb_addr_map) } -#endif - + PROPELLER_DATA MODINFO ELF_DETAILS =20 diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinu= x.lds.h index 60c8c22fd3e4..5659f4b5a125 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -1011,6 +1011,12 @@ #define PERCPU_DECRYPTED_SECTION #endif =20 +#ifdef CONFIG_PROPELLER_CLANG +#define PROPELLER_DATA = \ + .llvm_bb_addr_map : { *(.llvm_bb_addr_map) } +#else +#define PROPELLER_DATA +#endif =20 /* * Default discarded sections. --=20 2.54.0.1032.g2f8565e1d1-goog