From mboxrd@z Thu Jan 1 00:00:00 1970 From: Will Deacon Subject: Re: [PATCH 4/5] kvmtool: Save datamatch as little endian in {add,del}_event Date: Wed, 17 Jun 2015 11:03:27 +0100 Message-ID: <20150617100326.GB6303@arm.com> References: <1434368986-14963-1-git-send-email-andreas.herrmann@caviumnetworks.com> <1434368986-14963-5-git-send-email-andreas.herrmann@caviumnetworks.com> <20150616171713.GP30522@arm.com> <20150617071749.GA19051@alberich> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "kvm@vger.kernel.org" To: Andreas Herrmann Return-path: Received: from foss.arm.com ([217.140.101.70]:39000 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932168AbbFQKDa (ORCPT ); Wed, 17 Jun 2015 06:03:30 -0400 Content-Disposition: inline In-Reply-To: <20150617071749.GA19051@alberich> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Jun 17, 2015 at 08:17:49AM +0100, Andreas Herrmann wrote: > On Tue, Jun 16, 2015 at 06:17:14PM +0100, Will Deacon wrote: > > On Mon, Jun 15, 2015 at 12:49:45PM +0100, Andreas Herrmann wrote: > > > W/o dedicated endianess it's impossible to find reliably a match > > > e.g. in kernel/virt/kvm/eventfd.c ioeventfd_in_range. > > > > Hmm, but shouldn't this be the endianness of the guest, rather than just > > forcing things to little-endian? > > With my patch and following adaption to > ioeventfd_in_range (in virt/kvm/eventfd.c): [...] > But now I see, w/o a correponding kernel change the patch shouldn't > be merged. Digging a bit deeper, I think it's up to the architecture KVM backend (in the kernel) to present the mmio buffer to core kvm in the host endianness. For example, on ARM, we honour the endianness of the vcpu in vcpu_data_guest_to_host when we populate the buffer for kvm_io_bus_write (which is what ends up in the ioeventfd code). I couldn't find equivalent code for MIPs, but I may have been looking in the wrong place. Will