grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: Andrei Borzenkov <arvidjaar@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: [PATCH] acpi: do not attempt to create EBDA on EFI (was: Loading DSDT table using 'acpi' or some memory write command?)
Date: Tue, 4 Apr 2017 21:18:04 +0300	[thread overview]
Message-ID: <b11a23ba-57b2-6095-d4e1-1126f9f4e065@gmail.com> (raw)
In-Reply-To: <d042fbf2-a614-a405-815b-73c7fe37af28@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 321 bytes --]

01.04.2017 12:09, Andrei Borzenkov пишет:
> 
> I also have rather weird issue that after "acpi dsdt.aml" I lose
> partitions (only hard disk itself is visible). This is on real hardware
> (Dell Latitude E5450).
> 
> 

Anyone knows why we attempt to write to some arbitrary memory location
on EFI in the first place?

[-- Attachment #2: acpi-no-ebda-on-efi.patch --]
[-- Type: text/x-patch, Size: 1170 bytes --]

From: Andrei Borzenkov <arvidjaar@gmail.com>
Subject: [PATCH] acpi: do not attempt to create EBDA on EFI

There is no gurantee that BDA or EBDA on EFI exists; blindly writing
into memory will likely corrupt it. This fixed problem on Dell Latitude
E5450, where after loading ACPI table GRUB "lost" all disk partitions.

---
 grub-core/commands/acpi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/grub-core/commands/acpi.c b/grub-core/commands/acpi.c
index 9f02f22..a395d74 100644
--- a/grub-core/commands/acpi.c
+++ b/grub-core/commands/acpi.c
@@ -119,7 +119,7 @@ grub_acpi_get_rsdpv1 (void)
   return grub_machine_acpi_get_rsdpv1 ();
 }
 
-#if defined (__i386__) || defined (__x86_64__)
+#if defined (__i386__) && !defined (GRUB_MACHINE_EFI)
 
 static inline int
 iszero (grub_uint8_t *reg, int size)
@@ -741,7 +741,7 @@ grub_cmd_acpi (struct grub_extcmd_context *ctxt, int argc, char **args)
     }
   acpi_tables = 0;
 
-#if defined (__i386__) || defined (__x86_64__)
+#if defined (__i386__) && !defined (GRUB_MACHINE_EFI)
   if (! state[9].set)
     {
       grub_err_t err;
-- 
tg: (007f0b4..) u/acpi-skip-ebda-on-efi (depends on: master)

      parent reply	other threads:[~2017-04-04 18:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1736729449.4676062.1487865639993.ref@mail.yahoo.com>
2017-02-23 16:00 ` Loading DSDT table using 'acpi' or some memory write command? Nando Eva
2017-02-24 16:32   ` Andrei Borzenkov
2017-02-27 11:29   ` Nando Eva
2017-02-27 13:42     ` Andrei Borzenkov
2017-02-27 15:13       ` Vladimir 'phcoder' Serbinenko
2017-02-27 15:31         ` Vladimir 'phcoder' Serbinenko
2017-02-27 15:13     ` Nando Eva
2017-02-27 18:21       ` Nando Eva
2017-03-27 14:12         ` Nando Eva
2017-03-27 16:55           ` Andrei Borzenkov
2017-03-29 17:45           ` Nando Eva
2017-03-30  4:03             ` Andrei Borzenkov
2017-04-01  9:09             ` Andrei Borzenkov
2017-04-01 15:24               ` [PATCH] acpi: add missing efi_call wrapper to acpi command Andrei Borzenkov
2017-04-02  8:27                 ` Vladimir 'phcoder' Serbinenko
2017-04-04 18:18               ` Andrei Borzenkov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b11a23ba-57b2-6095-d4e1-1126f9f4e065@gmail.com \
    --to=arvidjaar@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).