From: kernel test robot <lkp@intel.com>
To: Juergen Gross <jgross@suse.com>,
linux-kernel@vger.kernel.org, x86@kernel.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
xin@zytor.com, Juergen Gross <jgross@suse.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
"H. Peter Anvin" <hpa@zytor.com>,
stable@vger.kernel.org
Subject: Re: [PATCH 3/3] x86/alternative: make kernel ITS thunks read-only
Date: Thu, 29 May 2025 12:09:55 +0800 [thread overview]
Message-ID: <202505291124.eAZ7fgbG-lkp@intel.com> (raw)
In-Reply-To: <20250528123557.12847-4-jgross@suse.com>
Hi Juergen,
kernel test robot noticed the following build errors:
[auto build test ERROR on tip/master]
[also build test ERROR on tip/x86/core linus/master v6.15 next-20250528]
[cannot apply to tip/x86/mm tip/auto-latest]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Juergen-Gross/x86-execmem-don-t-use-PAGE_KERNEL-protection-for-code-pages/20250528-204423
base: tip/master
patch link: https://lore.kernel.org/r/20250528123557.12847-4-jgross%40suse.com
patch subject: [PATCH 3/3] x86/alternative: make kernel ITS thunks read-only
config: x86_64-buildonly-randconfig-002-20250529 (https://download.01.org/0day-ci/archive/20250529/202505291124.eAZ7fgbG-lkp@intel.com/config)
compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250529/202505291124.eAZ7fgbG-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202505291124.eAZ7fgbG-lkp@intel.com/
All errors (new ones prefixed by >>):
>> arch/x86/kernel/alternative.c:2353:6: error: use of undeclared identifier 'its_page'
2353 | if (its_page)
| ^
>> arch/x86/kernel/alternative.c:2354:3: error: call to undeclared function 'its_set_kernel_ro'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
2354 | its_set_kernel_ro(its_page);
| ^
arch/x86/kernel/alternative.c:2354:21: error: use of undeclared identifier 'its_page'
2354 | its_set_kernel_ro(its_page);
| ^
arch/x86/kernel/alternative.c:2355:2: error: use of undeclared identifier 'its_page'
2355 | its_page = NULL;
| ^
4 errors generated.
vim +/its_page +2353 arch/x86/kernel/alternative.c
2308
2309 void __init alternative_instructions(void)
2310 {
2311 u64 ibt;
2312
2313 int3_selftest();
2314
2315 /*
2316 * The patching is not fully atomic, so try to avoid local
2317 * interruptions that might execute the to be patched code.
2318 * Other CPUs are not running.
2319 */
2320 stop_nmi();
2321
2322 /*
2323 * Don't stop machine check exceptions while patching.
2324 * MCEs only happen when something got corrupted and in this
2325 * case we must do something about the corruption.
2326 * Ignoring it is worse than an unlikely patching race.
2327 * Also machine checks tend to be broadcast and if one CPU
2328 * goes into machine check the others follow quickly, so we don't
2329 * expect a machine check to cause undue problems during to code
2330 * patching.
2331 */
2332
2333 /*
2334 * Make sure to set (artificial) features depending on used paravirt
2335 * functions which can later influence alternative patching.
2336 */
2337 paravirt_set_cap();
2338
2339 /* Keep CET-IBT disabled until caller/callee are patched */
2340 ibt = ibt_save(/*disable*/ true);
2341
2342 __apply_fineibt(__retpoline_sites, __retpoline_sites_end,
2343 __cfi_sites, __cfi_sites_end, true);
2344
2345 /*
2346 * Rewrite the retpolines, must be done before alternatives since
2347 * those can rewrite the retpoline thunks.
2348 */
2349 apply_retpolines(__retpoline_sites, __retpoline_sites_end);
2350 apply_returns(__return_sites, __return_sites_end);
2351
2352 /* Make potential last thunk page read-only. */
> 2353 if (its_page)
> 2354 its_set_kernel_ro(its_page);
2355 its_page = NULL;
2356
2357 /*
2358 * Adjust all CALL instructions to point to func()-10, including
2359 * those in .altinstr_replacement.
2360 */
2361 callthunks_patch_builtin_calls();
2362
2363 apply_alternatives(__alt_instructions, __alt_instructions_end);
2364
2365 /*
2366 * Seal all functions that do not have their address taken.
2367 */
2368 apply_seal_endbr(__ibt_endbr_seal, __ibt_endbr_seal_end);
2369
2370 ibt_restore(ibt);
2371
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
prev parent reply other threads:[~2025-05-29 4:10 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-28 12:35 [PATCH 0/3] x86: Fix some bugs related to ITS mitigation Juergen Gross
2025-05-28 12:35 ` [PATCH 1/3] x86/execmem: don't use PAGE_KERNEL protection for code pages Juergen Gross
2025-05-28 17:27 ` Mike Rapoport
2025-05-28 18:22 ` Jürgen Groß
2025-05-30 7:44 ` Peter Zijlstra
2025-05-28 12:35 ` [PATCH 2/3] x86/mm/pat: don't collapse pages without PSE set Juergen Gross
2025-06-11 9:30 ` [tip: x86/urgent] " tip-bot2 for Juergen Gross
2025-05-28 12:35 ` [PATCH 3/3] x86/alternative: make kernel ITS thunks read-only Juergen Gross
2025-05-28 13:10 ` Peter Zijlstra
2025-05-28 13:19 ` Jürgen Groß
2025-05-28 13:22 ` Peter Zijlstra
2025-05-28 13:30 ` Jürgen Groß
2025-05-28 15:58 ` Peter Zijlstra
2025-05-28 16:17 ` Peter Zijlstra
2025-05-28 17:24 ` Mike Rapoport
2025-05-28 17:31 ` Mike Rapoport
2025-06-03 11:17 ` Mike Rapoport
2025-05-29 4:09 ` kernel test robot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202505291124.eAZ7fgbG-lkp@intel.com \
--to=lkp@intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=mingo@redhat.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=xin@zytor.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox