Re: [PATCH v8] um: Enable preemption in UML

2024-04-01 Thread Anton Ivanov
On 01/04/2024 12:04, Tiwei Bie wrote: On 3/29/24 3:50 AM, anton.iva...@cambridgegreys.com wrote: [...] + +void kernel_fpu_begin(void) +{ + preempt_disable(); + + WARN_ON(this_cpu_read(in_kernel_fpu)); + + this_cpu_write(in_kernel_fpu, true); + +#ifdef CONFIG_64BIT + if (l

Re: [PATCH v8] um: Enable preemption in UML

2024-04-01 Thread Tiwei Bie
On 3/29/24 3:50 AM, anton.iva...@cambridgegreys.com wrote: [...] > + > +void kernel_fpu_begin(void) > +{ > + preempt_disable(); > + > + WARN_ON(this_cpu_read(in_kernel_fpu)); > + > + this_cpu_write(in_kernel_fpu, true); > + > +#ifdef CONFIG_64BIT > + if (likely(cpu_has(&boot_cpu_dat

[PATCH v8] um: Enable preemption in UML

2024-03-28 Thread anton . ivanov
From: Anton Ivanov 1. Preemption requires saving/restoring FPU state. This patch adds support for it using GCC intrinsics as well as appropriate storage space in the thread structure. We reuse the space which is already allocated for the userspace threads in the thread_info structure. 2. irq cri