[PATCH] powerpc/kvmbook3s_hv: propagate H_SET_MODE to the host

Greg Kurz gkurz at linux.vnet.ibm.com
Wed Sep 25 22:27:40 EST 2013


On Wed, 25 Sep 2013 14:10:27 +0200
Laurent Dufour <ldufour at linux.vnet.ibm.com> wrote:
> Follow-up to Anton's H_SET_MODE patch, the host should be taken aware of
> guest endianess change.
> 
> The hcall H_SET_MODE is processed in kvm then in the host.
> 
> Signed-off-by: Laurent Dufour <ldufour at linux.vnet.ibm.com>

Tested-by: Greg Kurz <gkurz at linux.vnet.ibm.com>

> ---
>  arch/powerpc/kvm/book3s_hv.c |    8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
> index 998cad3..4a47c74 100644
> --- a/arch/powerpc/kvm/book3s_hv.c
> +++ b/arch/powerpc/kvm/book3s_hv.c
> @@ -599,6 +599,14 @@ int kvmppc_pseries_do_hcall(struct kvm_vcpu *vcpu)
>  					kvmppc_get_gpr(vcpu, 5),
>  					kvmppc_get_gpr(vcpu, 6),
>  					kvmppc_get_gpr(vcpu, 7));
> +		/*
> +		 * If the hcall succeeded, we propagate it to the host.
> +		 * This way, it will be aware of the endianess's change too.
> +		 * The assumption is made that the hcall will succeed in the
> +		 * host.

Hmmm... Not sure the last sentence is appropriate from a kernel
perspective: it is up to the userland code to remain consistent
with this endianess change.

> +		 */
> +		if (ret == H_SUCCESS)
> +			return RESUME_HOST;
>  		break;
> 
>  	case H_XIRR:
> 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
> 



-- 
Gregory Kurz                                     kurzgreg at fr.ibm.com
                                                 gkurz at linux.vnet.ibm.com
Software Engineer @ IBM/Meiosys                  http://www.ibm.com
Tel +33 (0)562 165 496

"Anarchy is about taking complete responsibility for yourself."
        Alan Moore.



More information about the Linuxppc-dev mailing list