From patchwork Wed Sep 25 12:10:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Dufour X-Patchwork-Id: 277822 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 396E92C0332 for ; Wed, 25 Sep 2013 22:11:07 +1000 (EST) Received: from e06smtp17.uk.ibm.com (e06smtp17.uk.ibm.com [195.75.94.113]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "e06smtp17.uk.ibm.com", Issuer "GeoTrust SSL CA" (not verified)) by ozlabs.org (Postfix) with ESMTPS id AA65D2C00C6 for ; Wed, 25 Sep 2013 22:10:37 +1000 (EST) Received: from /spool/local by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 25 Sep 2013 13:10:32 +0100 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp17.uk.ibm.com (192.168.101.147) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 25 Sep 2013 13:10:29 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 94C5E1B0805F for ; Wed, 25 Sep 2013 13:10:30 +0100 (BST) Received: from d06av12.portsmouth.uk.ibm.com (d06av12.portsmouth.uk.ibm.com [9.149.37.247]) by b06cxnps4075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r8PCAG0F459234 for ; Wed, 25 Sep 2013 12:10:16 GMT Received: from d06av12.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r8PCARVW029717 for ; Wed, 25 Sep 2013 06:10:28 -0600 Received: from [127.0.1.1] (nimbus.lab.toulouse-stg.fr.ibm.com [9.101.4.33]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id r8PCARqA029710; Wed, 25 Sep 2013 06:10:27 -0600 Subject: [PATCH] powerpc/kvmbook3s_hv: propagate H_SET_MODE to the host To: linuxppc-dev@lists.ozlabs.org, Anton Blanchard From: Laurent Dufour Date: Wed, 25 Sep 2013 14:10:27 +0200 Message-ID: <20130925121027.29504.19269.stgit@nimbus> In-Reply-To: <1379901913-5945-37-git-send-email-anton@samba.org> References: <1379901913-5945-37-git-send-email-anton@samba.org> User-Agent: StGit/0.15 MIME-Version: 1.0 X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13092512-0542-0000-0000-0000068E3B70 Cc: Paul Mackerras X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.16rc2 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 Tested-by: Greg Kurz --- 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. + */ + if (ret == H_SUCCESS) + return RESUME_HOST; break; case H_XIRR: