x86/boot: Drop erroneous __init annotation from early_set_pages_state()
PATCH 1/1 x86/boot: Drop erroneous __init annotation from early_set_pages_state()
From: Ard Biesheuvel <[email protected]>
The kexec code will call set_pages_state() after tearing down all the GHCBs, which will therefore result in a call to early_set_pages_state().
This means the __init annotation is wrong, and must be dropped.
---
Cc: Borislav Petkov <[email protected]>
Cc: "Aithal, Srikanth" <[email protected]>
Cc: Sean Christopherson <[email protected]>
Cc: Ashish Kalra <[email protected]>
Cc: Tom Lendacky <[email protected]>
arch/x86/boot/startup/sev-startup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/boot/startup/sev-startup.c +1 -1
@@ -44,7 +44,7 @@/* Include code shared with pre-decompression boot stage */ #include "sev-shared.c" -void __init +void early_set_pages_state (unsigned long vaddr,unsigned long paddr,unsigned long npages,const struct psc_desc *desc) {
Signature · 1 line
2.51.0.534.gc79095c0ca-goog
Quoted 10 lines · Ard Biesheuvel
From: Ard Biesheuvel <[email protected]>
The kexec code will call
set_pages_state()after tearing down all the GHCBs, which will therefore result in a call toearly_set_pages_state().This means the
__initannotation is wrong, and must be dropped.Fixes faed658ce71d ("x86/boot: Move startup code out of __head section")Signed-off-by Ard Biesheuvel <[email protected]>
Quoted 26 lines
---
Cc: Borislav Petkov <[email protected]>
Cc: "Aithal, Srikanth" <[email protected]>
Cc: Sean Christopherson <[email protected]>
Cc: Ashish Kalra <[email protected]>
Cc: Tom Lendacky <[email protected]>arch/x86/boot/startup/sev-startup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/boot/startup/sev-startup.c +1
-2@@ -44,7 +44,7 @@/* Include code shared with pre-decompression boot stage */ #include "sev-shared.c" -void __init +void early_set_pages_state (unsigned long vaddr,unsigned long paddr,unsigned long npages,const struct psc_desc *desc) { --2.51.0.534.gc79095c0ca-goog
The following commit has been merged into the x86/apic branch of tip:
The following commit has been merged into the x86/apic branch of tip:
Commit-ID: 1f6113ae5ac4927fe80256154ebb0461e670fa85 Gitweb: https://git.kernel.org/tip/1f6113ae5ac4927fe80256154ebb0461e670fa85 Author: Ard Biesheuvel <[email protected]> AuthorDate: Wed, 24 Sep 2025 17:53:11 +02:00 Committer: Borislav Petkov (AMD) <[email protected]> CommitterDate: Wed, 24 Sep 2025 18:08:34 +02:00
x86/boot: Drop erroneous __init annotation from early_set_pages_state()
The kexec code will call set_pages_state() after tearing down all the GHCBs, which will therefore result in a call to early_set_pages_state().
This means the __init annotation is wrong, and must be dropped.
--- arch/x86/boot/startup/sev-startup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/boot/startup/sev-startup.c +1 -1
@@ -44,7 +44,7 @@/* Include code shared with pre-decompression boot stage */ #include "sev-shared.c" -void __init +void early_set_pages_state (unsigned long vaddr,unsigned long paddr,unsigned long npages,const struct psc_desc *desc) {