From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.120]) by mx.groups.io with SMTP id smtpd.web12.11031.1589459089046087971 for ; Thu, 14 May 2020 05:24:49 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ekmyOak9; spf=pass (domain: redhat.com, ip: 207.211.31.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589459088; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=V7IY4kwxn2vfQjeceFxxwsoeyKyD0UK67D9DC6+i8GM=; b=ekmyOak9vPbFSOkMMRpz+aDSuw4Q2NneJt5YG0zvpPd8/2pb+gQ+GgwclwMluP3f8g06kI gbLt7GGIcVjjSO0riA4Hv0iLw2BxLhuVy/vzGviFtsR5Uyv9qBOV098qScF3KHQzQzCual MdEZ/pTA03XwH4F1rcEZHeTb29Qb06k= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-277-JofRmSBfOgWRc0JXhd0o9Q-1; Thu, 14 May 2020 08:24:42 -0400 X-MC-Unique: JofRmSBfOgWRc0JXhd0o9Q-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8A8DF107ACF2; Thu, 14 May 2020 12:24:40 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-113-179.ams2.redhat.com [10.36.113.179]) by smtp.corp.redhat.com (Postfix) with ESMTP id A20435D9CA; Thu, 14 May 2020 12:24:38 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v2 09/11] ArmVirtPkg: Support for kvmtool emulated platform To: devel@edk2.groups.io, sami.mujawar@arm.com Cc: ard.biesheuvel@arm.com, leif@nuviainc.com, Alexandru.Elisei@arm.com, Andre.Przywara@arm.com, Matteo.Carlini@arm.com, Laura.Moretta@arm.com, nd@arm.com References: <20200514084019.71368-1-sami.mujawar@arm.com> <20200514084019.71368-10-sami.mujawar@arm.com> From: "Laszlo Ersek" Message-ID: <3404fea9-eaff-f9d4-3a39-fe69ad8596aa@redhat.com> Date: Thu, 14 May 2020 14:24:37 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200514084019.71368-10-sami.mujawar@arm.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 05/14/20 10:40, Sami Mujawar wrote: > Kvmtool is a virtual machine manager that enables hosting > KVM guests. Kvmtool emulates certain devices like serial > port, RTC, etc. essentially providing an emulated platform. > > This patch adds support for kvmtool emulated platform. > > Following is a brief description of the firmware > implementation choices: > > - Serial Port: 16550 UART > On some platforms the 16550 UART is interfaced using > PCI. Therefore, the 16550 Serial port library is > dependent on the PCI library. The 16550 UART driver > checks the Device ID represented using the PCD > gEfiMdeModulePkgTokenSpaceGuid.PcdSerialPciDeviceInfo > to determine if the UART is behind PCI. > If the Device ID is 0xFF then the serial 16550 UART > is not behind PCI. For such platforms a NULL > implementation of the PCI library has been provided > so that the serial output is available during the > early boot stages. > > On Kvmtool the Serial 16550 UART is not behind PCI, > and therefore makes use of PciLibNull library during > early boot stages. The DXE modules that make use of > PCI functionality explicitly include the library > BasePciLibPciExpress, so that the required PCI > functionality is available. > > The PcdSerialPciDeviceInfo is also set to 0xFF to > indicate that the Serial 16550 UART is not behind > PCI. The PCD PcdSerialUseMmio is also set to TRUE > to indicate MMIO accesses are required for the > UART registers. > > - Dependency order for Flash > FaultTolerantWriteDxe makes use of PCDs (e.g. > PcdFlashNvStorageFtwSpareBase64 etc.), which in > case of kvmtool will be evaluated based on the CFI > flash base address read from the DT. These variables > are populated in the NorFlashPlatformLib loaded by > ArmVeNorFlashDxe. > > This results in a dependency issue with > FaultTolerantWriteDxe. To resolve this make the > NorFlashPlatformLib as a library dependency for > FaultTolerantWriteDxe. > > Signed-off-by: Sami Mujawar > --- > > Notes: > v2: > - Updates to reflect review comments and support [Sami] > for latest features emulated by kvmtool e.g. CFI. > > v1: > - Add support for Kvmtool emulated platform [Sami] > - Add more justification for platform and [Laszlo] > document platform maintainer. > Ref: https://edk2.groups.io/g/devel/topic/30915279#30693 > > ArmVirtPkg/ArmVirtKvmTool.dsc | 408 ++++++++++++++++++++ > ArmVirtPkg/ArmVirtKvmTool.fdf | 276 +++++++++++++ > 2 files changed, 684 insertions(+) Acked-by: Laszlo Ersek