From: kernel test robot <lkp@intel.com>
To: cros-kernel-buildreports@googlegroups.com
Cc: oe-kbuild-all@lists.linux.dev
Subject: [android-common:android17-6.18 1/1] arch/arm64/kvm/pkvm.c:123:22: sparse: sparse: cast to restricted gfp_t
Date: Fri, 10 Apr 2026 22:46:32 +0800 [thread overview]
Message-ID: <202604102216.ejXBTPgA-lkp@intel.com> (raw)
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
reply other threads:[~2026-04-10 14:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202604102216.ejXBTPgA-lkp@intel.com \
--to=lkp@intel.com \
--cc=cros-kernel-buildreports@googlegroups.com \
--cc=oe-kbuild-all@lists.linux.dev \
/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 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.