Patchwork [2/2] PPC: KVM: fix "set one register"

login
register
mail settings
Submitter Alexey Kardashevskiy
Date Jan. 6, 2014, 5:36 a.m.
Message ID <1388986600-26301-3-git-send-email-aik@ozlabs.ru>
Download mbox | patch
Permalink /patch/307109/
State New
Headers show

Comments

Alexey Kardashevskiy - Jan. 6, 2014, 5:36 a.m.
Due to missing @one_reg_id assignment in _spr_register(),
the kvm_get_one_reg/kvm_set_one_reg API has never really been working.

This enabled the API and removes use of the API for LPCR as
kvm_arch_get_registers/kvm_arch_put_registers run a loop for all 1024 SPR
and LPCR is one of them.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
 target-ppc/translate_init.c | 3 +++
 1 file changed, 3 insertions(+)
Alexey Kardashevskiy - Jan. 6, 2014, 6:40 a.m.
On 01/06/2014 04:36 PM, Alexey Kardashevskiy wrote:
> Due to missing @one_reg_id assignment in _spr_register(),
> the kvm_get_one_reg/kvm_set_one_reg API has never really been working.
> 
> This enabled the API and removes use of the API for LPCR as
> kvm_arch_get_registers/kvm_arch_put_registers run a loop for all 1024 SPR
> and LPCR is one of them.

Agrh.

The commit message must be:
===
Due to missing @one_reg_id assignment in _spr_register(),
the kvm_get_one_reg/kvm_set_one_reg API has never really been working.

This reenables the API by assigning the @one_reg_id field in the SPR
descriptor.
===

Repost?


> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
>  target-ppc/translate_init.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
> index 144de3d..149a932 100644
> --- a/target-ppc/translate_init.c
> +++ b/target-ppc/translate_init.c
> @@ -628,6 +628,9 @@ static inline void _spr_register(CPUPPCState *env, int num,
>      spr->oea_read = oea_read;
>      spr->oea_write = oea_write;
>  #endif
> +#if defined(CONFIG_KVM)
> +    spr->one_reg_id = one_reg_id,
> +#endif
>      env->spr[num] = initial_value;
>  }
>  
>
Greg Kurz - Jan. 6, 2014, 5:30 p.m.
On Mon,  6 Jan 2014 16:36:40 +1100
Alexey Kardashevskiy <aik@ozlabs.ru> wrote:

> Due to missing @one_reg_id assignment in _spr_register(),
> the kvm_get_one_reg/kvm_set_one_reg API has never really been working.
> 
> This enabled the API and removes use of the API for LPCR as
> kvm_arch_get_registers/kvm_arch_put_registers run a loop for all 1024 SPR
> and LPCR is one of them.
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>

Reviewed-by: Greg Kurz <gkurz@linux.vnet.ibm.com>

> ---
>  target-ppc/translate_init.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
> index 144de3d..149a932 100644
> --- a/target-ppc/translate_init.c
> +++ b/target-ppc/translate_init.c
> @@ -628,6 +628,9 @@ static inline void _spr_register(CPUPPCState *env,
> int num, spr->oea_read = oea_read;
>      spr->oea_write = oea_write;
>  #endif
> +#if defined(CONFIG_KVM)
> +    spr->one_reg_id = one_reg_id,
> +#endif
>      env->spr[num] = initial_value;
>  }
>

Patch

diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index 144de3d..149a932 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -628,6 +628,9 @@  static inline void _spr_register(CPUPPCState *env, int num,
     spr->oea_read = oea_read;
     spr->oea_write = oea_write;
 #endif
+#if defined(CONFIG_KVM)
+    spr->one_reg_id = one_reg_id,
+#endif
     env->spr[num] = initial_value;
 }