Skip to content

Commit 8529e8a

Browse files
KAGA-KOKObp3tk0v
authored andcommitted
x86/microcode: Mop up early loading leftovers
Get rid of the initrd_gone hack which was required to keep find_microcode_in_initrd() functional after init. As find_microcode_in_initrd() is now only used during init, mark it accordingly. Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 5af05b8 commit 8529e8a

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

arch/x86/kernel/cpu/microcode/core.c

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@
4444
static struct microcode_ops *microcode_ops;
4545
bool dis_ucode_ldr = true;
4646

47-
bool initrd_gone;
48-
4947
/*
5048
* Synchronization.
5149
*
@@ -180,15 +178,7 @@ void load_ucode_ap(void)
180178
}
181179
}
182180

183-
/* Temporary workaround until find_microcode_in_initrd() is __init */
184-
static int __init mark_initrd_gone(void)
185-
{
186-
initrd_gone = true;
187-
return 0;
188-
}
189-
fs_initcall(mark_initrd_gone);
190-
191-
struct cpio_data find_microcode_in_initrd(const char *path)
181+
struct cpio_data __init find_microcode_in_initrd(const char *path)
192182
{
193183
#ifdef CONFIG_BLK_DEV_INITRD
194184
unsigned long start = 0;
@@ -216,12 +206,7 @@ struct cpio_data find_microcode_in_initrd(const char *path)
216206
* has the virtual address of the beginning of the initrd. It also
217207
* possibly relocates the ramdisk. In either case, initrd_start contains
218208
* the updated address so use that instead.
219-
*
220-
* initrd_gone is for the hotplug case where we've thrown out initrd
221-
* already.
222209
*/
223-
if (initrd_gone)
224-
return (struct cpio_data){ NULL, 0, "" };
225210
if (initrd_start)
226211
start = initrd_start;
227212

arch/x86/kernel/cpu/microcode/internal.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ static inline unsigned int x86_cpuid_family(void)
8686
}
8787

8888
extern bool dis_ucode_ldr;
89-
extern bool initrd_gone;
9089

9190
#ifdef CONFIG_CPU_SUP_AMD
9291
void load_ucode_amd_bsp(unsigned int family);

0 commit comments

Comments
 (0)