From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 31F0421DFA7AF for ; Wed, 5 Apr 2017 03:16:23 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9B33C3D95E; Wed, 5 Apr 2017 10:16:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9B33C3D95E Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 9B33C3D95E Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-13.phx2.redhat.com [10.3.116.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8C712912AF; Wed, 5 Apr 2017 10:16:21 +0000 (UTC) To: Phil Dennis-Jordan , edk2-devel@lists.01.org References: <1491386280-50077-1-git-send-email-lists@philjordan.eu> <1491386280-50077-3-git-send-email-lists@philjordan.eu> Cc: Jordan Justen , Phil Dennis-Jordan From: Laszlo Ersek Message-ID: Date: Wed, 5 Apr 2017 12:16:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1491386280-50077-3-git-send-email-lists@philjordan.eu> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 05 Apr 2017 10:16:22 +0000 (UTC) Subject: Re: [PATCH v3 2/3] OvmfPkg/QemuVideoDxe: Helper functions for unaligned port I/O. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Apr 2017 10:16:23 -0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 04/05/17 11:57, Phil Dennis-Jordan wrote: > From: Phil Dennis-Jordan > > The VMWare SVGA display device implemented by Qemu (-vga vmware) uses > an I/O-type BAR which is laid out such that some register offsets are > not aligned to the read/write width with which they are expected to be > accessed. (The register value port has an offset of 1 and requires > 32 bit wide read/write access.) > > The EFI_PCI_IO_PROTOCOL's Io.Read/Io.Write functions do not support > such unaligned I/O. > > Before a driver for this device can be added to QemuVideoDxe, helper > functions for unaligned I/O are therefore required. This adds the > functions UnalignedIoWrite32 and UnalignedIoRead32, based on IoLib's > IoWrite32 and IoRead32, for the Ia32 and X64 architectures. Port I/O > requires inline assembly, so implementations are provided for the GCC, > ICC, and Microsoft compiler families. Such I/O is not possible on other > architectures, a dummy (ASSERT()ing) implementation is therefore > provided to satisfy the linker. > > Cc: Jordan Justen > Cc: Laszlo Ersek > Suggested-by: Jordan Justen > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Phil Dennis-Jordan > Reviewed-by: Laszlo Ersek > --- > > Notes: > v2: > - Separate commit for the unaligned I/O helper functions. [Laszlo] > - Dummy implementations return values despite ASSERT(). [Laszlo] > - Build failure in ArmVirtPkg fixed. [Laszlo] > - More consistent API docs and function ordering. > > v3: > - Fixed typos in commit message [Laszlo] > - Added Suggested-by: tag [Laszlo] > - Rewrapped comment lines to 79 chars [Laszlo] > - Corrected whitespace in function calls [Laszlo] > - EFIAPI dropped. [Laszlo] > - Fixed return value in dummy UnsignedIoWrite32 [Laszlo] > - Dropped "N" imm8 constraint in GCC inline asm [Laszlo] > > OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf | 6 ++ > OvmfPkg/QemuVideoDxe/UnalignedIoInternal.h | 59 +++++++++++++++ > OvmfPkg/QemuVideoDxe/UnalignedIoGcc.c | 70 +++++++++++++++++ > OvmfPkg/QemuVideoDxe/UnalignedIoIcc.c | 80 ++++++++++++++++++++ > OvmfPkg/QemuVideoDxe/UnalignedIoMsc.c | 78 +++++++++++++++++++ > OvmfPkg/QemuVideoDxe/UnalignedIoUnsupported.c | 66 ++++++++++++++++ > 6 files changed, 359 insertions(+) Looks good, thank you for the update. Laszlo