From 2c9ec833e39d1a4f8646ae17b915a3124283f300 Mon Sep 17 00:00:00 2001 From: Muhammad Rais Fathin Mudzakir Date: Wed, 22 Jun 2016 12:58:37 +1000 Subject: [PATCH 1/2] Refactor and fix a bug in find_RSDP method in HAL Fixes a bug where if one RSDP finding method fails it does not attempt to use the others --- source/tool/chipsec/hal/acpi.py | 111 +++++++++++++++++++------------- 1 file changed, 68 insertions(+), 43 deletions(-) diff --git a/source/tool/chipsec/hal/acpi.py b/source/tool/chipsec/hal/acpi.py index b96b5b55..6921b9c6 100644 --- a/source/tool/chipsec/hal/acpi.py +++ b/source/tool/chipsec/hal/acpi.py @@ -221,16 +221,13 @@ class ACPI: rsdp_buf = self.cs.mem.read_physical_mem( rsdp_pa, ACPI_RSDP_EXT_SIZE) rsdp = RSDP(rsdp_buf) return rsdp - + # - # Searches for Root System Description Pointer (RSDP) in various locations for legacy/EFI systems + # Check RSDP in Extended BIOS Data Area # - def find_RSDP( self ): - rsdp_pa = None - rsdp = None - # - # Check RSDP in Extended BIOS Data Area first - # + def _find_RSDP_in_EBDA(self): + rsdp_pa = None + rsdp = None if logger().HAL: logger().log( "[acpi] searching RSDP in EBDA.." ) ebda_ptr_addr = 0x40E ebda_addr = struct.unpack(' Date: Wed, 22 Jun 2016 14:44:20 +1000 Subject: [PATCH 2/2] Update tests to test for known bug in "find_RSDP" --- source/tool/tests/software/test_util.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/tool/tests/software/test_util.py b/source/tool/tests/software/test_util.py index 22b444e1..ea4f2936 100644 --- a/source/tool/tests/software/test_util.py +++ b/source/tool/tests/software/test_util.py @@ -120,8 +120,14 @@ class TestChipsecUtil(unittest.TestCase): "CRRV" + # Creator Revision struct.pack("> 4) + elif pa_lo >= self.EBDA_ADDRESS and pa_lo < 0xA0000: + return "\xFF" * length + elif pa_lo == 0xE0000: return self.RSDP_DESCRIPTOR[:length] elif pa_lo == 0x200: return self.RSDT_DESCRIPTOR[:length]