File tree Expand file tree Collapse file tree 3 files changed +20
-5
lines changed Expand file tree Collapse file tree 3 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,7 @@ extern void __init load_ucode_bsp(void);
139
139
extern void load_ucode_ap (void );
140
140
void reload_early_microcode (void );
141
141
extern bool get_builtin_firmware (struct cpio_data * cd , const char * name );
142
+ extern bool initrd_gone ;
142
143
#else
143
144
static inline int __init microcode_init (void ) { return 0 ; };
144
145
static inline void __init load_ucode_bsp (void ) { }
Original file line number Diff line number Diff line change 46
46
static struct microcode_ops * microcode_ops ;
47
47
static bool dis_ucode_ldr = true;
48
48
49
+ bool initrd_gone ;
50
+
49
51
LIST_HEAD (microcode_cache );
50
52
51
53
/*
@@ -219,11 +221,12 @@ void load_ucode_ap(void)
219
221
static int __init save_microcode_in_initrd (void )
220
222
{
221
223
struct cpuinfo_x86 * c = & boot_cpu_data ;
224
+ int ret = - EINVAL ;
222
225
223
226
switch (c -> x86_vendor ) {
224
227
case X86_VENDOR_INTEL :
225
228
if (c -> x86 >= 6 )
226
- return save_microcode_in_initrd_intel ();
229
+ ret = save_microcode_in_initrd_intel ();
227
230
break ;
228
231
case X86_VENDOR_AMD :
229
232
if (c -> x86 >= 0x10 )
@@ -233,7 +236,9 @@ static int __init save_microcode_in_initrd(void)
233
236
break ;
234
237
}
235
238
236
- return - EINVAL ;
239
+ initrd_gone = true;
240
+
241
+ return ret ;
237
242
}
238
243
239
244
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)
276
281
* has the virtual address of the beginning of the initrd. It also
277
282
* possibly relocates the ramdisk. In either case, initrd_start contains
278
283
* the updated address so use that instead.
284
+ *
285
+ * initrd_gone is for the hotplug case where we've thrown out initrd
286
+ * already.
279
287
*/
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
+ }
282
294
283
295
return find_cpio_data (path , (void * )start , size , NULL );
284
296
#else /* !CONFIG_BLK_DEV_INITRD */
Original file line number Diff line number Diff line change 9
9
#include <asm/fpu/regset.h>
10
10
#include <asm/fpu/signal.h>
11
11
#include <asm/fpu/types.h>
12
+ #include <asm/fpu/xstate.h>
12
13
#include <asm/traps.h>
13
14
14
15
#include <linux/hardirq.h>
@@ -183,7 +184,8 @@ void fpstate_init(union fpregs_state *state)
183
184
* it will #GP. Make sure it is replaced after the memset().
184
185
*/
185
186
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 ;
187
189
188
190
if (static_cpu_has (X86_FEATURE_FXSR ))
189
191
fpstate_init_fxstate (& state -> fxsave );
You can’t perform that action at this time.
0 commit comments