All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Refactor: module: sys_funcs.c: create a init_fpu() define for kernels 4.1 and up
@ 2017-11-09 15:42 Eyal Moscovici
  2017-11-09 15:42 ` [PATCH 2/2] module: sys_funcs.c: init_fpu(): add definition for kernel 4.14 " Eyal Moscovici
  2017-11-09 16:19 ` [PATCH 1/2] Refactor: module: sys_funcs.c: create a init_fpu() define for kernels 4.1 " Eyal Moscovici
  0 siblings, 2 replies; 4+ messages in thread
From: Eyal Moscovici @ 2017-11-09 15:42 UTC (permalink / raw)
  To: kvm, pbonzini, rkrcmar, liran.alon; +Cc: idan.brown, Eyal Moscovici

This is done in preparation for kernel 4.14 where the name of the function
changed again.
---
 module/sys_funcs.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/module/sys_funcs.c b/module/sys_funcs.c
index 7d5282f..6676463 100644
--- a/module/sys_funcs.c
+++ b/module/sys_funcs.c
@@ -53,6 +53,10 @@
 #include <asm-generic/set_memory.h>
 #endif
 
+#if LINUX_VERSION_CODE > KERNEL_VERSION(4,2,0)
+#define init_fpu(current)	fpu__activate_curr(&current->thread.fpu);
+#endif
+
 #include <hvx_ioctls.h>
 #include <hvx_host_iface.h>
 #include <hvx_version.h>
@@ -1215,12 +1219,8 @@ static void hvx_cpu_ioctl_prerun(struct hvx_iface_cpu *cpu_iface)
 
 	pr_debug("CPU-%d: start prerun\n", hvx_run->cpu_id);
 
-#if LINUX_VERSION_CODE > KERNEL_VERSION(4,2,0)
-	fpu__activate_curr(&current->thread.fpu);
-#else
 	/* Save host FPU state and set cr0.ts */
 	init_fpu(current);
-#endif
 
 	/* Make sure host doesn't run with cr4.pge bit set */
 	BUG_ON(native_read_cr4() & X86_CR4_PGE);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] module: sys_funcs.c: init_fpu(): add definition for kernel 4.14 and up
  2017-11-09 15:42 [PATCH 1/2] Refactor: module: sys_funcs.c: create a init_fpu() define for kernels 4.1 and up Eyal Moscovici
@ 2017-11-09 15:42 ` Eyal Moscovici
  2017-11-09 16:19   ` Eyal Moscovici
  2017-11-09 16:19 ` [PATCH 1/2] Refactor: module: sys_funcs.c: create a init_fpu() define for kernels 4.1 " Eyal Moscovici
  1 sibling, 1 reply; 4+ messages in thread
From: Eyal Moscovici @ 2017-11-09 15:42 UTC (permalink / raw)
  To: kvm, pbonzini, rkrcmar, liran.alon; +Cc: idan.brown, Eyal Moscovici

In kernel 4.14 the function fpu__activate_curr to fpu__initialize.

Based on upstream commit:
2ce03d850b9a2f17d55596ecfa86e72b5687a627 -
x86/fpu: Rename fpu__activate_curr() to fpu__initialize()
---
 module/sys_funcs.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/module/sys_funcs.c b/module/sys_funcs.c
index 6676463..b675e59 100644
--- a/module/sys_funcs.c
+++ b/module/sys_funcs.c
@@ -53,7 +53,9 @@
 #include <asm-generic/set_memory.h>
 #endif
 
-#if LINUX_VERSION_CODE > KERNEL_VERSION(4,2,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)
+#define init_fpu(current)	fpu__initialize(&current->thread.fpu);
+#elif LINUX_VERSION_CODE > KERNEL_VERSION(4,2,0)
 #define init_fpu(current)	fpu__activate_curr(&current->thread.fpu);
 #endif
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] module: sys_funcs.c: init_fpu(): add definition for kernel 4.14 and up
  2017-11-09 15:42 ` [PATCH 2/2] module: sys_funcs.c: init_fpu(): add definition for kernel 4.14 " Eyal Moscovici
@ 2017-11-09 16:19   ` Eyal Moscovici
  0 siblings, 0 replies; 4+ messages in thread
From: Eyal Moscovici @ 2017-11-09 16:19 UTC (permalink / raw)
  To: Eyal Moscovici; +Cc: idan.brown, kvm, pbonzini, rkrcmar, liran.alon

Please ignore these patches. Was sent by a mistaken git-send-email command.
I'm very sorry for that.

On 09/11/17 17:42, Eyal Moscovici wrote:
> In kernel 4.14 the function fpu__activate_curr to fpu__initialize.
>
> Based on upstream commit:
> 2ce03d850b9a2f17d55596ecfa86e72b5687a627 -
> x86/fpu: Rename fpu__activate_curr() to fpu__initialize()
> ---
>  module/sys_funcs.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/module/sys_funcs.c b/module/sys_funcs.c
> index 6676463..b675e59 100644
> --- a/module/sys_funcs.c
> +++ b/module/sys_funcs.c
> @@ -53,7 +53,9 @@
>  #include <asm-generic/set_memory.h>
>  #endif
>  
> -#if LINUX_VERSION_CODE > KERNEL_VERSION(4,2,0)
> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)
> +#define init_fpu(current)	fpu__initialize(&current->thread.fpu);
> +#elif LINUX_VERSION_CODE > KERNEL_VERSION(4,2,0)
>  #define init_fpu(current)	fpu__activate_curr(&current->thread.fpu);
>  #endif
>  

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] Refactor: module: sys_funcs.c: create a init_fpu() define for kernels 4.1 and up
  2017-11-09 15:42 [PATCH 1/2] Refactor: module: sys_funcs.c: create a init_fpu() define for kernels 4.1 and up Eyal Moscovici
  2017-11-09 15:42 ` [PATCH 2/2] module: sys_funcs.c: init_fpu(): add definition for kernel 4.14 " Eyal Moscovici
@ 2017-11-09 16:19 ` Eyal Moscovici
  1 sibling, 0 replies; 4+ messages in thread
From: Eyal Moscovici @ 2017-11-09 16:19 UTC (permalink / raw)
  To: kvm, pbonzini, rkrcmar, liran.alon; +Cc: idan.brown

Please ignore these patches. Was sent by a mistaken git-send-email command.
I'm very sorry for that.


On 09/11/17 17:42, Eyal Moscovici wrote:
> This is done in preparation for kernel 4.14 where the name of the function
> changed again.
> ---
>  module/sys_funcs.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/module/sys_funcs.c b/module/sys_funcs.c
> index 7d5282f..6676463 100644
> --- a/module/sys_funcs.c
> +++ b/module/sys_funcs.c
> @@ -53,6 +53,10 @@
>  #include <asm-generic/set_memory.h>
>  #endif
>  
> +#if LINUX_VERSION_CODE > KERNEL_VERSION(4,2,0)
> +#define init_fpu(current)	fpu__activate_curr(&current->thread.fpu);
> +#endif
> +
>  #include <hvx_ioctls.h>
>  #include <hvx_host_iface.h>
>  #include <hvx_version.h>
> @@ -1215,12 +1219,8 @@ static void hvx_cpu_ioctl_prerun(struct hvx_iface_cpu *cpu_iface)
>  
>  	pr_debug("CPU-%d: start prerun\n", hvx_run->cpu_id);
>  
> -#if LINUX_VERSION_CODE > KERNEL_VERSION(4,2,0)
> -	fpu__activate_curr(&current->thread.fpu);
> -#else
>  	/* Save host FPU state and set cr0.ts */
>  	init_fpu(current);
> -#endif
>  
>  	/* Make sure host doesn't run with cr4.pge bit set */
>  	BUG_ON(native_read_cr4() & X86_CR4_PGE);

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-09 16:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-09 15:42 [PATCH 1/2] Refactor: module: sys_funcs.c: create a init_fpu() define for kernels 4.1 and up Eyal Moscovici
2017-11-09 15:42 ` [PATCH 2/2] module: sys_funcs.c: init_fpu(): add definition for kernel 4.14 " Eyal Moscovici
2017-11-09 16:19   ` Eyal Moscovici
2017-11-09 16:19 ` [PATCH 1/2] Refactor: module: sys_funcs.c: create a init_fpu() define for kernels 4.1 " Eyal Moscovici

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.