tree:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 6a70f89cc58f2368efa055cbcbd8b37384f6c588
commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address
spaces
date: 4 weeks ago
config: i386-randconfig-s002-20200718 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-49-g707c5017-dirty
git checkout 670d0a4b10704667765f7d18f7592993d02783aa
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
> arch/x86/kernel/tboot.c:481:16: sparse: sparse: incorrect type in
assignment (different address spaces) @@ expected void *config @@ got void
[noderef] __iomem * @@
arch/x86/kernel/tboot.c:481:16: sparse: expected void
*config
> arch/x86/kernel/tboot.c:481:16: sparse: got void [noderef]
__iomem *
> arch/x86/kernel/tboot.c:487:19: sparse: sparse: incorrect type in assignment
(different address spaces) @@ expected void *heap_base @@ got void [noderef]
__iomem * @@
arch/x86/kernel/tboot.c:487:19: sparse: expected void
*heap_base
arch/x86/kernel/tboot.c:487:19: sparse: got void [noderef] __iomem *
> arch/x86/kernel/tboot.c:489:17: sparse: sparse: incorrect type in
argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem
*addr @@ got void *config @@
> arch/x86/kernel/tboot.c:489:17: sparse: expected void volatile [noderef] __iomem
*addr
arch/x86/kernel/tboot.c:489:17: sparse: got void *config
vim +481 arch/x86/kernel/tboot.c
3162534069597e Joseph Cihula 2009-06-30 467
3162534069597e Joseph Cihula 2009-06-30 468 struct acpi_table_header
*tboot_get_dmar_table(struct acpi_table_header *dmar_tbl)
3162534069597e Joseph Cihula 2009-06-30 469 {
3162534069597e Joseph Cihula 2009-06-30 470 void *heap_base, *heap_ptr, *config;
3162534069597e Joseph Cihula 2009-06-30 471
3162534069597e Joseph Cihula 2009-06-30 472 if (!tboot_enabled())
3162534069597e Joseph Cihula 2009-06-30 473 return dmar_tbl;
3162534069597e Joseph Cihula 2009-06-30 474
3162534069597e Joseph Cihula 2009-06-30 475 /*
3162534069597e Joseph Cihula 2009-06-30 476 * ACPI tables may not be DMA protected by
tboot, so use DMAR copy
3162534069597e Joseph Cihula 2009-06-30 477 * SINIT saved in SinitMleData in TXT heap
(which is DMA protected)
3162534069597e Joseph Cihula 2009-06-30 478 */
3162534069597e Joseph Cihula 2009-06-30 479
3162534069597e Joseph Cihula 2009-06-30 480 /* map config space in order to get heap
addr */
3162534069597e Joseph Cihula 2009-06-30 @481 config = ioremap(TXT_PUB_CONFIG_REGS_BASE,
NR_TXT_CONFIG_PAGES *
3162534069597e Joseph Cihula 2009-06-30 482 PAGE_SIZE);
3162534069597e Joseph Cihula 2009-06-30 483 if (!config)
3162534069597e Joseph Cihula 2009-06-30 484 return NULL;
3162534069597e Joseph Cihula 2009-06-30 485
3162534069597e Joseph Cihula 2009-06-30 486 /* now map TXT heap */
3162534069597e Joseph Cihula 2009-06-30 @487 heap_base = ioremap(*(u64 *)(config +
TXTCR_HEAP_BASE),
3162534069597e Joseph Cihula 2009-06-30 488 *(u64 *)(config + TXTCR_HEAP_SIZE));
3162534069597e Joseph Cihula 2009-06-30 @489 iounmap(config);
3162534069597e Joseph Cihula 2009-06-30 490 if (!heap_base)
3162534069597e Joseph Cihula 2009-06-30 491 return NULL;
3162534069597e Joseph Cihula 2009-06-30 492
3162534069597e Joseph Cihula 2009-06-30 493 /* walk heap to SinitMleData */
3162534069597e Joseph Cihula 2009-06-30 494 /* skip BiosData */
3162534069597e Joseph Cihula 2009-06-30 495 heap_ptr = heap_base + *(u64 *)heap_base;
3162534069597e Joseph Cihula 2009-06-30 496 /* skip OsMleData */
3162534069597e Joseph Cihula 2009-06-30 497 heap_ptr += *(u64 *)heap_ptr;
3162534069597e Joseph Cihula 2009-06-30 498 /* skip OsSinitData */
3162534069597e Joseph Cihula 2009-06-30 499 heap_ptr += *(u64 *)heap_ptr;
3162534069597e Joseph Cihula 2009-06-30 500 /* now points to SinitMleDataSize; set to
SinitMleData */
3162534069597e Joseph Cihula 2009-06-30 501 heap_ptr += sizeof(u64);
3162534069597e Joseph Cihula 2009-06-30 502 /* get addr of DMAR table */
3162534069597e Joseph Cihula 2009-06-30 503 dmar_tbl = (struct acpi_table_header
*)(heap_ptr +
3162534069597e Joseph Cihula 2009-06-30 504 ((struct sinit_mle_data
*)heap_ptr)->vtd_dmars_off -
3162534069597e Joseph Cihula 2009-06-30 505 sizeof(u64));
3162534069597e Joseph Cihula 2009-06-30 506
3162534069597e Joseph Cihula 2009-06-30 507 /* don't unmap heap because dmar.c
needs access to this */
3162534069597e Joseph Cihula 2009-06-30 508
3162534069597e Joseph Cihula 2009-06-30 509 return dmar_tbl;
3162534069597e Joseph Cihula 2009-06-30 510 }
3162534069597e Joseph Cihula 2009-06-30 511
:::::: The code at line 481 was first introduced by commit
:::::: 3162534069597e34dd0ac9eb711be8dc23835ae7 x86, intel_txt: Intel TXT boot support
:::::: TO: Joseph Cihula <joseph.cihula(a)intel.com>
:::::: CC: H. Peter Anvin <hpa(a)zytor.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org