From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1cuKtK-0001ei-4y for mharc-grub-devel@gnu.org; Sat, 01 Apr 2017 11:24:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56854) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cuKtH-0001eZ-8M for grub-devel@gnu.org; Sat, 01 Apr 2017 11:24:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cuKtE-0003mN-2y for grub-devel@gnu.org; Sat, 01 Apr 2017 11:24:35 -0400 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]:33582) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cuKtD-0003kn-QP for grub-devel@gnu.org; Sat, 01 Apr 2017 11:24:32 -0400 Received: by mail-lf0-x243.google.com with SMTP id r36so9657075lfi.0 for ; Sat, 01 Apr 2017 08:24:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Q/C8qftl0PW2OyMnVV7vemP5ZYRblzXY8pCGBGvzeDo=; b=Njbu8rFt30gDQZphfzS7NfA+r5Rx1DS3Z81OT0k6PQLCp4l1FaSQ3zaTdIf1qYbSST otHanAF/UJKFCqUZhT7Mac5PivBCDC7pdyvOb22wcQf2dsBbjB6uzxfuxo1ZLI2j0pGR tMX72XEgEAajC/izR9WZzO41/r8zMzI4pWZk7EPdHI6NFH33gLN7c7t9k6IOpw9LOSv1 l9gQphhQIdvvLWqoFnLhhl3vkYtB84mKdWiC/FIUYnYA7Y4isGzjrgXmy4ds46OgLPrJ 83MUPWD/z8b4Xq0QafeFZTz4RKUA/lSaoBN+8wFgeZs8j36I52pgt4FTPKzt0frje+Aq Emrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Q/C8qftl0PW2OyMnVV7vemP5ZYRblzXY8pCGBGvzeDo=; b=Gkgp4X+Gm25SBLANIwgoi8vX/Loz7Q0NSskR+Ot7SxHzgo9o+XN3JzCNaAs8ZVtVXl nnqENJb4Ik/CuThPTO7ZV+UoLRW/tQebPiki84PusptyapLbb53NS4GZ5XtijUdNyzla l4u6sR/uae4rnqMzkA8q+s7xQ0eyOORj+7YGMBga4loTkOAU4EzqHMGg4o+OA3U6hhYV xZT7gGaj3pLXe+wP9hfDjQLdk/l7SUJ80dFgMrJxYoJFXgbD5csmAJ2xmWym76Ii7oYf jw4pw0+y+gS0GZRwo2Hw8pcZY858O0N/QtQqhzrscU98JZCdVBgM/B1AwMLfTNsH6OsF Pziw== X-Gm-Message-State: AFeK/H0bIiIK34kugvU0PDDVjb5lLzktqZtX/FQADO2hRIKQg3tllguv8ezLNEk6chtLgw== X-Received: by 10.25.18.95 with SMTP id h92mr2360972lfi.63.1491060270361; Sat, 01 Apr 2017 08:24:30 -0700 (PDT) Received: from localhost.localdomain (ppp109-252-90-38.pppoe.spdop.ru. [109.252.90.38]) by smtp.gmail.com with ESMTPSA id c28sm1556060lfh.49.2017.04.01.08.24.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 01 Apr 2017 08:24:29 -0700 (PDT) From: Andrei Borzenkov To: grub-devel@gnu.org Cc: Nando Eva , Vladimir 'phcoder' Serbinenko Subject: [PATCH] acpi: add missing efi_call wrapper to acpi command Date: Sat, 1 Apr 2017 18:24:19 +0300 Message-Id: <1491060259-3112-1-git-send-email-arvidjaar@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::243 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 15:24:36 -0000 Fixed loading of ACPI tables on EFI (side effect was apparent memory corruption ranging from unpredictable behavior to system reset). Reported by Nando Eva --- @Nando: please test this patch. It fixed loading for me at least on QEMU/OVMF. It conflicts with lsacpi patch, but you can actually verify that RSDP was updated by using "lsefisystab" in grub. @Vladimir: this looks like 2.02 material as it was obviously wrong. It does not fix weird behavior on physical system (loss of partitions afetr loading table using "acpi"); unfortunately, I cannot reproduce it in QEMU which makes it rather hard to debug. This smells like yet another meory corruption. Also our ACPI table mangling code is not clean (e.g. Linux reports FACS two times). Note that ACPI says normal and extended addresses (i.e. DSDT/XDSDT and FACS/XFACS) are mutually exclusive, while we set both to non-zero. This strictly speaking violates specs. grub-core/commands/acpi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/grub-core/commands/acpi.c b/grub-core/commands/acpi.c index b5c2f27..9f02f22 100644 --- a/grub-core/commands/acpi.c +++ b/grub-core/commands/acpi.c @@ -761,10 +761,10 @@ grub_cmd_acpi (struct grub_extcmd_context *ctxt, int argc, char **args) struct grub_efi_guid acpi = GRUB_EFI_ACPI_TABLE_GUID; struct grub_efi_guid acpi20 = GRUB_EFI_ACPI_20_TABLE_GUID; - grub_efi_system_table->boot_services->install_configuration_table - (&acpi20, grub_acpi_get_rsdpv2 ()); - grub_efi_system_table->boot_services->install_configuration_table - (&acpi, grub_acpi_get_rsdpv1 ()); + efi_call_2 (grub_efi_system_table->boot_services->install_configuration_table, + &acpi20, grub_acpi_get_rsdpv2 ()); + efi_call_2 (grub_efi_system_table->boot_services->install_configuration_table, + &acpi, grub_acpi_get_rsdpv1 ()); } #endif -- tg: (8014b7b..) u/acpi-efi_call (depends on: master)