* [android-common:android16-6.12-desktop 7/7] drivers/iommu/intel/iommu.c:3277:7: error: call to undeclared function 'pkvm_enabled'; ISO C99 and later do not support implicit function declarations
@ 2025-08-22 16:39 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-08-22 16:39 UTC (permalink / raw)
To: cros-kernel-buildreports; +Cc: oe-kbuild-all
tree: https://android.googlesource.com/kernel/common android16-6.12-desktop
head: 3f8a5612f90e91c6acf0f22bb5fa67ad1ce1c1e4
commit: 3f8a5612f90e91c6acf0f22bb5fa67ad1ce1c1e4 [7/7] ANDROID: iommu/vt-d: force enable all iommu when pkvm is enabled.
config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20250822/202508221834.0zoFAMYw-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
rustc: rustc 1.88.0 (6b00bc388 2025-06-23)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250822/202508221834.0zoFAMYw-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/202508221834.0zoFAMYw-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/iommu/intel/iommu.c:3277:7: error: call to undeclared function 'pkvm_enabled'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
3277 | if (!pkvm_enabled())
| ^
drivers/iommu/intel/iommu.c:3277:7: note: did you mean 'pat_enabled'?
arch/x86/include/asm/memtype.h:8:13: note: 'pat_enabled' declared here
8 | extern bool pat_enabled(void);
| ^
1 error generated.
vim +/pkvm_enabled +3277 drivers/iommu/intel/iommu.c
3201
3202 int __init intel_iommu_init(void)
3203 {
3204 int ret = -ENODEV;
3205 struct dmar_drhd_unit *drhd;
3206 struct intel_iommu *iommu;
3207
3208 /*
3209 * Intel IOMMU is required for a TXT/tboot launch or platform
3210 * opt in, so enforce that.
3211 */
3212 force_on = (!intel_iommu_tboot_noforce && tboot_force_iommu()) ||
3213 platform_optin_force_iommu();
3214
3215 down_write(&dmar_global_lock);
3216 if (dmar_table_init()) {
3217 if (force_on)
3218 panic("tboot: Failed to initialize DMAR table\n");
3219 goto out_free_dmar;
3220 }
3221
3222 if (dmar_dev_scope_init() < 0) {
3223 if (force_on)
3224 panic("tboot: Failed to initialize DMAR device scope\n");
3225 goto out_free_dmar;
3226 }
3227
3228 up_write(&dmar_global_lock);
3229
3230 /*
3231 * The bus notifier takes the dmar_global_lock, so lockdep will
3232 * complain later when we register it under the lock.
3233 */
3234 dmar_register_bus_notifier();
3235
3236 down_write(&dmar_global_lock);
3237
3238 if (!no_iommu)
3239 intel_iommu_debugfs_init();
3240
3241 if (no_iommu || dmar_disabled) {
3242 /*
3243 * We exit the function here to ensure IOMMU's remapping and
3244 * mempool aren't setup, which means that the IOMMU's PMRs
3245 * won't be disabled via the call to init_dmars(). So disable
3246 * it explicitly here. The PMRs were setup by tboot prior to
3247 * calling SENTER, but the kernel is expected to reset/tear
3248 * down the PMRs.
3249 */
3250 if (intel_iommu_tboot_noforce) {
3251 for_each_iommu(iommu, drhd)
3252 iommu_disable_protect_mem_regions(iommu);
3253 }
3254
3255 /*
3256 * Make sure the IOMMUs are switched off, even when we
3257 * boot into a kexec kernel and the previous kernel left
3258 * them enabled
3259 */
3260 intel_disable_iommus();
3261 goto out_free_dmar;
3262 }
3263
3264 if (list_empty(&dmar_rmrr_units))
3265 pr_info("No RMRR found\n");
3266
3267 if (list_empty(&dmar_atsr_units))
3268 pr_info("No ATSR found\n");
3269
3270 if (list_empty(&dmar_satc_units))
3271 pr_info("No SATC found\n");
3272
3273 /*
3274 * Do not ignore any dmars if pkvm is enabled so as to
3275 * guarantee memory protection from devices.
3276 */
> 3277 if (!pkvm_enabled())
3278 init_no_remapping_devices();
3279
3280 ret = init_dmars();
3281 if (ret) {
3282 if (force_on)
3283 panic("tboot: Failed to initialize DMARs\n");
3284 pr_err("Initialization failed\n");
3285 goto out_free_dmar;
3286 }
3287 up_write(&dmar_global_lock);
3288
3289 init_iommu_pm_ops();
3290
3291 down_read(&dmar_global_lock);
3292 for_each_active_iommu(iommu, drhd) {
3293 /*
3294 * The flush queue implementation does not perform
3295 * page-selective invalidations that are required for efficient
3296 * TLB flushes in virtual environments. The benefit of batching
3297 * is likely to be much lower than the overhead of synchronizing
3298 * the virtual and physical IOMMU page-tables.
3299 */
3300 if (cap_caching_mode(iommu->cap) &&
3301 !first_level_by_default(IOMMU_DOMAIN_DMA)) {
3302 pr_info_once("IOMMU batching disallowed due to virtualization\n");
3303 iommu_set_dma_strict();
3304 }
3305 iommu_device_sysfs_add(&iommu->iommu, NULL,
3306 intel_iommu_groups,
3307 "%s", iommu->name);
3308 /*
3309 * The iommu device probe is protected by the iommu_probe_device_lock.
3310 * Release the dmar_global_lock before entering the device probe path
3311 * to avoid unnecessary lock order splat.
3312 */
3313 up_read(&dmar_global_lock);
3314 iommu_device_register(&iommu->iommu, &intel_iommu_ops, NULL);
3315 down_read(&dmar_global_lock);
3316
3317 iommu_pmu_register(iommu);
3318 }
3319
3320 if (probe_acpi_namespace_devices())
3321 pr_warn("ACPI name space devices didn't probe correctly\n");
3322
3323 /* Finally, we enable the DMA remapping hardware. */
3324 for_each_iommu(iommu, drhd) {
3325 if (!drhd->ignored && !translation_pre_enabled(iommu))
3326 iommu_enable_translation(iommu);
3327
3328 iommu_disable_protect_mem_regions(iommu);
3329 }
3330 up_read(&dmar_global_lock);
3331
3332 pr_info("Intel(R) Virtualization Technology for Directed I/O\n");
3333
3334 intel_iommu_enabled = 1;
3335
3336 return 0;
3337
3338 out_free_dmar:
3339 intel_iommu_free_dmars();
3340 up_write(&dmar_global_lock);
3341 return ret;
3342 }
3343
--
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:[~2025-08-22 16:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-22 16:39 [android-common:android16-6.12-desktop 7/7] drivers/iommu/intel/iommu.c:3277:7: error: call to undeclared function 'pkvm_enabled'; ISO C99 and later do not support implicit function declarations 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.