From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Mackerras Subject: Re: [PATCH v3 29/33] KVM: PPC: Book3S HV: Handle differing endianness for H_ENTER_NESTED Date: Thu, 4 Oct 2018 19:29:38 +1000 Message-ID: <20181004092938.GB3255@fergus> References: <1538479892-14835-1-git-send-email-paulus@ozlabs.org> <1538479892-14835-30-git-send-email-paulus@ozlabs.org> <20181003061336.GV1886@umbus.fritz.box> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linuxppc-dev@ozlabs.org, kvm-ppc@vger.kernel.org, kvm@vger.kernel.org To: David Gibson Return-path: Content-Disposition: inline In-Reply-To: <20181003061336.GV1886@umbus.fritz.box> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane.org@lists.ozlabs.org Sender: "Linuxppc-dev" List-Id: kvm.vger.kernel.org On Wed, Oct 03, 2018 at 04:13:36PM +1000, David Gibson wrote: > On Tue, Oct 02, 2018 at 09:31:28PM +1000, Paul Mackerras wrote: > > From: Suraj Jitindar Singh > > > > The hcall H_ENTER_NESTED takes as the two parameters the address in > > L1 guest memory of a hv_regs struct and a pt_regs struct which the > > L1 guest would like to use to run a L2 guest and in which are returned > > the exit state of the L2 guest. For efficiency, these are in the > > endianness of the L1 guest, rather than being always big-endian as is > > usually the case for PAPR hypercalls. > > Does that actually make a difference for efficiency? I thought the > presence of the byte-reversing loads and stores meant byteswapping was > basically zero-cost on POWER. It means that the L1 hypervisor can pass a pointer to the regs struct in the kvm_vcpu struct rather than having to make a copy, and copy the values back after the H_ENTER_NESTED. I'll reword the commit message to say it's mostly about convenience and to a lesser extent about performance. Paul.