From patchwork Fri Jun 2 16:00:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 770469 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wfTkH6s4mz9s7B for ; Sat, 3 Jun 2017 02:12:07 +1000 (AEST) Received: from localhost ([::1]:50585 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGpBF-0008Os-Hd for incoming@patchwork.ozlabs.org; Fri, 02 Jun 2017 12:12:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51926) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGp0L-0006uq-6B for qemu-devel@nongnu.org; Fri, 02 Jun 2017 12:00:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGp0K-0000ni-7N for qemu-devel@nongnu.org; Fri, 02 Jun 2017 12:00:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48856) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dGp0J-0000n0-VG for qemu-devel@nongnu.org; Fri, 02 Jun 2017 12:00:48 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BCB527F6AC; Fri, 2 Jun 2017 16:00:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BCB527F6AC 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=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com BCB527F6AC Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-83.phx2.redhat.com [10.3.116.83]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8E5AD1711A; Fri, 2 Jun 2017 16:00:43 +0000 (UTC) From: Laszlo Ersek To: SeaBIOS@seabios.org, qemu-devel@nongnu.org, edk2-devel@lists.01.org Date: Fri, 2 Jun 2017 18:00:05 +0200 Message-Id: <20170602160006.1748-7-lersek@redhat.com> In-Reply-To: <20170602160006.1748-1-lersek@redhat.com> References: <20170602160006.1748-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 02 Jun 2017 16:00:47 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [qemu PATCH 6/7] hw/i386/acpi-build: ask the fw to alloc ACPI_BUILD_TPMLOG_FILE with 64bit/NOACPI X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Xiao Guangrong , Ben Warren , Ard Biesheuvel , "Michael S. Tsirkin" , Stefan Berger , Dongjiu Geng , Shannon Zhao , Igor Mammedov Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The "etc/tpm/log" fw_cfg blob is guaranteed not to contain ACPI tables, so turning off the ACPI SDT header probe in OVMF is the right thing to do. In addition, the address of the blob is patched into the "TCPA.log_area_start_address" field, which has type "uint64_t". Therefore we can change the allocation zone to 64-bit as well. SeaBIOS needs a patch for recognizing (and masking out) the BIOS_LINKER_LOADER_ALLOC_CONTENT_NOACPI bit, and also for handling BIOS_LINKER_LOADER_ALLOC_ZONE_64BIT the same as BIOS_LINKER_LOADER_ALLOC_ZONE_HIGH, but its allocation behavior will not change. Cc: "Michael S. Tsirkin" Cc: Ard Biesheuvel Cc: Ben Warren Cc: Dongjiu Geng Cc: Igor Mammedov Cc: Shannon Zhao Cc: Stefan Berger Cc: Xiao Guangrong Signed-off-by: Laszlo Ersek --- Notes: I don't know how to test this device, so I didn't. Help from the device's maintainer would be highly appreciated. Thanks. hw/i386/acpi-build.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 3c4c28c6c2ca..1ec008ec5003 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -2285,12 +2285,12 @@ build_tpm_tcpa(GArray *table_data, BIOSLinker *linker, GArray *tcpalog) tcpa->platform_class = cpu_to_le16(TPM_TCPA_ACPI_CLASS_CLIENT); tcpa->log_area_minimum_length = cpu_to_le32(TPM_LOG_AREA_MINIMUM_SIZE); acpi_data_push(tcpalog, le32_to_cpu(tcpa->log_area_minimum_length)); bios_linker_loader_alloc(linker, ACPI_BUILD_TPMLOG_FILE, tcpalog, 1, - BIOS_LINKER_LOADER_ALLOC_ZONE_HIGH, - BIOS_LINKER_LOADER_ALLOC_CONTENT_MIXED); + BIOS_LINKER_LOADER_ALLOC_ZONE_64BIT, + BIOS_LINKER_LOADER_ALLOC_CONTENT_NOACPI); /* log area start address to be filled by Guest linker */ bios_linker_loader_add_pointer(linker, ACPI_BUILD_TABLE_FILE, log_addr_offset, log_addr_size, ACPI_BUILD_TPMLOG_FILE, 0);