lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202501111847.N7CwntR4-lkp@intel.com>
Date: Sat, 11 Jan 2025 18:43:37 +0800
From: kernel test robot <lkp@...el.com>
To: Wencheng Yang <east.moutain.yang@...il.com>
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
	Wencheng Yang <east.moutain.yang@...il.com>,
	Joerg Roedel <joro@...tes.org>,
	Suravee Suthikulpanit <suravee.suthikulpanit@....com>,
	Will Deacon <will@...nel.org>, Robin Murphy <robin.murphy@....com>,
	iommu@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drviers/iommu/amd: support P2P access through IOMMU when
 SME is enabled

Hi Wencheng,

kernel test robot noticed the following build warnings:

[auto build test WARNING on arm-perf/for-next/perf]
[also build test WARNING on linus/master joro-iommu/next v6.13-rc6 next-20250110]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Wencheng-Yang/drviers-iommu-amd-support-P2P-access-through-IOMMU-when-SME-is-enabled/20250110-210948
base:   https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git for-next/perf
patch link:    https://lore.kernel.org/r/20250110130756.333265-1-east.moutain.yang%40gmail.com
patch subject: [PATCH] drviers/iommu/amd: support P2P access through IOMMU when SME is enabled
config: x86_64-buildonly-randconfig-001-20250111 (https://download.01.org/0day-ci/archive/20250111/202501111847.N7CwntR4-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250111/202501111847.N7CwntR4-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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202501111847.N7CwntR4-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from drivers/iommu/amd/io_pgtable_v2.c:14:
   In file included from include/linux/io-pgtable.h:6:
   In file included from include/linux/iommu.h:10:
   In file included from include/linux/scatterlist.h:8:
   In file included from include/linux/mm.h:2223:
   include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     518 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
>> drivers/iommu/amd/io_pgtable_v2.c:68:6: warning: variable 'pte' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
      68 |         if (!(prot & IOMMU_PROT_MMIO))
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/iommu/amd/io_pgtable_v2.c:71:2: note: uninitialized use occurs here
      71 |         pte |= IOMMU_PAGE_PRESENT | IOMMU_PAGE_USER;
         |         ^~~
   drivers/iommu/amd/io_pgtable_v2.c:68:2: note: remove the 'if' if its condition is always true
      68 |         if (!(prot & IOMMU_PROT_MMIO))
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      69 |                 pte = __sme_set(paddr & PM_ADDR_MASK);
   drivers/iommu/amd/io_pgtable_v2.c:66:9: note: initialize the variable 'pte' to silence this warning
      66 |         u64 pte;
         |                ^
         |                 = 0
   2 warnings generated.


vim +68 drivers/iommu/amd/io_pgtable_v2.c

    63	
    64	static u64 set_pte_attr(u64 paddr, u64 pg_size, int prot)
    65	{
    66		u64 pte;
    67	
  > 68		if (!(prot & IOMMU_PROT_MMIO))
    69			pte = __sme_set(paddr & PM_ADDR_MASK);
    70	
    71		pte |= IOMMU_PAGE_PRESENT | IOMMU_PAGE_USER;
    72		pte |= IOMMU_PAGE_ACCESS | IOMMU_PAGE_DIRTY;
    73	
    74		if (prot & IOMMU_PROT_IW)
    75			pte |= IOMMU_PAGE_RW;
    76	
    77		/* Large page */
    78		if (pg_size == IOMMU_PAGE_SIZE_1G || pg_size == IOMMU_PAGE_SIZE_2M)
    79			pte |= IOMMU_PAGE_PSE;
    80	
    81		return pte;
    82	}
    83	

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ