All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Ashish Kalra <ashish.kalra@amd.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	x86@kernel.org, "Borislav Petkov (AMD)" <bp@alien8.de>,
	Michael Roth <michael.roth@amd.com>
Subject: [tip:x86/sev 22/33] drivers/crypto/ccp/sev-dev.c:1672: undefined reference to `amd_iommu_snp_disable'
Date: Tue, 13 Feb 2024 09:23:56 +0800	[thread overview]
Message-ID: <202402130940.IHNXTMSN-lkp@intel.com> (raw)

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

             reply	other threads:[~2024-02-13  1:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-13  1:23 kernel test robot [this message]
2024-02-13 11:18 ` [tip:x86/sev 22/33] drivers/crypto/ccp/sev-dev.c:1672: undefined reference to `amd_iommu_snp_disable' Borislav Petkov

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=202402130940.IHNXTMSN-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=ashish.kalra@amd.com \
    --cc=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.roth@amd.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=x86@kernel.org \
    /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.