From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-x242.google.com (mail-pg0-x242.google.com [IPv6:2607:f8b0:400e:c05::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B8C1D21DFA901 for ; Thu, 30 Mar 2017 03:41:07 -0700 (PDT) Received: by mail-pg0-x242.google.com with SMTP id o123so9069372pga.1 for ; Thu, 30 Mar 2017 03:41:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philjordan-eu.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=hBgMBx3AacQszcD0t7E0f9pw3eRQJ9P1DINWf/HMQUM=; b=yoYiUGcyLdTLI70kfyGDmPHcAnCeHWbeB1Be/PkmmY0whAPIPAvueKMar6UDW/zdyz BX0Z0lU3RPKBeErPj1rnyVwuEhfH4tgNL0QrqRZ7cqCaVbtzYTdZ02VM6Uz7tQ6ClGO9 /bCp8SkkQ0+9Rcv+awJSdzSYYyjSn8FtbJwIFiNiV9i8c9jHVJ8Py558QwAMV++f3vC2 rKKHtu77/gcUoCaQgGcGM1W/ilg9OHSLwWz6pRr6L50JUdupS0s5dk44pAAZzO2orbHM ffmizZhykgdwySqwV8kCYirHlMErwADK1m03SyOPsZOIsSPc4E9ZAEtqVt3PlXVsF7ze sF5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=hBgMBx3AacQszcD0t7E0f9pw3eRQJ9P1DINWf/HMQUM=; b=YIfaDJZASi8NU2QTLC9aWfY5G3KaPSlLSlyYEV58sW4em/fA3j33IDbndVXk9ZgXK+ vePWgOjffv1Yu2dlu60KoZitzqRMb1pV+qQdbzEQ818EH732Nw26rXWjD9Qb4HNoyErA qpeCUcYkNc54OtBjbf647O8A/bfNiFjhGUWOrVYUpHoLSVsDRqq6ql0QGJKVuIdAKwOb i9sFBJFlOqEMU2WwQKUpdVGaxtRUHMerefPpj8/jBz7przRBbSPFT15Naf4Wte7NFWUz ZqyiAiaWRSm+ripPAYZPYRY7X5WyZUr47q6QiSYGClE+S18NXbfvPpgsIHbiWw/KITUz Tx4A== X-Gm-Message-State: AFeK/H1bc5NShSp+aKlT7EDqeQiMT3A449OrLCxtY0SK6Dc2cpPtCFCYXArQyb5x2jpDFA== X-Received: by 10.84.228.194 with SMTP id y2mr6183073pli.85.1490870467199; Thu, 30 Mar 2017 03:41:07 -0700 (PDT) Received: from localhost.localdomain ([118.82.182.58]) by smtp.gmail.com with ESMTPSA id t187sm3691181pfb.116.2017.03.30.03.41.05 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 30 Mar 2017 03:41:06 -0700 (PDT) From: Phil Dennis-Jordan To: edk2-devel@lists.01.org Date: Thu, 30 Mar 2017 23:40:56 +1300 Message-Id: <1490870457-27859-1-git-send-email-lists@philjordan.eu> X-Mailer: git-send-email 2.3.2 (Apple Git-55) Subject: [PATCH v2 0/1] OvmfPkg/AcpiPlatformDxe: Fix bug 368, multiply pointed-to tables 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: Thu, 30 Mar 2017 10:41:07 -0000 This fixes the bug in OVMF's Qemu ACPI table linker which caused it to fail or misbehave when multiple fields point to the same table. Previously, each pointer caused the pointed-to table to be installed via the EFI_ACPI_TABLE_PROTOCOL. However, each table must only be installed once via this mechanism. The patch fixes this (as previously suggested by Laszlo) via memoisation of the pointers. If it encounters the same pointer twice, it will no longer try to process it again. I've tested it successfully with Windows 10, a recent Ubuntu version, and OS X as guest OSes. (further OVMF patches required for booting the latter) I found this bug while trying to patch Qemu to generate a Rev3 FADT (as per ACPI 2.0) instead of a Rev1 FADT (ACPI 1.0). Said patch has missed the Qemu 2.9 merge window, but has been provisionally accepted for 2.10 (save for some minor tweaks) and will break the ACPI table linker on unpatched OVMF. (When this bug is triggered, OVMF reverts to its built-in ACPI tables, ignoring those provided by Qemu.) v1 -> v2 - The only functional change is that the memoisation happens earlier in the processing of QEMU_LOADER_ADD_POINTER commands; right at the start, not immediately before installing the table. [Laszlo] - Other changes are documentation/naming/style. (see patch 1/1) [Laszlo] Previous discussion: https://lists.gnu.org/archive/html/qemu-devel/2017-01/msg06679.html Qemu patch: https://lists.gnu.org/archive/html/qemu-devel/2017-03/msg02837.html Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=368 Github feature branch: https://github.com/pmj/edk2/tree/bug_368_v2 Phil Dennis-Jordan (1): OvmfPkg: Allow multiple add-pointer linker commands to same ACPI table OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c | 109 ++++++++++++++++++-- 1 file changed, 98 insertions(+), 11 deletions(-) -- 2.3.2 (Apple Git-55)