From: "Kalra, Ashish" <ashish.kalra@amd.com>
To: Borislav Petkov <bp@alien8.de>
Cc: tglx@linutronix.de, mingo@redhat.com,
dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com,
seanjc@google.com, pbonzini@redhat.com, thomas.lendacky@amd.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 v5 1/3] x86/sev: Add new dump_rmp parameter to snp_leak_pages() API
Date: Tue, 16 Sep 2025 10:41:31 -0500 [thread overview]
Message-ID: <3387d2fb-d5a3-46fe-a934-7a05655b34e4@amd.com> (raw)
In-Reply-To: <20250916131221.GCaMliNe3NVmOwzHEN@fat_crate.local>
On 9/16/2025 8:12 AM, Borislav Petkov wrote:
> On Mon, Sep 15, 2025 at 09:21:58PM +0000, Ashish Kalra wrote:
>> @@ -668,6 +673,7 @@ static inline int rmp_make_private(u64 pfn, u64 gpa, enum pg_level level, u32 as
>> return -ENODEV;
>> }
>> static inline int rmp_make_shared(u64 pfn, enum pg_level level) { return -ENODEV; }
>> +static inline void __snp_leak_pages(u64 pfn, unsigned int npages, bool dump_rmp) {}
>> static inline void snp_leak_pages(u64 pfn, unsigned int npages) {}
>
> I basically don't even have to build your patch to see that this can't build.
> See below.
>
> When your patch touches code behind different CONFIG_ items, you must make
> sure it builds with both settings of each CONFIG_ item.
>
I have done the builds with both CONFIG_KVM_AMD_SEV and !CONFIG_KVM_AMD_SEV and the builds are done
without any errors.
And i don't understand how can snp_leak_pages() have this redefinition, as one of them is under
#ifdef CONFIG_KVM_AMD_SEV and the other one is the #else part of it.
Thanks,
Ashish
> In file included from arch/x86/boot/startup/gdt_idt.c:9:
> ./arch/x86/include/asm/sev.h:679:20: error: redefinition of ‘snp_leak_pages’
> 679 | static inline void snp_leak_pages(u64 pfn, unsigned int pages)
> | ^~~~~~~~~~~~~~
> ./arch/x86/include/asm/sev.h:673:20: note: previous definition of ‘snp_leak_pages’ with type ‘void(u64, unsigned int)’ {aka ‘void(long long unsigned int, unsigned int)’}
> 673 | static inline void snp_leak_pages(u64 pfn, unsigned int npages) {}
> | ^~~~~~~~~~~~~~
> make[4]: *** [scripts/Makefile.build:287: arch/x86/boot/startup/gdt_idt.o] Error 1
> make[3]: *** [scripts/Makefile.build:556: arch/x86/boot/startup] Error 2
> make[2]: *** [scripts/Makefile.build:556: arch/x86] Error 2
> make[2]: *** Waiting for unfinished jobs....
> In file included from drivers/iommu/amd/init.c:32:
> ./arch/x86/include/asm/sev.h:679:20: error: redefinition of ‘snp_leak_pages’
> 679 | static inline void snp_leak_pages(u64 pfn, unsigned int pages)
> | ^~~~~~~~~~~~~~
> ./arch/x86/include/asm/sev.h:673:20: note: previous definition of ‘snp_leak_pages’ with type ‘void(u64, unsigned int)’ {aka ‘void(long long unsigned int, unsigned int)’}
> 673 | static inline void snp_leak_pages(u64 pfn, unsigned int npages) {}
> | ^~~~~~~~~~~~~~
> make[5]: *** [scripts/Makefile.build:287: drivers/iommu/amd/init.o] Error 1
> make[4]: *** [scripts/Makefile.build:556: drivers/iommu/amd] Error 2
> make[4]: *** Waiting for unfinished jobs....
> make[3]: *** [scripts/Makefile.build:556: drivers/iommu] Error 2
> make[3]: *** Waiting for unfinished jobs....
> make[2]: *** [scripts/Makefile.build:556: drivers] Error 2
> make[1]: *** [/mnt/kernel/kernel/linux/Makefile:2011: .] Error 2
> make: *** [Makefile:248: __sub-make] Error 2
>
next prev parent reply other threads:[~2025-09-16 15:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-15 21:21 [PATCH v5 0/3] crypto: ccp - Add AMD Seamless Firmware Servicing (SFS) driver Ashish Kalra
2025-09-15 21:21 ` [PATCH v5 1/3] x86/sev: Add new dump_rmp parameter to snp_leak_pages() API Ashish Kalra
2025-09-16 13:12 ` Borislav Petkov
2025-09-16 13:58 ` Tom Lendacky
2025-09-16 16:00 ` Borislav Petkov
2025-09-16 15:41 ` Kalra, Ashish [this message]
2025-09-15 21:22 ` [PATCH v5 2/3] crypto: ccp - Add new HV-Fixed page allocation/free API Ashish Kalra
2025-09-15 21:22 ` [PATCH v5 3/3] crypto: ccp - Add AMD Seamless Firmware Servicing (SFS) driver Ashish Kalra
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=3387d2fb-d5a3-46fe-a934-7a05655b34e4@amd.com \
--to=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=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;
as well as URLs for NNTP newsgroup(s).