public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: David Gow <davidgow@google.com>
Cc: Borislav Petkov <bp@alien8.de>,
	thomas.lendacky@amd.com, "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>,
	Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: sev_es_trampoline_start undefined symbol referenced errors during kunit run
Date: Tue, 15 Apr 2025 19:09:06 -0600	[thread overview]
Message-ID: <6775da23-c596-44e4-a7f3-64c602b2609b@linuxfoundation.org> (raw)
In-Reply-To: <CABVgOSmXfoEonJ6w33sj1sb5F2Ak5Kek0AxskSmjq=d=D=PiVw@mail.gmail.com>

On 4/15/25 18:32, David Gow wrote:
> On Wed, 16 Apr 2025 at 06:30, Shuah Khan <skhan@linuxfoundation.org> wrote:
>>
>> On 4/15/25 16:17, Borislav Petkov wrote:
>>> On Tue, Apr 15, 2025 at 01:06:49PM -0600, Shuah Khan wrote:
>>>> Does your arch/x86/realmode/rm/pasyms.h has reference to sev_es_trampoline_start?
>>>>
>>>> The one in my tree has it.
>>>>
>>>> arch/x86/realmode/rm/pasyms.h:pa_sev_es_trampoline_start = sev_es_trampoline_start
>>>
>>>
>>> # ./tools/testing/kunit/kunit.py run --arch x86_64
>>> ...
>>>
>>> [00:15:36] Elapsed time: 58.840s total, 2.096s configuring, 53.170s building, 3.487s running
>>>
>>> # cat arch/x86/realmode/rm/pasyms.h
>>> cat: arch/x86/realmode/rm/pasyms.h: No such file or directory
>>>
>>> Could explain why I don't see the issue...
>>>
>>
>> I see arch/x86/realmode/rm/pasyms.h on my system. It is a generated
>> file from arch/x86/realmode/rm Makefile
>>
> 
> Aha: I've been able to reproduce this, albeit by not cleaning the tree properly.
> 
> - make ARCH=x86_64 # Build an x86_64 kernel in-tree, with
> CONFIG_AMD_MEM_ENCRYPT=y
> - ./tools/testing/kunit/kunit.py run # Attempt to build and run KUnit
> on a UML kernel (built out-of-tree in the .kunit directory)
> # This will fail, telling you to clean the tree with 'make ARCH=um mrproper'
> - make ARCH=um mrproper # Clean the source tree, but incompletely, as
> the original kernel was built with ARCH=x86_64, not ARCH=um
> # As a result, the pasyms.h file will be left in the tree, as it's not
> part of the UML build
> - ./tools/testing/kunit/kunit.py run --arch x86_64 # Attempt to
> build/run an out-of-tree x86_64 kernel.
> # This will not tell you to clean the source tree, as it was
> (incorrectly) cleaned for the wrong architecture, but will fail due to
> the wrong pasyms.h still being present.
> 
> I'm not sure if this is the same cause as what you're seeing, Shuah,
> but it seems plausible enough. If so, this is really an issue with the
> Makefiles suggesting the wrong make mrproper command (assuming that
> the architecture hasn't changed), or failing to detect that the source
> tree still isn't clean. Maybe that's something we could work around in
> either the arch/um makefiles or in kunit.py (or at least the
> documentation), if we don't want to rework how dirty trees are
> detected.
> 

Yes I am seeing the same thing. However, it doesn't even ask you
to run mrproper because it doesn't seem to think the tree is dirty.

So the fix would be to detect that the tree is dirty?

I just tried make ARCH=x86_64 mrproper and then ran
kunit.py run --arch x86_64


> Either way, this should work after running `make ARCH=x86_64
> mrproper`. Does that work for you?

I just tried make ARCH=x86_64 mrproper and then ran
kunit.py run --arch x86_64

thanks,
-- Shuah

  reply	other threads:[~2025-04-16  1:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-14 22:28 sev_es_trampoline_start undefined symbol referenced errors during kunit run Shuah Khan
2025-04-14 23:00 ` 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 [this message]
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=6775da23-c596-44e4-a7f3-64c602b2609b@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