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);
139139extern void load_ucode_ap (void );
140140void reload_early_microcode (void );
141141extern bool get_builtin_firmware (struct cpio_data * cd , const char * name );
142+ extern bool initrd_gone ;
142143#else
143144static inline int __init microcode_init (void ) { return 0 ; };
144145static inline void __init load_ucode_bsp (void ) { }
Original file line number Diff line number Diff line change 4646static struct microcode_ops * microcode_ops ;
4747static bool dis_ucode_ldr = true;
4848
49+ bool initrd_gone ;
50+
4951LIST_HEAD (microcode_cache );
5052
5153/*
@@ -219,11 +221,12 @@ void load_ucode_ap(void)
219221static 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
239244struct 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 */
Original file line number Diff line number Diff line change 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 );
You can’t perform that action at this time.
0 commit comments