From patchwork Tue Jan 28 16:28:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 23802 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f198.google.com (mail-ve0-f198.google.com [209.85.128.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7C473202FA for ; Tue, 28 Jan 2014 16:28:48 +0000 (UTC) Received: by mail-ve0-f198.google.com with SMTP id pa12sf1341248veb.9 for ; Tue, 28 Jan 2014 08:28:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=HvJ0fJTzjOs95KTh73BY/HrZCxXPzsiqVkRLy30q5DA=; b=EoywEIYZTok0GRhSbUKidCwNZqG8tP0C2xsINx5tJoEKUHHUaxSVCSavJbETPugULO 5qOgmAW7VZjcixl+Kk6dGCdSQPdZZQbgqLJBygFrw0JOgeN81L94cJws5zbVXRAqYJr3 iDlWLuxR2bBzKamjWrOWYB12zc4PaZImEv/ze83PpjWWvDXrGRLZYzyL9DBO8z2lGK1C 6F2PaiaFDyMM1L7NSUODVr23GJrRUQz4kDJNLyvjBjvRYQ6MHpjWE5PGztLeqCCu0gCo KDFKPhNt/2EYJLZhZ3NjP/DC1pkz6I8j+N1fSRx8yJs1ddRyAT0f6xVl+dRXmWau0xbm smtA== X-Gm-Message-State: ALoCoQkYJwYHnl1ccdYHE/1zziEX0XE1okh/bQmSHYljbW6ihrxaudEV2Niry8BdhGa9BgCB99wD X-Received: by 10.236.121.4 with SMTP id q4mr787436yhh.34.1390926527515; Tue, 28 Jan 2014 08:28:47 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.103.118 with SMTP id x109ls2073228qge.43.gmail; Tue, 28 Jan 2014 08:28:47 -0800 (PST) X-Received: by 10.220.98.143 with SMTP id q15mr78686vcn.38.1390926527409; Tue, 28 Jan 2014 08:28:47 -0800 (PST) Received: from mail-vb0-f54.google.com (mail-vb0-f54.google.com [209.85.212.54]) by mx.google.com with ESMTPS id tt2si785943vdc.48.2014.01.28.08.28.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 28 Jan 2014 08:28:47 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.54 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.54; Received: by mail-vb0-f54.google.com with SMTP id w20so395313vbb.27 for ; Tue, 28 Jan 2014 08:28:47 -0800 (PST) X-Received: by 10.58.94.195 with SMTP id de3mr77698veb.39.1390926527321; Tue, 28 Jan 2014 08:28:47 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp43606vcz; Tue, 28 Jan 2014 08:28:46 -0800 (PST) X-Received: by 10.68.201.226 with SMTP id kd2mr2337796pbc.157.1390926525972; Tue, 28 Jan 2014 08:28:45 -0800 (PST) Received: from mail-pd0-f169.google.com (mail-pd0-f169.google.com [209.85.192.169]) by mx.google.com with ESMTPS id r7si15971867pbk.267.2014.01.28.08.28.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 28 Jan 2014 08:28:45 -0800 (PST) Received-SPF: neutral (google.com: 209.85.192.169 is neither permitted nor denied by best guess record for domain of christoffer.dall@linaro.org) client-ip=209.85.192.169; Received: by mail-pd0-f169.google.com with SMTP id v10so542546pde.28 for ; Tue, 28 Jan 2014 08:28:45 -0800 (PST) X-Received: by 10.68.198.68 with SMTP id ja4mr2553040pbc.24.1390926525497; Tue, 28 Jan 2014 08:28:45 -0800 (PST) Received: from localhost.localdomain (c-67-169-181-221.hsd1.ca.comcast.net. [67.169.181.221]) by mx.google.com with ESMTPSA id zc5sm43967656pbc.41.2014.01.28.08.28.43 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 28 Jan 2014 08:28:44 -0800 (PST) From: Christoffer Dall To: kvm@vger.kernel.org Cc: kvm-ppc@vger.kernel.org, kvmarm@lists.cs.columbia.edu, patches@linaro.org, Christoffer Dall , Marc Zyngier , Peter Maydell , Alexander Graf Subject: [PATCH v3] KVM: Specify byte order for KVM_EXIT_MMIO Date: Tue, 28 Jan 2014 08:28:42 -0800 Message-Id: <1390926522-18267-1-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 1.8.5.2 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: christoffer.dall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.54 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The KVM API documentation is not clear about the semantics of the data field on the mmio struct on the kvm_run struct. This has become problematic when supporting ARM guests on big-endian host systems with guests of both endianness types, because it is unclear how the data should be exported to user space. This should not break with existing implementations as all supported existing implementations of known user space applications (QEMU and kvmtools for virtio) only support default endianness of the architectures on the host side. Cc: Marc Zyngier Cc: Peter Maydell Cc: Alexander Graf Signed-off-by: Christoffer Dall Acked-by: Marc Zyngier --- Changes [v2 - v3]: - Change the semantics and wordings as per Scott's, Avi's, and Ben's suggestions. Changes [v1 - v2]: - s/host kernel should/host user space should/ Documentation/virtual/kvm/api.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index 366bf4b..e11f09d 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual/kvm/api.txt @@ -2565,6 +2565,10 @@ executed a memory-mapped I/O instruction which could not be satisfied by kvm. The 'data' member contains the written data if 'is_write' is true, and should be filled by application code otherwise. +The 'data' member contains, in its first 'len' bytes, the value as it would +appear if the VCPU performed a load or store of the appropriate width directly +to the byte array. + NOTE: For KVM_EXIT_IO, KVM_EXIT_MMIO, KVM_EXIT_OSI, KVM_EXIT_DCR, KVM_EXIT_PAPR and KVM_EXIT_EPR the corresponding operations are complete (and guest state is consistent) only after userspace