From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrkK1-0000BM-Ji for qemu-devel@nongnu.org; Thu, 29 Oct 2015 06:20:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZrkJy-0003AO-DG for qemu-devel@nongnu.org; Thu, 29 Oct 2015 06:20:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45484) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrkJy-00039x-85 for qemu-devel@nongnu.org; Thu, 29 Oct 2015 06:20:38 -0400 Date: Thu, 29 Oct 2015 12:20:31 +0200 From: Victor Kaplansky Message-ID: <1446113893-31921-1-git-send-email-victork@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH] vhost user: fix documentation of log atomic elements List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: changchun.ouyang@intel.com, thibaut.collet@6wind.com, "Michael S. Tsirkin" , Victor Kaplansky , marcandre.lureau@redhat.com Current implementation in hw/virtio/vhost.c accesses the log by 32-bit wide chunks in host native bit and byte endianness. Accessing the log by 8-bit wide chunks, as the spec suggests, will be broken on big-endian hosts. This commit changes the spec to match the implementation. Signed-off-by: Victor Kaplansky --- docs/specs/vhost-user.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/specs/vhost-user.txt b/docs/specs/vhost-user.txt index e0d71e2..3d18771 100644 --- a/docs/specs/vhost-user.txt +++ b/docs/specs/vhost-user.txt @@ -177,9 +177,11 @@ addresses. The log covers from address 0 to the maximum of guest regions. In pseudo-code, to mark page at "addr" as dirty: page = addr / VHOST_LOG_PAGE -log[page / 8] |= 1 << page % 8 +log[page / 32] |= 1 << page % 32 -Use atomic operations, as the log may be concurrently manipulated. +Use atomic operations, as the log may be concurrently +manipulated, and access the log by atomic 32-bit wide elements in +host native bit-level endianness. VHOST_USER_SET_LOG_FD is an optional message with an eventfd in ancillary data, it may be used to inform the master that the log has -- --Victor