public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [tip:x86/sev 22/33] drivers/crypto/ccp/sev-dev.c:1672: undefined reference to `amd_iommu_snp_disable'
@ 2024-02-13  1:23 kernel test robot
  2024-02-13 11:18 ` Borislav Petkov
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2024-02-13  1:23 UTC (permalink / raw)
  To: Ashish Kalra
  Cc: oe-kbuild-all, linux-kernel, x86, Borislav Petkov (AMD),
	Michael Roth

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/sev
head:   45ba5b3c0a02949a4da74ead6e11c43e9b88bdca
commit: f366a8dac1b8fef28a470d4e67b9843ebb8e2a1f [22/33] iommu/amd: Clean up RMP entries for IOMMU pages during SNP shutdown
config: x86_64-randconfig-072-20240212 (https://download.01.org/0day-ci/archive/20240213/202402130940.IHNXTMSN-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240213/202402130940.IHNXTMSN-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/202402130940.IHNXTMSN-lkp@intel.com/

All errors (new ones prefixed by >>):

   ld: drivers/crypto/ccp/sev-dev.o: in function `__sev_snp_shutdown_locked':
>> drivers/crypto/ccp/sev-dev.c:1672: undefined reference to `amd_iommu_snp_disable'


vim +1672 drivers/crypto/ccp/sev-dev.c

  1626	
  1627	static int __sev_snp_shutdown_locked(int *error)
  1628	{
  1629		struct sev_device *sev = psp_master->sev_data;
  1630		struct sev_data_snp_shutdown_ex data;
  1631		int ret;
  1632	
  1633		if (!sev->snp_initialized)
  1634			return 0;
  1635	
  1636		memset(&data, 0, sizeof(data));
  1637		data.len = sizeof(data);
  1638		data.iommu_snp_shutdown = 1;
  1639	
  1640		wbinvd_on_all_cpus();
  1641	
  1642		ret = __sev_do_cmd_locked(SEV_CMD_SNP_SHUTDOWN_EX, &data, error);
  1643		/* SHUTDOWN may require DF_FLUSH */
  1644		if (*error == SEV_RET_DFFLUSH_REQUIRED) {
  1645			ret = __sev_do_cmd_locked(SEV_CMD_SNP_DF_FLUSH, NULL, NULL);
  1646			if (ret) {
  1647				dev_err(sev->dev, "SEV-SNP DF_FLUSH failed\n");
  1648				return ret;
  1649			}
  1650			/* reissue the shutdown command */
  1651			ret = __sev_do_cmd_locked(SEV_CMD_SNP_SHUTDOWN_EX, &data,
  1652						  error);
  1653		}
  1654		if (ret) {
  1655			dev_err(sev->dev, "SEV-SNP firmware shutdown failed\n");
  1656			return ret;
  1657		}
  1658	
  1659		/*
  1660		 * SNP_SHUTDOWN_EX with IOMMU_SNP_SHUTDOWN set to 1 disables SNP
  1661		 * enforcement by the IOMMU and also transitions all pages
  1662		 * associated with the IOMMU to the Reclaim state.
  1663		 * Firmware was transitioning the IOMMU pages to Hypervisor state
  1664		 * before version 1.53. But, accounting for the number of assigned
  1665		 * 4kB pages in a 2M page was done incorrectly by not transitioning
  1666		 * to the Reclaim state. This resulted in RMP #PF when later accessing
  1667		 * the 2M page containing those pages during kexec boot. Hence, the
  1668		 * firmware now transitions these pages to Reclaim state and hypervisor
  1669		 * needs to transition these pages to shared state. SNP Firmware
  1670		 * version 1.53 and above are needed for kexec boot.
  1671		 */
> 1672		ret = amd_iommu_snp_disable();
  1673		if (ret) {
  1674			dev_err(sev->dev, "SNP IOMMU shutdown failed\n");
  1675			return ret;
  1676		}
  1677	
  1678		sev->snp_initialized = false;
  1679		dev_dbg(sev->dev, "SEV-SNP firmware shutdown\n");
  1680	
  1681		return ret;
  1682	}
  1683	

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [tip:x86/sev 22/33] drivers/crypto/ccp/sev-dev.c:1672: undefined reference to `amd_iommu_snp_disable'
  2024-02-13  1:23 [tip:x86/sev 22/33] drivers/crypto/ccp/sev-dev.c:1672: undefined reference to `amd_iommu_snp_disable' kernel test robot
@ 2024-02-13 11:18 ` Borislav Petkov
  0 siblings, 0 replies; 2+ messages in thread
From: Borislav Petkov @ 2024-02-13 11:18 UTC (permalink / raw)
  To: kernel test robot
  Cc: Ashish Kalra, oe-kbuild-all, linux-kernel, x86, Michael Roth

On Tue, Feb 13, 2024 at 09:23:56AM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/sev
> head:   45ba5b3c0a02949a4da74ead6e11c43e9b88bdca
> commit: f366a8dac1b8fef28a470d4e67b9843ebb8e2a1f [22/33] iommu/amd: Clean up RMP entries for IOMMU pages during SNP shutdown
> config: x86_64-randconfig-072-20240212 (https://download.01.org/0day-ci/archive/20240213/202402130940.IHNXTMSN-lkp@intel.com/config)
> compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240213/202402130940.IHNXTMSN-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/202402130940.IHNXTMSN-lkp@intel.com/
> 
> All errors (new ones prefixed by >>):
> 
>    ld: drivers/crypto/ccp/sev-dev.o: in function `__sev_snp_shutdown_locked':
> >> drivers/crypto/ccp/sev-dev.c:1672: undefined reference to `amd_iommu_snp_disable'

Yeah, I know. This should fix it:

https://lore.kernel.org/r/20240207204721.6189-1-bp@alien8.de

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-13 11:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-13  1:23 [tip:x86/sev 22/33] drivers/crypto/ccp/sev-dev.c:1672: undefined reference to `amd_iommu_snp_disable' kernel test robot
2024-02-13 11:18 ` Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox