From: "Kalra, Ashish" <ashish.kalra@amd.com>
To: Borislav Petkov <bp@kernel.org>, X86 ML <x86@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
"Borislav Petkov (AMD)" <bp@alien8.de>,
Joerg Roedel <joro@8bytes.org>,
Michael Roth <michael.roth@amd.com>,
Nikunj A Dadhania <nikunj@amd.com>,
Tom Lendacky <thomas.lendacky@amd.com>
Subject: Re: [PATCH] x86/sev: Move SEV compilation units
Date: Thu, 20 Jun 2024 15:47:35 -0500 [thread overview]
Message-ID: <c0eb7bf9-0ca1-4289-b8d3-36b5e15a43a9@amd.com> (raw)
In-Reply-To: <20240619093014.17962-1-bp@kernel.org>
Hello Boris,
On 6/19/2024 4:30 AM, Borislav Petkov wrote:
> From: "Borislav Petkov (AMD)" <bp@alien8.de>
>
> A long time ago we said that we're going to move the coco stuff where it
> belongs
>
> https://lore.kernel.org/all/Yg5nh1RknPRwIrb8@zn.tnic
>
> and not keep it in arch/x86/kernel. TDX did that and SEV can't find time
> to do so. So lemme do it. If people have trouble converting their
> ongoing featuritis patches, ask me for a sed script.
>
> No functional changes.
>
> Cc: Ashish Kalra <Ashish.Kalra@amd.com>
> Cc: Joerg Roedel <joro@8bytes.org>
> Cc: Michael Roth <michael.roth@amd.com>
> Cc: Nikunj A Dadhania <nikunj@amd.com>
> Cc: Tom Lendacky <thomas.lendacky@amd.com>
> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
> ---
> arch/x86/boot/compressed/sev.c | 2 +-
> arch/x86/coco/Makefile | 1 +
> arch/x86/coco/sev/Makefile | 3 +++
> arch/x86/{kernel/sev.c => coco/sev/core.c} | 2 +-
> arch/x86/{kernel/sev-shared.c => coco/sev/shared.c} | 0
> arch/x86/kernel/Makefile | 2 --
> 6 files changed, 6 insertions(+), 4 deletions(-)
> create mode 100644 arch/x86/coco/sev/Makefile
> rename arch/x86/{kernel/sev.c => coco/sev/core.c} (99%)
> rename arch/x86/{kernel/sev-shared.c => coco/sev/shared.c} (100%)
>
> diff --git a/arch/x86/boot/compressed/sev.c b/arch/x86/boot/compressed/sev.c
> index 697057250faa..cd44e120fe53 100644
> --- a/arch/x86/boot/compressed/sev.c
> +++ b/arch/x86/boot/compressed/sev.c
> @@ -127,7 +127,7 @@ static bool fault_in_kernel_space(unsigned long address)
> #include "../../lib/insn.c"
>
> /* Include code for early handlers */
> -#include "../../kernel/sev-shared.c"
> +#include "../../coco/sev/shared.c"
>
> static struct svsm_ca *svsm_get_caa(void)
> {
> diff --git a/arch/x86/coco/Makefile b/arch/x86/coco/Makefile
> index c816acf78b6a..eabdc7486538 100644
> --- a/arch/x86/coco/Makefile
> +++ b/arch/x86/coco/Makefile
> @@ -6,3 +6,4 @@ CFLAGS_core.o += -fno-stack-protector
> obj-y += core.o
>
> obj-$(CONFIG_INTEL_TDX_GUEST) += tdx/
> +obj-$(CONFIG_AMD_MEM_ENCRYPT) += sev/
> diff --git a/arch/x86/coco/sev/Makefile b/arch/x86/coco/sev/Makefile
> new file mode 100644
> index 000000000000..b89ba3fba343
> --- /dev/null
> +++ b/arch/x86/coco/sev/Makefile
> @@ -0,0 +1,3 @@
> +# SPDX-License-Identifier: GPL-2.0
> +
> +obj-y += core.o
> diff --git a/arch/x86/kernel/sev.c b/arch/x86/coco/sev/core.c
> similarity index 99%
> rename from arch/x86/kernel/sev.c
> rename to arch/x86/coco/sev/core.c
> index 726d9df505e7..082d61d85dfc 100644
> --- a/arch/x86/kernel/sev.c
> +++ b/arch/x86/coco/sev/core.c
> @@ -613,7 +613,7 @@ static __always_inline void vc_forward_exception(struct es_em_ctxt *ctxt)
> }
>
> /* Include code shared with pre-decompression boot stage */
> -#include "sev-shared.c"
> +#include "shared.c"
>
> static inline struct svsm_ca *svsm_get_caa(void)
> {
> diff --git a/arch/x86/kernel/sev-shared.c b/arch/x86/coco/sev/shared.c
> similarity index 100%
> rename from arch/x86/kernel/sev-shared.c
> rename to arch/x86/coco/sev/shared.c
> diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
> index 20a0dd51700a..b22ceb9fdf57 100644
> --- a/arch/x86/kernel/Makefile
> +++ b/arch/x86/kernel/Makefile
> @@ -142,8 +142,6 @@ obj-$(CONFIG_UNWINDER_ORC) += unwind_orc.o
> obj-$(CONFIG_UNWINDER_FRAME_POINTER) += unwind_frame.o
> obj-$(CONFIG_UNWINDER_GUESS) += unwind_guess.o
>
> -obj-$(CONFIG_AMD_MEM_ENCRYPT) += sev.o
> -
> obj-$(CONFIG_CFI_CLANG) += cfi.o
>
> obj-$(CONFIG_CALL_THUNKS) += callthunks.o
Reviewed-by: Ashish Kalra <ashish.kalra@amd.com>
I have rebased SNP guest kexec and kdump patches on top of this patch and they work without any issues with this patch applied.
Will be posting SNP guest kexec and kdump rebased on top of this patch.
Thanks, Ashish
next prev parent reply other threads:[~2024-06-20 20:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-19 9:30 Borislav Petkov
2024-06-20 8:23 ` Nikunj A. Dadhania
2024-06-20 20:47 ` Kalra, Ashish [this message]
2024-06-21 10:57 ` [tip: x86/sev] " tip-bot2 for Borislav Petkov (AMD)
2024-06-21 13:50 ` [PATCH] " Tom Lendacky
2024-07-11 11:17 ` [tip: x86/sev] " tip-bot2 for Borislav Petkov (AMD)
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=c0eb7bf9-0ca1-4289-b8d3-36b5e15a43a9@amd.com \
--to=ashish.kalra@amd.com \
--cc=bp@alien8.de \
--cc=bp@kernel.org \
--cc=joro@8bytes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.roth@amd.com \
--cc=nikunj@amd.com \
--cc=thomas.lendacky@amd.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®