From: Sean Christopherson <seanjc@google.com>
To: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Ashish Kalra <Ashish.Kalra@amd.com>,
tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com,
pbonzini@redhat.com, herbert@gondor.apana.org.au,
nikunj@amd.com, davem@davemloft.net, aik@amd.com,
ardb@kernel.org, john.allen@amd.com, michael.roth@amd.com,
Neeraj.Upadhyay@amd.com, linux-kernel@vger.kernel.org,
kvm@vger.kernel.org, linux-crypto@vger.kernel.org
Subject: Re: [PATCH v4 1/3] x86/sev: Add new dump_rmp parameter to snp_leak_pages() API
Date: Fri, 12 Sep 2025 12:41:33 -0700 [thread overview]
Message-ID: <aMR3bRYEoR0eI6x7@google.com> (raw)
In-Reply-To: <df357d87-3b4b-41a4-acdf-31289590b233@amd.com>
On Fri, Sep 12, 2025, Tom Lendacky wrote:
> On 9/12/25 13:34, Sean Christopherson wrote:
> > But the below build failures show that they aren't dead code, which means that
> > kernels with CONFIG_KVM_AMD_SEV=n will silently (until something explodes) do the
> > wrong thing, because the stubs are hiding the missing dependencies.
> >
> > arch/x86/boot/startup/sev-shared.c: In function ‘pvalidate_4k_page’:
> > arch/x86/boot/startup/sev-shared.c:820:17: error: implicit declaration of function ‘sev_evict_cache’ [-Wimplicit-function-declaration]
> > 820 | sev_evict_cache((void *)vaddr, 1);
>
> Yeah, this one is on me. sev_evict_cache() is guest code and should be
> under the CONFIG_AMD_MEM_ENCRYPT #ifdef.
>
> > | ^~~~~~~~~~~~~~~
> > AR arch/x86/realmode/built-in.a
> > arch/x86/coco/sev/core.c: In function ‘pvalidate_pages’:
> > arch/x86/coco/sev/core.c:386:25: error: implicit declaration of function ‘sev_evict_cache’ [-Wimplicit-function-declaration]
> > 386 | sev_evict_cache(pfn_to_kaddr(e->gfn), e->pagesize ? 512 : 1);
> > | ^~~~~~~~~~~~~~~
> > arch/x86/mm/mem_encrypt.c: In function ‘mem_encrypt_setup_arch’:
> > arch/x86/mm/mem_encrypt.c:112:17: error: implicit declaration of function ‘snp_fixup_e820_tables’ [-Wimplicit-function-declaration]
> > 112 | snp_fixup_e820_tables();
>
> This function is only meant to be used if we're going to run SEV guests,
> so being guarded by CONFIG_KVM_AMD_SEV was on purpose. I'm just not sure
> why the stub didn't get used... or did you remove them?
I removed all the stubs to see what would break (I was expecting nothing since
all of KVM's accesses are gated by CONFIG_KVM_AMD_SEV).
next prev parent reply other threads:[~2025-09-12 19:41 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-10 22:55 [PATCH v4 0/3] crypto: ccp - Add AMD Seamless Firmware Servicing (SFS) driver Ashish Kalra
2025-09-10 22:55 ` [PATCH v4 1/3] x86/sev: Add new dump_rmp parameter to snp_leak_pages() API Ashish Kalra
2025-09-12 14:52 ` Tom Lendacky
2025-09-12 15:58 ` Borislav Petkov
2025-09-12 18:34 ` Sean Christopherson
2025-09-13 10:55 ` Borislav Petkov
2025-09-16 3:51 ` Herbert Xu
2025-09-16 10:27 ` Borislav Petkov
2025-09-12 18:34 ` Sean Christopherson
2025-09-12 19:37 ` Tom Lendacky
2025-09-12 19:41 ` Sean Christopherson [this message]
2025-09-12 19:52 ` Tom Lendacky
2025-09-10 22:55 ` [PATCH v4 2/3] crypto: ccp - Add new HV-Fixed page allocation/free API Ashish Kalra
2025-09-12 14:57 ` Tom Lendacky
2025-09-10 22:55 ` [PATCH v4 3/3] crypto: ccp - Add AMD Seamless Firmware Servicing (SFS) driver Ashish Kalra
2025-09-12 15:49 ` Tom Lendacky
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=aMR3bRYEoR0eI6x7@google.com \
--to=seanjc@google.com \
--cc=Ashish.Kalra@amd.com \
--cc=Neeraj.Upadhyay@amd.com \
--cc=aik@amd.com \
--cc=ardb@kernel.org \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=hpa@zytor.com \
--cc=john.allen@amd.com \
--cc=kvm@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.roth@amd.com \
--cc=mingo@redhat.com \
--cc=nikunj@amd.com \
--cc=pbonzini@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