Skip to content

Commit f26483e

Browse files
author
Ingo Molnar
committed
Merge branch 'x86/urgent' into x86/microcode, to resolve conflicts
Conflicts: arch/x86/kernel/cpu/microcode/amd.c arch/x86/kernel/cpu/microcode/core.c Signed-off-by: Ingo Molnar <[email protected]>
2 parents da0aa3d + 24c2503 commit f26483e

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

arch/x86/include/asm/microcode.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ extern void __init load_ucode_bsp(void);
139139
extern void load_ucode_ap(void);
140140
void reload_early_microcode(void);
141141
extern bool get_builtin_firmware(struct cpio_data *cd, const char *name);
142+
extern bool initrd_gone;
142143
#else
143144
static inline int __init microcode_init(void) { return 0; };
144145
static inline void __init load_ucode_bsp(void) { }

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

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
static struct microcode_ops *microcode_ops;
4747
static bool dis_ucode_ldr = true;
4848

49+
bool initrd_gone;
50+
4951
LIST_HEAD(microcode_cache);
5052

5153
/*
@@ -219,11 +221,12 @@ void load_ucode_ap(void)
219221
static int __init save_microcode_in_initrd(void)
220222
{
221223
struct cpuinfo_x86 *c = &boot_cpu_data;
224+
int ret = -EINVAL;
222225

223226
switch (c->x86_vendor) {
224227
case X86_VENDOR_INTEL:
225228
if (c->x86 >= 6)
226-
return save_microcode_in_initrd_intel();
229+
ret = save_microcode_in_initrd_intel();
227230
break;
228231
case X86_VENDOR_AMD:
229232
if (c->x86 >= 0x10)
@@ -233,7 +236,9 @@ static int __init save_microcode_in_initrd(void)
233236
break;
234237
}
235238

236-
return -EINVAL;
239+
initrd_gone = true;
240+
241+
return ret;
237242
}
238243

239244
struct cpio_data find_microcode_in_initrd(const char *path, bool use_pa)
@@ -276,9 +281,16 @@ struct cpio_data find_microcode_in_initrd(const char *path, bool use_pa)
276281
* has the virtual address of the beginning of the initrd. It also
277282
* possibly relocates the ramdisk. In either case, initrd_start contains
278283
* the updated address so use that instead.
284+
*
285+
* initrd_gone is for the hotplug case where we've thrown out initrd
286+
* already.
279287
*/
280-
if (!use_pa && initrd_start)
281-
start = initrd_start;
288+
if (!use_pa) {
289+
if (initrd_gone)
290+
return (struct cpio_data){ NULL, 0, "" };
291+
if (initrd_start)
292+
start = initrd_start;
293+
}
282294

283295
return find_cpio_data(path, (void *)start, size, NULL);
284296
#else /* !CONFIG_BLK_DEV_INITRD */

arch/x86/kernel/fpu/core.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <asm/fpu/regset.h>
1010
#include <asm/fpu/signal.h>
1111
#include <asm/fpu/types.h>
12+
#include <asm/fpu/xstate.h>
1213
#include <asm/traps.h>
1314

1415
#include <linux/hardirq.h>
@@ -183,7 +184,8 @@ void fpstate_init(union fpregs_state *state)
183184
* it will #GP. Make sure it is replaced after the memset().
184185
*/
185186
if (static_cpu_has(X86_FEATURE_XSAVES))
186-
state->xsave.header.xcomp_bv = XCOMP_BV_COMPACTED_FORMAT;
187+
state->xsave.header.xcomp_bv = XCOMP_BV_COMPACTED_FORMAT |
188+
xfeatures_mask;
187189

188190
if (static_cpu_has(X86_FEATURE_FXSR))
189191
fpstate_init_fxstate(&state->fxsave);

0 commit comments

Comments
 (0)