1945 Commits

Author SHA1 Message Date
Nathaniel Mitchell 7066ad538f Update to 1.12.2
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
1.12.2
2023-09-08 15:23:27 -07:00
Frinzell, Aaron a498374f40 Add PEP 632 comments to manual
Signed-off-by: Frinzell, Aaron <aaron.frinzell@intel.com>
2023-09-08 15:08:15 -07:00
Nathaniel Mitchell 3c35aee789 Update bus matching check in _process_pci_dev
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-09-07 16:48:55 -07:00
Nicolas Iooss 6dea5995d5 Use the right dictionnary in handle_ima
`CoreConfig.handle_ima` was adding entries to `cfg.IO_BARS` instead of
`cfg.IMA_REGISTERS`. Moreover `Chipset.get_register_def` uses
`IMA_REGISTERS` when looking for registers with type `"indirect"`, which
confirms there was a bug.

Signed-off-by: Nicolas Iooss <nicolas.iooss_git@polytechnique.org>
2023-09-06 16:38:07 -07:00
Nicolas Iooss 9a0f04e2a1 Import modules traceback and errno when they are needed
When loading the kernel module fails on Linux, `chipsec_util.py`
raises an error in

    logger().log_debug(traceback.format_exc())

because `traceback` was not imported.

Fix this issue by importing the missing modules `traceback` and `errno`.
While at it, import `traceback` too in other files where it was missing.

Signed-off-by: Nicolas Iooss <nicolas.iooss_git@polytechnique.org>
2023-09-06 16:37:59 -07:00
Nathaniel Mitchell 41e363cd3c Fix issues when loading configs
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-09-05 16:36:35 -07:00
Nicolas Iooss 116e82319f Fix error message format in add_extra_configs
Method `add_extra_configs` used `config_path.xml_file` to format a
message when an error occurs, but `config_path` is a string.

Use the variable directly in the error message.

Signed-off-by: Nicolas Iooss <nicolas.iooss_git@polytechnique.org>
2023-09-05 16:36:22 -07:00
Nathaniel Mitchell 2b531e676c Update to 1.12.1
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
1.12.1
2023-08-30 15:18:08 -07:00
Nathaniel Mitchell 810502ced8 Update docs to reflect recent cfg/helper changes
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-08-30 10:44:38 -07:00
Frinzell, Aaron cfd2996c32 Move string_library.py to strings.py
Signed-off-by: Frinzell, Aaron <aaron.frinzell@intel.com>
2023-08-30 10:29:50 -07:00
Frinzell, Aaron 1d918ae53e Port portions of defines.py to architecure.py, bits,py, memory.py, and structs.py
Signed-off-by: Frinzell, Aaron <aaron.frinzell@intel.com>
2023-08-30 10:28:27 -07:00
Dan Scott cdf0a374db Add PCIe extended capabilities functionality
Signed-off-by: Dan Scott <dan.scott@intel.com>
2023-08-30 10:23:24 -07:00
jun2zhou 319326e414 Add pylint pilot test for chipsec/modules folder (#1920)
* Add pylint pilot test for modules folder

Signed-off-by: Jason Zhou <jun2.zhou@intel.com>
2023-08-29 16:36:15 -07:00
Nathaniel Mitchell 757e1f0434 Print all devices on bus 0 with fun 0 when pch is not detected
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-08-21 16:36:31 -07:00
Nathaniel Mitchell e3b4473bad Update assertRegexpMatch to assertRegex and base Helper to NoneHelper
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-08-21 16:36:12 -07:00
Nathaniel Mitchell 40413338a2 Update cfg_checker test to skip folders
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-08-18 01:16:48 -07:00
Nathaniel Mitchell 6bbe67a7e6 Update lock_check_cmd to poke 'cs.consistency_checking'
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-08-15 16:39:22 -07:00
Nathaniel Mitchell 89f4be530f Update sgx_check and vbox_crash_apicbase
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-08-15 16:39:01 -07:00
Nathaniel Mitchell 84424165c9 Refix glk detection value (#1735)
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-08-09 16:36:23 -07:00
Jason Zhou 1c74b78d41 Use better syntax remove close()
Signed-off-by: Jason Zhou <jun2.zhou@intel.com>
2023-08-07 16:37:50 -07:00
Jason Zhou dd5bd728b7 Fix helper record test
comparing test context by lines, ignore the Unix & window line ending difference.

Signed-off-by: Jason Zhou <jun2.zhou@intel.com>
2023-08-07 16:37:50 -07:00
Frinzell, Aaron 09e78a38d3 Remove Python 3.6 testing
Signed-off-by: Frinzell, Aaron <aaron.frinzell@intel.com>
2023-08-07 16:37:40 -07:00
Frinzell, Aaron 63fb7fc93c Update requirements to use setuptools >= 62.4.0
Signed-off-by: Frinzell, Aaron <aaron.frinzell@intel.com>
2023-08-07 16:37:40 -07:00
Frinzell, Aaron 537caa4a81 Move from distutil for Python 3.12
Signed-off-by: Frinzell, Aaron <aaron.frinzell@intel.com>
2023-08-07 16:37:40 -07:00
Dan Scott e1cd66554e Add typehints to chipsec_tools folder
Signed-off-by: Dan Scott <dan.scott@intel.com>
2023-08-04 16:14:20 -07:00
Nathaniel Mitchell 8bde1bd648 Fix missing 0x in pch_5xxh config
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-08-02 16:33:15 -07:00
Nathaniel Mitchell 863b3905da Change core_parsers to f'strings and hide register size errors
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-08-02 08:50:37 -07:00
Nathaniel Mitchell 6cdfd54d6e Fix UEFI shell issue with new config loading
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
1.12.0
2023-07-28 15:00:27 -07:00
Nathaniel Mitchell 025e15548f Update to 1.12.0
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-07-28 13:49:15 -07:00
Nathaniel Mitchell 145351d150 Add workaround for config loading bug
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-07-28 13:15:14 -07:00
brentholtsclaw 53a6221af4 Fix typehint
Signed-off-by: brentholtsclaw <brent.holtsclaw@intel.com>
2023-07-28 09:40:12 -07:00
brentholtsclaw b40384ffb4 Propogate ability for files not being within LOGPATH
Signed-off-by: brentholtsclaw <brent.holtsclaw@intel.com>
2023-07-28 09:40:12 -07:00
Nathaniel Mitchell 483f9d99f6 Update unittests to match config parsing update
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-07-28 09:34:00 -07:00
Dan Scott b3d974b51a Update modules and utils to match config parsing update
Signed-off-by: Dan Scott <dan.scott@intel.com>
2023-07-28 09:34:00 -07:00
Dan Scott 67fbb3c591 Update hals to match config parsing update
Signed-off-by: Dan Scott <dan.scott@intel.com>
2023-07-28 09:34:00 -07:00
Dan Scott 395d713cca Update configs to match config parsing update
Signed-off-by: Dan Scott <dan.scott@intel.com>
2023-07-28 09:34:00 -07:00
Dan Scott 009622740d Update config parsing
Signed-off-by: Dan Scott <dan.scott@intel.com>
2023-07-28 09:34:00 -07:00
Nathaniel Mitchell fe3202cde9 Update utils to match chipsec_util update
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-07-27 11:39:28 -07:00
Nathaniel Mitchell 96d5409688 Update BaseCommand, chipsec_util with new util structure
Additional changes to enhance utils usage

Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-07-27 11:39:28 -07:00
Nathaniel Mitchell 435bf2ab06 Add cfg checking tests (non-unittest)
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-07-26 16:17:38 -07:00
brentholtsclaw 8378bff01b Add ability to log outside of LOGPATH
Signed-off-by: brentholtsclaw <brent.holtsclaw@intel.com>
2023-07-26 15:32:19 -07:00
Nathaniel Mitchell c3b27e7870 Add record and replay helpers
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-07-26 15:31:56 -07:00
Nathaniel Mitchell 9a09eaed07 Fix 'self._get_driver_handle()' function calls in windowshelper.py
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-07-25 16:38:50 -07:00
Nathaniel Mitchell 27ee5eeb66 Clean up helper create/start/stop/delete functions
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-07-19 16:33:59 -07:00
jun2zhou e143924fdd Cpuinfo unittest (#1887)
* Add test cpu info unittest cases

Signed-off-by: Jason Zhou <jun2.zhou@intel.com>

* Add __init__.py to this folder to be picked up by cmd "py setup.py test"

Signed-off-by: Jason Zhou <jun2.zhou@intel.com>

* Remove unused import

Signed-off-by: Jason Zhou <jun2.zhou@intel.com>

---------

Signed-off-by: Jason Zhou <jun2.zhou@intel.com>
2023-07-11 16:37:29 -07:00
Nicolas Iooss d04cabd02d Remove invalid escape sequences in Windows path
`windowshelper.py` uses a path with backslashes without proper escaping.
While this works because `\s` and `\c` are not valid escape sequences,
this makes flake8 report:

   /chipsec/helper/windows/windowshelper.py:71:53: W605 invalid escape sequence '\s'
   /chipsec/helper/windows/windowshelper.py:71:67: W605 invalid escape sequence '\c'

Fix this by splitting the path when invoking `os.path.join`.

Signed-off-by: Nicolas Iooss <nicolas.iooss_git@polytechnique.org>
2023-07-11 16:37:03 -07:00
Nicolas Iooss f1dfa2dcdd Remove from_file from method start in base helper
Commit 99f9052438 ("Remove filehelper") removed `from_file` and
`to_file` from `OsHelper` but it remained in `BaseHelper`. Remove these
parameters too.

While at it, remove the similar parameters from the mock helper used in
tests.

Signed-off-by: Nicolas Iooss <nicolas.iooss_git@polytechnique.org>
2023-07-10 16:42:07 -07:00
Nicolas Iooss f2afb34220 Add typehints to exceptions.py
This helps type-checking other Python files.

Signed-off-by: Nicolas Iooss <nicolas.iooss_git@polytechnique.org>
2023-07-10 16:41:59 -07:00
Nicolas Iooss 518b7df6a0 Use raw string in the regular expression used in chipsec/module.py
`chipsec/module.py` uses a normal string to define a regular expression,
which makes flake8 report:

    chipsec/module.py:34:27: W605 invalid escape sequence '\w'
    chipsec/module.py:34:31: W605 invalid escape sequence '\.'
    chipsec/module.py:34:33: W605 invalid escape sequence '\w'

To prevent the Python interpreter from trying to interpret the escape
sequences, use a raw string.

Signed-off-by: Nicolas Iooss <nicolas.iooss_git@polytechnique.org>
2023-07-10 16:41:49 -07:00
Jason Zhou 7f58472655 Fix test_pch_invalid() test failing on internal builds
the test invalid pch mock helper returned fake pch id, but valid plat id,
if plat id matched xml file defined reqs_pch=true, will cause exception,
the mocked plat id corresponding xml is reqs_pch=true.

Signed-off-by: Jason Zhou <jun2.zhou@intel.com>
2023-07-10 16:41:29 -07:00