From patchwork Wed Feb 7 20:47:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Borislav Petkov X-Patchwork-Id: 198089 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp2495690dyb; Wed, 7 Feb 2024 12:48:38 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUHSeY2guZAcwK0RHVs6OlqZOvz3m+a7k7+vDeusEOWPb16W3YkZDbLmLzY4HT9WhF4/QpCPiSxh9HBNTrazY2q6lxmVg== X-Google-Smtp-Source: AGHT+IF3cLyzaLInkQ2w6MLia6V5r1snxr7t7sG5oeyeiNwJTci/n4LcA9/1csFVQsY5E55uJB5/ X-Received: by 2002:a05:6808:1929:b0:3bf:1a8c:75b3 with SMTP id bf41-20020a056808192900b003bf1a8c75b3mr8492646oib.26.1707338918773; Wed, 07 Feb 2024 12:48:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707338918; cv=pass; d=google.com; s=arc-20160816; b=qB3py/Kt5KZPi34PhuEZrb9W1EoC6dCId35WnLZj+YscEj8yghF2QxdIDjB3OkudDi dRe+eJC84XefKBNXKu4LxgtHrlelwqwZKbcrJqzd6E08iyiiEsIruhRmSLshFYohhMhk VR38G5MjcCXIOJcsc4jxDvaE17Cr1UuHio6h7MjAWdAXum5EZ6+7tQ1PYEOvsPkGnkMc x/NmZaAaKgqm6/BCxrsbBLujqJwwXljfykvKTuQToWbJd8bKwRA/slLpPyujKBREKq/s NxNy96w16Of4gc1dUzGb9D78sItsiAFuBMdlX2KwFCHoF5mETSdaqhrAAFwUIxtrR0uY gdDw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=OMPKclvvVQLGWGsvf3qg/ix87d57PuZ6Sg0DKcILVoU=; fh=klz4yFmSj+E/rT8lFmHtAmIS3VYI1Yp4qFQpFgOjl20=; b=VYm4cSlDYewu9YtEqL6t4o1gMYx3GeIQtPWa5OrgwSvX1GxB4DeOIZuhujakvblv+R 1Ul9BN1UJIFDa9gnFDmUi5Ij69ylixR8z5L07lcWIEY0PWsLa3qBqd2i01NkuCrcoe+3 +P4ANPjm+QlnfQhYWbU5z8mMh++MD7V8shdXVeD8q8wEX5prOPf4wTGZxducCjr8pf1k phadRSIkfcxEQUoOCsP4kXGESAXI7lk2WU/wb/fP1Rv6jhJUA88fbe8p450m//Ai6BbX s/OHm294hWaqXFUHb+UEu10dN3mTOSfJZWYHvZ6RQx7y51sVWBFfcSK7tF5Rcp3czl4+ Nm5w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=neutral (body hash did not verify) header.i=@alien8.de header.s=alien8 header.b=W5QNNRMn; arc=pass (i=1 spf=pass spfdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-57041-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57041-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alien8.de X-Forwarded-Encrypted: i=2; AJvYcCUEHSt580UeRS3CBmlR4wSwjoBVEYoMdksWltAd3NYjzJu+izkRaw6SJ4gQaoXTlvkeMaxB6hF34Vy3VWOyL6pSUFOdtg== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id r7-20020a05622a034700b0042c2a4d5053si1960161qtw.385.2024.02.07.12.48.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 12:48:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57041-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@alien8.de header.s=alien8 header.b=W5QNNRMn; arc=pass (i=1 spf=pass spfdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-57041-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57041-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 6EB081C25666 for ; Wed, 7 Feb 2024 20:48:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5A34A129A66; Wed, 7 Feb 2024 20:47:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b="W5QNNRMn" Received: from mail.alien8.de (mail.alien8.de [65.109.113.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B68D412881A for ; Wed, 7 Feb 2024 20:47:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.109.113.108 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707338864; cv=none; b=WlZBbkVqTweezQz7xot1k0J/N9YjN1wrHFVFOUPqzhPHZd6swFD6VzFQZWseiwA/k57B88M+8eNFRGk6j6QFaQ4EiNCeRbvU5nwe8Wt7qPmgJO95na8jFl4PCzA/dK9As5r8EUSTC2VdN7wL+kvPQ97U5TvwYE/zdh5Gz7sHrZI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707338864; c=relaxed/simple; bh=jFwA/NtxsFOo56zJu2RwmcNH+793//zqH+c/RYV4s9g=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=QHgtU5tcg63+mpWnc+pVfhrY2ml3qmQO+d74vyTPl5B7hgJuSjoouTSIhPbKgpb24HciBMJElLeHHsPxscYG2P4AJh5RJmN5OpMiTcND8kZZcNSeZ1PnWp/EHUrAFW4BMrXO44jEoD+iemmPdMVkPdQ707m8E9k+PtAKlxXkM98= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de; spf=pass smtp.mailfrom=alien8.de; dkim=fail (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b=W5QNNRMn reason="signature verification failed"; arc=none smtp.client-ip=65.109.113.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alien8.de Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id 355D640E00B2; Wed, 7 Feb 2024 20:47:38 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.alien8.de Authentication-Results: mail.alien8.de (amavisd-new); dkim=fail (4096-bit key) reason="fail (body has been altered)" header.d=alien8.de Received: from mail.alien8.de ([127.0.0.1]) by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id TwaAdgGsXQBT; Wed, 7 Feb 2024 20:47:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1707338854; bh=Z8aiuw1r4xLDfMnzkrPrgauAKJFimYCWgbGUomsVP9Y=; h=From:To:Cc:Subject:Date:From; b=W5QNNRMnpaRZ920NcKrLqe+gSg/aP+qUkaCHHwnZaVWt/ME9g1IjlMe874wYH1gdM f0Rvzpq6LOb4NCbVv0uogmm7YelQRbtoZABSSTlUHnR8sRkZniVsdk1dW9qA+keY1X +gwzhXF+I3QzRVlJovdsaBotES5jR2ny9C7/C/Oh/Tk2uNQqZ5O0fT7/eyMdKwK9nY q1gK6xRkb4kP4rdKq65KLWHletMUX4tmxEdCm4s7ZDiRDKJEnTNknvmtqK+QdlgbAG 7ihxs1okOYt1TYhmuIy6saDGzuvs8vtEmHYB8cUVH5vn68HOqthtzt72gIlGL4/a0F lMkUNbgzt65NcUWD0xrz6lpDj9QFfbDEL/T/eCnzk7uPEdJO8UnS9t8MV2RLbkeS7v jpcttvrQMVt0Utx8BZ2WDB101Axc3iwQo/91jH+dbIJugna2jSO0ImTDimRblH+nCQ JXMXtjrjGVgg4SREtIptKe4srGgAFK+dDPykyhbla1wIdd4h0Va6BhJvYIQ1XUNP0/ 1ih1rUfHXvj2s1pJGw9Av1zjXGxBwHCuBfB3ltYbavIPFGxP5TM8ncgwfjQLxS+Xwp kS9bPFoDxs/lelqYionEjV56aB9YRFAcRroi5KEDQhc5Z485LyyZ9/w7ifkiZtigzP Ipr7OAfOvAMbmJVyJzSQOAes= Received: from zn.tnic (pd953021b.dip0.t-ipconnect.de [217.83.2.27]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 2773540E0192; Wed, 7 Feb 2024 20:47:30 +0000 (UTC) From: Borislav Petkov To: Ashish Kalra , Michael Roth , Tom Lendacky Cc: LKML Subject: [PATCH] crypto: ccp - Have it depend on AMD_IOMMU Date: Wed, 7 Feb 2024 21:47:21 +0100 Message-ID: <20240207204721.6189-1-bp@alien8.de> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790274614164940481 X-GMAIL-MSGID: 1790274614164940481 From: "Borislav Petkov (AMD)" sev-dev.c calls code in the AMD IOMMU now but that can't really work if latter is not enabled in Kconfig: ld: vmlinux.o: in function `__sev_firmware_shutdown.isra.0': sev-dev.c:(.text+0x2501f0e): undefined reference to `amd_iommu_snp_disable' ld: vmlinux.o: in function `snp_rmptable_init': sev.c:(.init.text+0x26260): undefined reference to `amd_iommu_snp_en' make[2]: *** [scripts/Makefile.vmlinux:37: vmlinux] Error 1 make: *** [Makefile:240: __sub-make] Error 2 Fix those deps. Fixes: f366a8dac1b8 ("iommu/amd: Clean up RMP entries for IOMMU pages during SNP shutdown") Signed-off-by: Borislav Petkov (AMD) --- drivers/crypto/ccp/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/ccp/Kconfig b/drivers/crypto/ccp/Kconfig index 32268e239bf1..f394e45e11ab 100644 --- a/drivers/crypto/ccp/Kconfig +++ b/drivers/crypto/ccp/Kconfig @@ -38,7 +38,7 @@ config CRYPTO_DEV_CCP_CRYPTO config CRYPTO_DEV_SP_PSP bool "Platform Security Processor (PSP) device" default y - depends on CRYPTO_DEV_CCP_DD && X86_64 + depends on CRYPTO_DEV_CCP_DD && X86_64 && AMD_IOMMU help Provide support for the AMD Platform Security Processor (PSP). The PSP is a dedicated processor that provides support for key