Re: [tip:x86/efi] x86/efi: Save and restore FPU context around efi_calls (x86_64)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 20 Apr, at 02:28:11AM, Borislav Petkov wrote:
> 
> I guess you can use the kernel_fpu_begin/end() variants here (i.e.,
> without the "__") which disable and enable preemption and thus drop the
> preempt_* calls:
> 
> 	efi_sync_low_kernel_mappings();
> 	kernel_fpu_begin();
> 	 __s = efi_call((void *)efi.systab->runtime->f, __VA_ARGS__);
> 	 kernel_fpu_end();
> 	 __s;
> 
> I'm not sure about the
> 
> 	WARN_ON_ONCE(!irq_fpu_usable());
> 
> thing in kernel_fpu_begin() though, I guess it wouldn't hurt...

Hmm... note that we may call EFI runtime services from interrupt context
in efi_pstore_write(), so it seems like it would be possible to trigger
that WARN_ON_ONCE() there.

Seiji (Cc'd) might have some opinions on this.

Either way, if someone sends me a patch ontop of this one that swaps the
__kernel_fpu_begin() for kernel_fpu_begin() I can try them out in my
lab.

-- 
Matt Fleming, Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux