All of lore.kernel.org
 help / color / mirror / Atom feed
* [android-common:android17-6.18 1/1] arch/arm64/kvm/pkvm.c:123:22: sparse: sparse: cast to restricted gfp_t
@ 2026-04-10 14:46 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-04-10 14:46 UTC (permalink / raw)
  To: cros-kernel-buildreports; +Cc: oe-kbuild-all

tree:   https://android.googlesource.com/kernel/common android17-6.18
head:   08e21ebff803243bccd5e6cd4a8253ffebf74c64
commit: 1ded80a53cb8dc6c83e47578f7eacca8772245ce [1/1] ANDROID: KVM: arm64: Allow GFP_ATOMIC for host stage-2 pool topup
config: arm64-randconfig-r133-20260408 (https://download.01.org/0day-ci/archive/20260410/202604102216.ejXBTPgA-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project c80443cd37b2e2788cba67ffa180a6331e5f0791)
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260410/202604102216.ejXBTPgA-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/202604102216.ejXBTPgA-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> arch/arm64/kvm/pkvm.c:123:22: sparse: sparse: cast to restricted gfp_t
>> arch/arm64/kvm/pkvm.c:148:45: sparse: sparse: cast from restricted gfp_t

vim +123 arch/arm64/kvm/pkvm.c

   120	
   121	static void *__host_stage2_alloc(void *arg, unsigned long order)
   122	{
 > 123		gfp_t gfp = (gfp_t)(uintptr_t)arg;
   124		struct page *p;
   125	
   126		p = __cma_alloc(host_s2_cma, 1, 0, gfp);
   127		if (!p)
   128			return NULL;
   129	
   130		return page_to_virt(p);
   131	}
   132	
   133	static void __host_stage2_free(void *virt, void *arg, unsigned long order)
   134	{
   135		WARN_ON(!cma_release(host_s2_cma, virt_to_page(virt), 1));
   136	}
   137	
   138	int pkvm_host_stage2_topup(gfp_t gfp)
   139	{
   140		struct kvm_hyp_memcache mc;
   141		int ret = -EINVAL;
   142	
   143		if (!gfpflags_allow_blocking(gfp) && host_s2_mode != PKVM_HOST_S2_GCMA)
   144			goto err;
   145	
   146		init_hyp_memcache(&mc);
   147		ret = __topup_hyp_memcache(&mc, 3, __host_stage2_alloc, kvm_host_pa,
 > 148					   (void *)(uintptr_t)(gfp | __GFP_NOWARN), 0);
   149		if (ret && !mc.nr_pages)
   150			return ret;
   151	
   152		ret = __pkvm_topup_hyp_alloc_mgt_mc(HYP_ALLOC_MGT_HOSTS2_ID, &mc);
   153		if (ret)
   154			__free_hyp_memcache(&mc, __host_stage2_free, kvm_host_va, NULL);
   155	
   156	err:
   157		return WARN_ON_ONCE(ret);
   158	}
   159	EXPORT_SYMBOL(pkvm_host_stage2_topup);
   160	#else
   161	static void __host_stage2_free(void *virt, void *arg, unsigned long order) { WARN_ON(1); }
   162	static void __init pkvm_host_stage2_drain(void) { }
   163	#endif
   164	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-04-10 14:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-10 14:46 [android-common:android17-6.18 1/1] arch/arm64/kvm/pkvm.c:123:22: sparse: sparse: cast to restricted gfp_t kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.