Re: [PATCH 05/21] x86/mm/pat: mirror direct map changes to ASI

From: kernel test robot
Date: Thu Sep 25 2025 - 09:37:28 EST


Hi Brendan,

kernel test robot noticed the following build warnings:

[auto build test WARNING on bf2602a3cb2381fb1a04bf1c39a290518d2538d1]

url: https://github.com/intel-lab-lkp/linux/commits/Brendan-Jackman/x86-mm-asi-Add-CONFIG_MITIGATION_ADDRESS_SPACE_ISOLATION/20250924-230633
base: bf2602a3cb2381fb1a04bf1c39a290518d2538d1
patch link: https://lore.kernel.org/r/20250924-b4-asi-page-alloc-v1-5-2d861768041f%40google.com
patch subject: [PATCH 05/21] x86/mm/pat: mirror direct map changes to ASI
config: x86_64-buildonly-randconfig-002-20250925 (https://download.01.org/0day-ci/archive/20250925/202509252153.JhjsdZ6c-lkp@xxxxxxxxx/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250925/202509252153.JhjsdZ6c-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202509252153.JhjsdZ6c-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

arch/x86/mm/pat/set_memory.c: In function 'mirror_asi_direct_map':
>> arch/x86/mm/pat/set_memory.c:1995:25: warning: variable 'asi_cpa' set but not used [-Wunused-but-set-variable]
1995 | struct cpa_data asi_cpa = *cpa;
| ^~~~~~~


vim +/asi_cpa +1995 arch/x86/mm/pat/set_memory.c

1988
1989 /*
1990 * Having updated the unrestricted PGD, reflect this change in the ASI
1991 * restricted address space too.
1992 */
1993 static inline int mirror_asi_direct_map(struct cpa_data *cpa, int primary)
1994 {
> 1995 struct cpa_data asi_cpa = *cpa;
1996
1997 if (!asi_enabled_static())
1998 return 0;
1999
2000 /* Only need to do this for the real unrestricted direct map. */
2001 if ((cpa->pgd && cpa->pgd != init_mm.pgd) || !is_direct_map(*cpa->vaddr))
2002 return 0;
2003 VM_WARN_ON_ONCE(!is_direct_map(*cpa->vaddr + (cpa->numpages * PAGE_SIZE)));
2004
2005 asi_cpa.pgd = asi_nonsensitive_pgd;
2006 asi_cpa.curpage = 0;
2007 return __change_page_attr(cpa, primary);
2008 }
2009

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki