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 3AE06209589C9 for ; Wed, 9 Aug 2017 15:11:45 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3EAC710C288; Wed, 9 Aug 2017 22:14:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3EAC710C288 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=lersek@redhat.com Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-102.phx2.redhat.com [10.3.116.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id EBAFD5D6A2; Wed, 9 Aug 2017 22:13:58 +0000 (UTC) To: Rebecca Cran References: <34458438-9913-6bab-0ddb-e2908ddd006a@bluestop.org> From: Laszlo Ersek Cc: edk2-devel@lists.01.org, "Michael S. Tsirkin" , Igor Mammedov , qemu devel list Message-ID: Date: Thu, 10 Aug 2017 00:13:57 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <34458438-9913-6bab-0ddb-e2908ddd006a@bluestop.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 09 Aug 2017 22:14:03 +0000 (UTC) Subject: Re: OvmfPkg (PlatformPei?): supporting Qemu's nvdimm device 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, 09 Aug 2017 22:11:45 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 08/09/17 22:47, Rebecca Cran wrote: > I've been investigating adding support for Qemu's nvdimm devices to > OVMF. I was thinking such support would go into PlatformPei, but it > looks like I can only read the ACPI NFIT in the DXE phase. So, should > Qemu be changed to add non-volatile memory to the e820 table, or > should such memory be added during the DXE phase instead? I don't have the slightest idea, sorry. One thing that does look bad is that both edk2's MdeModulePkg/Universal/Disk/RamDiskDxe and QEMU's hw/acpi/nvdimm.c think they own the NVDIMM root device with, with _HID=ACPI0012. I don't recall being consulted when QEMU's NVDIMM stuff was designed and implemented, despite the fact that it uses the ACPI linker/loader (apparently). In general, using the ACPI linker/loader is a good recipe for making an ACPI-defined feature "just work" under both SeaBIOS and OVMF, without having to resort to specialized information channels such as new fw_cfg files, or additional paravirt hardware. However, there are enough quirks in edk2 / UEFI with regard to ACPI that, without special attention to OVMF / edk2 at design time, things will likely break due to infighting over ACPI ownership. In RamDiskPublishNfit(), there is // // Assumption is made that if no NFIT is in the ACPI table, there is no // NVDIMM root device in the \SB scope. // Therefore, a NVDIMM root device will be reported via Secondary System // Description Table (SSDT). // Status = RamDiskPublishSsdt (); That assumption might or might not be good enough, when QEMU pushes down its NVDIMM / NFIT stuff. I suggest reading "docs/specs/acpi_nvdimm.txt" in the QEMU tree, and figuring out if that can work with OVMF's ACPI linker/loader client, and the rest of the edk2 modules. The assumption could also be affected by whether OvmfPkg/AcpiTableDxe installs QEMU's NVDIM stuff before or after RamDiskDxe does its thing. I have no clue. I apologize but I don't think I can help (or even find the bandwidth to research or discuss this -- it's 00:13 local time and I'm reviewing patches...) I'm CC'ing Michael and Igor, maybe they can provide you with pointers. (Also adding qemu-devel.) Thanks Laszlo