use xsdt_addr if present
Signed-off-by: Qiumiao Zhang <zhangqiumiao1@huawei.com>
This commit is contained in:
parent
843d18da47
commit
2252eb370e
38
backport-commands-acpi-Use-xsdt_addr-if-present.patch
Normal file
38
backport-commands-acpi-Use-xsdt_addr-if-present.patch
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
From b2b477e6b23a207321e2f9d7fde1a1624ef318dc Mon Sep 17 00:00:00 2001
|
||||||
|
From: Qiumiao Zhang <zhangqiumiao1@huawei.com>
|
||||||
|
Date: Tue, 13 Jun 2023 11:17:36 +0800
|
||||||
|
Subject: [PATCH] commands/acpi: Use xsdt_addr if present
|
||||||
|
|
||||||
|
According to the ACPI specification, in ACPI 2.0 or later, an
|
||||||
|
ACPI-compatible OS must use the XSDT if present. So, we should
|
||||||
|
use xsdt_addr instead of rsdt_addr if xsdt_addr is valid.
|
||||||
|
|
||||||
|
Reference:https://git.savannah.gnu.org/cgit/grub.git/commit/?id=b2b477e6b23a207321e2f9d7fde1a1624ef318dc
|
||||||
|
Conflict:NA
|
||||||
|
|
||||||
|
Signed-off-by: Qiumiao Zhang <zhangqiumiao1@huawei.com>
|
||||||
|
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||||
|
---
|
||||||
|
grub-core/commands/acpi.c | 6 +++++-
|
||||||
|
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/grub-core/commands/acpi.c b/grub-core/commands/acpi.c
|
||||||
|
index deec4bb43..1c034463c 100644
|
||||||
|
--- a/grub-core/commands/acpi.c
|
||||||
|
+++ b/grub-core/commands/acpi.c
|
||||||
|
@@ -514,7 +514,11 @@ grub_cmd_acpi (struct grub_extcmd_context *ctxt, int argc, char **args)
|
||||||
|
/* Set revision variables to replicate the same version as host. */
|
||||||
|
rev1 = ! rsdp->revision;
|
||||||
|
rev2 = rsdp->revision;
|
||||||
|
- rsdt = (struct grub_acpi_table_header *) (grub_addr_t) rsdp->rsdt_addr;
|
||||||
|
+ if (rev2 && ((struct grub_acpi_table_header *) (grub_addr_t) ((struct grub_acpi_rsdp_v20 *) rsdp)->xsdt_addr) != NULL)
|
||||||
|
+ rsdt = (struct grub_acpi_table_header *) (grub_addr_t) ((struct grub_acpi_rsdp_v20 *) rsdp)->xsdt_addr;
|
||||||
|
+ else
|
||||||
|
+ rsdt = (struct grub_acpi_table_header *) (grub_addr_t) rsdp->rsdt_addr;
|
||||||
|
+
|
||||||
|
/* Load host tables. */
|
||||||
|
for (entry_ptr = (grub_uint32_t *) (rsdt + 1);
|
||||||
|
entry_ptr < (grub_uint32_t *) (((grub_uint8_t *) rsdt)
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
50
backport-kern-acpi-Use-xsdt_addr-if-present.patch
Normal file
50
backport-kern-acpi-Use-xsdt_addr-if-present.patch
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
From 4fb58cf0afe83d921e1072d58a4f899696d8fe7e Mon Sep 17 00:00:00 2001
|
||||||
|
From: Qiumiao Zhang <zhangqiumiao1@huawei.com>
|
||||||
|
Date: Tue, 13 Jun 2023 11:20:51 +0800
|
||||||
|
Subject: [PATCH] kern/acpi: Use xsdt_addr if present
|
||||||
|
|
||||||
|
According to the ACPI specification, in ACPI 2.0 or later, an
|
||||||
|
ACPI-compatible OS must use the XSDT if present. So, we should
|
||||||
|
use xsdt_addr instead of rsdt_addr if xsdt_addr is valid.
|
||||||
|
|
||||||
|
Reference:https://git.savannah.gnu.org/cgit/grub.git/commit/?id=4fb58cf0afe83d921e1072d58a4f899696d8fe7e
|
||||||
|
Conflict:NA
|
||||||
|
|
||||||
|
Signed-off-by: Qiumiao Zhang <zhangqiumiao1@huawei.com>
|
||||||
|
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||||||
|
---
|
||||||
|
grub-core/kern/acpi.c | 12 ++++++------
|
||||||
|
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/grub-core/kern/acpi.c b/grub-core/kern/acpi.c
|
||||||
|
index 5746ac0..524c402 100644
|
||||||
|
--- a/grub-core/kern/acpi.c
|
||||||
|
+++ b/grub-core/kern/acpi.c
|
||||||
|
@@ -99,12 +99,6 @@ grub_acpi_find_fadt (void)
|
||||||
|
if (fadt)
|
||||||
|
return fadt;
|
||||||
|
rsdpv2 = grub_machine_acpi_get_rsdpv2 ();
|
||||||
|
- if (rsdpv2)
|
||||||
|
- fadt = grub_acpi_rsdt_find_table ((struct grub_acpi_table_header *)
|
||||||
|
- (grub_addr_t) rsdpv2->rsdpv1.rsdt_addr,
|
||||||
|
- GRUB_ACPI_FADT_SIGNATURE);
|
||||||
|
- if (fadt)
|
||||||
|
- return fadt;
|
||||||
|
if (rsdpv2
|
||||||
|
#if GRUB_CPU_SIZEOF_VOID_P != 8
|
||||||
|
&& !(rsdpv2->xsdt_addr >> 32)
|
||||||
|
@@ -115,5 +109,11 @@ grub_acpi_find_fadt (void)
|
||||||
|
GRUB_ACPI_FADT_SIGNATURE);
|
||||||
|
if (fadt)
|
||||||
|
return fadt;
|
||||||
|
+ if (rsdpv2)
|
||||||
|
+ fadt = grub_acpi_rsdt_find_table ((struct grub_acpi_table_header *)
|
||||||
|
+ (grub_addr_t) rsdpv2->rsdpv1.rsdt_addr,
|
||||||
|
+ GRUB_ACPI_FADT_SIGNATURE);
|
||||||
|
+ if (fadt)
|
||||||
|
+ return fadt;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
@ -328,3 +328,5 @@ Patch0320: backport-net-bootp-Fix-unchecked-return-value.patch
|
|||||||
Patch0321: backport-osdep-linux-hostdisk-Modify-sector-by-sysfs-as-disk-sector.patch
|
Patch0321: backport-osdep-linux-hostdisk-Modify-sector-by-sysfs-as-disk-sector.patch
|
||||||
Patch0322: backport-Read-etc-default-grub.d-.cfg-after-etc-default-grub.patch
|
Patch0322: backport-Read-etc-default-grub.d-.cfg-after-etc-default-grub.patch
|
||||||
Patch0323: Revert-EFI-allocate-kernel-in-EFI_RUNTIME_SERVICES_C.patch
|
Patch0323: Revert-EFI-allocate-kernel-in-EFI_RUNTIME_SERVICES_C.patch
|
||||||
|
Patch0324: backport-commands-acpi-Use-xsdt_addr-if-present.patch
|
||||||
|
Patch0325: backport-kern-acpi-Use-xsdt_addr-if-present.patch
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
Name: grub2
|
Name: grub2
|
||||||
Epoch: 1
|
Epoch: 1
|
||||||
Version: 2.06
|
Version: 2.06
|
||||||
Release: 30
|
Release: 31
|
||||||
Summary: Bootloader with support for Linux, Multiboot and more
|
Summary: Bootloader with support for Linux, Multiboot and more
|
||||||
License: GPLv3+
|
License: GPLv3+
|
||||||
URL: http://www.gnu.org/software/grub/
|
URL: http://www.gnu.org/software/grub/
|
||||||
@ -440,6 +440,13 @@ fi
|
|||||||
%{_datadir}/man/man*
|
%{_datadir}/man/man*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Jul 3 2023 zhangqiumiao <zhangqiumiao1@huawei.com> - 1:2.06-31
|
||||||
|
- Type:bugfix
|
||||||
|
- CVE:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC:kern/acpi: Use xsdt_addr if present
|
||||||
|
commands/acpi: Use xsdt_addrifpresent
|
||||||
|
|
||||||
* Thu Jun 15 2023 zhangqiumiao <zhangqiumiao1@huawei.com> - 1:2.06-30
|
* Thu Jun 15 2023 zhangqiumiao <zhangqiumiao1@huawei.com> - 1:2.06-30
|
||||||
- Type:bugfix
|
- Type:bugfix
|
||||||
- CVE:NA
|
- CVE:NA
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user