From: Tom Lendacky <thomas.lendacky@amd.com>
To: Sean Christopherson <seanjc@google.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 14:52:27 -0500 [thread overview]
Message-ID: <f550303f-3150-4e5a-ba8d-110170735615@amd.com> (raw)
In-Reply-To: <aMR3bRYEoR0eI6x7@google.com>
On 9/12/25 14:41, Sean Christopherson wrote:
> 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).
Ah, ok. During the SNP host/hypervisor enablement there was feedback about
doing all the RMP type stuff based on whether the kernel could run SNP
guests. So that's why we see things outside of the KVM tree using
CONFIG_KVM_AMD_SEV.
Thanks,
Tom
next prev parent reply other threads:[~2025-09-12 19:52 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
2025-09-12 19:52 ` Tom Lendacky [this message]
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=f550303f-3150-4e5a-ba8d-110170735615@amd.com \
--to=thomas.lendacky@amd.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=seanjc@google.com \
--cc=tglx@linutronix.de \
--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