public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: thomas.lendacky@amd.com
Cc: David Gow <davidgow@google.com>,
	Shuah Khan <skhan@linuxfoundation.org>,
	"x86@kernel.org" <x86@kernel.org>,
	Brendan Higgins <brendan.higgins@linux.dev>,
	linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>
Subject: sev_es_trampoline_start undefined symbol referenced errors during kunit run
Date: Mon, 14 Apr 2025 16:28:44 -0600	[thread overview]
Message-ID: <7c5f9e2a-2e9d-46f2-89b2-83e0d68d3113@linuxfoundation.org> (raw)

Hi Tom,

I have been seeing sev_es_trampoline_start undefined symbol referenced errors
during the following kunit test runs.

./tools/testing/kunit/kunit.py run --arch x86_64
./tools/testing/kunit/kunit.py run --alltests --arch x86_64

The error is here:

ERROR:root:ld:arch/x86/realmode/rm/realmode.lds:236: undefined symbol `sev_es_trampoline_start' referenced in expression
make[6]: *** [../arch/x86/realmode/rm/Makefile:49: arch/x86/realmode/rm/realmode.elf] Error 1
make[5]: *** [../arch/x86/realmode/Makefile:22: arch/x86/realmode/rm/realmode.bin] Error 2
make[4]: *** [../scripts/Makefile.build:461: arch/x86/realmode] Error 2

I made time to look into this error.

sev_es_trampoline_start is referenced in arch/x86/coco/sev/core.c twice:

- To override start_ip in  wakeup_cpu_via_vmgexit()
- In sev_es_setup_ap_jump_table() to compute startup_ip

sev_es_trampoline_start is defined if CONFIG_AMD_MEM_ENCRYPT is enabled
and all other references to it are under ifdef CONFIG_AMD_MEM_ENCRYPT
conditional except the two in arch/x86/coco/sev/core.c

git grep sev_es_trampoline_start
arch/x86/coco/sev/core.c:       start_ip = real_mode_header->sev_es_trampoline_start;
arch/x86/coco/sev/core.c:       startup_ip = (u16)(rmh->sev_es_trampoline_start -
arch/x86/include/asm/realmode.h:        u32     sev_es_trampoline_start;
arch/x86/realmode/rm/header.S:  .long   pa_sev_es_trampoline_start
arch/x86/realmode/rm/trampoline_64.S:SYM_CODE_START(sev_es_trampoline_start)
arch/x86/realmode/rm/trampoline_64.S:SYM_CODE_END(sev_es_trampoline_start)

Why are these references not under ifdef CONFIG_AMD_MEM_ENCRYPT conditional?

The following commits added the references to sev_es_trampoline_start
in arch/x86/coco/sev/core.c

0afb6b660a6b58cb336d1175ed687bf9525849a4
8940ac9ced8bc1c48c4e28b0784e3234c9d14469

thanks,
-- Shuah



             reply	other threads:[~2025-04-14 22:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-14 22:28 Shuah Khan [this message]
2025-04-14 23:00 ` sev_es_trampoline_start undefined symbol referenced errors during kunit run Borislav Petkov
2025-04-15  8:54   ` David Gow
2025-04-15 14:25   ` Shuah Khan
2025-04-15 18:01     ` Borislav Petkov
2025-04-15 19:06       ` Shuah Khan
2025-04-15 22:17         ` Borislav Petkov
2025-04-15 22:29           ` Shuah Khan
2025-04-16  0:32             ` David Gow
2025-04-16  1:09               ` Shuah Khan
2025-04-16  9:18               ` Borislav Petkov
2025-04-16  0:54             ` Shuah Khan

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=7c5f9e2a-2e9d-46f2-89b2-83e0d68d3113@linuxfoundation.org \
    --to=skhan@linuxfoundation.org \
    --cc=bp@alien8.de \
    --cc=brendan.higgins@linux.dev \
    --cc=davidgow@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --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