SlideShare a Scribd company logo
1 of 21
Download to read offline
Firmware test suite (fwts)
Automated Testing of x86 firmware.
Presentation by
Colin King
colin.king@canonical.com
www.canonical.com
September 2011
2 Presentation by Colin King
Agenda
●
Introduction
●
Motivation
●
History
●
Key features
●
Test flavours
●
Utilities – extra goodies
●
Participation
3 Presentation by Colin King
Colin King
colin.king@canonical.com
cking on freenode IRC
Ubuntu OEM Hardware Enablement Team
Started working for Canonical in 2008
Work on suspend/resume, hibernate/resume
Troubleshoot gnarly enablement issues
Work on Kernel + firmware bugs (BIOS, ACPI, etc)
who I am, what I do
4 Presentation by Colin King
Why develop the Firmware Test Suite?
5 Presentation by Colin King
Impact of buggy firmware:
Machine won't boot or hangs
Features don't work (e.g. hotkeys, battery,
brightness controls, suspend/resume)
Sub-optimal configuration – e.g. broken MTRRs
Kernel can workaround some issues –> kernel
warnings and error messages
..would be useful to detect and diagnose issues early
and automatically.
x86 Firmware – its buggy!
6 Presentation by Colin King
Useful to test BIOS updates during early enablement
Automatically detect errors
Sanity check core functionality
Ensure Linux + firmware interactions work
Catch kernel warnings
Where possible suggest fixes or workarounds
Gather data firmware specific data for debug
Aim – detect bugs and if possible get firmware fixed
Automation: key to quick turnaround
Get consistent results
Detect regressions
Automate firmware checking
7 Presentation by Colin King
History
8 Presentation by Colin King
Linux-ready Firmware Developer Kit (Intel)
Release 3.0 seemed to die around October 2007
Covered 50% of what we required
Could not plug interface into our test framework
Firmware Test Suite
May 2010 – Started with some tests from Firmware
Developer Kit, new test framework, new logging
mechanism, updated to work with 2.6.35+ kernels.
Releases are in-sync with Ubuntu release schedules
Maverick 10.10: fwts V0.18.04, 34 major tests
Natty 11.04: fwts V0.22.13, 48 major tests
Oneiric 11.10: fwts V0.23.23, 53 major tests
Tested against tens of hundreds of systems
History
9 Presentation by Colin King
Key features
10 Presentation by Colin King
Features
Command line
Designed to be used by other test tools
..or to be run stand alone
..and to gather data for a developer
Batch tests – run without supervision
Interactive tests – e.g. hotkey, lid, AC power.
Extensive logging:
Per test PASS/FAIL results
Explain reasons for failures (ADVICE lines)
Classify failures (CRITICAL, HIGH, LOW..)
Summarise results
Output log format can be configured
Soak testing (suspend/resume, hibernate/resume)
Key features
11 Presentation by Colin King
Test flavours
12 Presentation by Colin King
The kernel does a lot of sanity checking...
Kernel logs contain useful warnings about BIOS
ACPI and UEFI errors, can be a bit terse at times
Parse, classify and log any errors
Try to explain warnings and errors
If possible, suggest fixes and/or workarounds
Unfortunately kernel messages change every release
Use regular expressions to pattern match
Try to keep fwts in sync with latest kernel
Kernel Log Checks
13 Presentation by Colin King
BIOS tables can be extracted and inspected
Sanity check configuration data
DMI/SMBIOS tables
MultiProcessor tables
Sanity check BIOS has configured system sanely
APIC edge/level config
EBDA region reserved in e820 table
MTRRs set correctly
MSRs set consistently across CPUs
CPU NX bit enabled
CPU virtualization extensions enabled
HDA audio pin configuration
BIOS configuration inspection
14 Presentation by Colin King
ACPI tables contain data + code:
Configuration data
ACPI Machine Language (AML) “byte code”
"a complete design disaster in every way" -Linus
Sanity check ACPI tables:
Simple table checksums
Limited checks on APIC, ECTD, FACP, HPET, MCFG,
RSDT, RSDP, SBST, XSDT
Check for multiple MADT
MCFG entries also reserved in e820 table
Simple WMI GUID checks
ACPI Tables
15 Presentation by Colin King
ACPI Machine Language Checks
Uses the ACPICA execution engine in user space
Evaluate common methods + objects
Inspect return types – simple type checking
Check for method parameter mismatches
Check all acquired locks are released
Sanity check a range of valid inputs
Cons:
Cannot fully emulate I/O ops or interactions via
SMIs or Embedded Controller.
AML Syntax check:
Disassemble DSDT + SSDT, re-assemble
Catches bugs in AML generated with Microsoft tools
ACPI Tables – AML checking
16 Presentation by Colin King
Work in progress!
Like to sanity check boot services
Would like to port fwts framework to UEFI
Currently just have a tool to dump UEFI variables
UEFI checks
17 Presentation by Colin King
Utilities – extra goodies
18 Presentation by Colin King
Like a small firmware Swiss Army Knife
Gather data for bug reports
All the necessary utilities in one tool
Utilities included to dump and annotate:
ACPI tables *
BIOS EBDA region
UEFI variables
CMOS memory
System memory map (e820 or UEFI memory map)
MultiProcessor tables
Firmware ROM(s)
Disassemble AML
* Dumped data can be fed into some fwts tests
Utilities
19 Presentation by Colin King
Participation
20 Presentation by Colin King
Source:
git://kernel.ubuntu.com/cking/fwts/.git
Contributions welcome!
Documentation:
https://wiki.ubuntu.com/Kernel/Reference/fwts
..includes links to pages explaining each test
` with examples of usage and expected output
Project Page:
https://launchpad.net/~firmware-testing-team
Participate..
Questions please
Thank you
Colin King
colin.king@canonical.com
www.canonical.com

More Related Content

Similar to fwts-plumbers-2011.pdf

Cray XT Porting, Scaling, and Optimization Best Practices
Cray XT Porting, Scaling, and Optimization Best PracticesCray XT Porting, Scaling, and Optimization Best Practices
Cray XT Porting, Scaling, and Optimization Best Practices
Jeff Larkin
 
May2010 hex-core-opt
May2010 hex-core-optMay2010 hex-core-opt
May2010 hex-core-opt
Jeff Larkin
 
Processor Verification Using Open Source Tools and the GCC Regression Test Suite
Processor Verification Using Open Source Tools and the GCC Regression Test SuiteProcessor Verification Using Open Source Tools and the GCC Regression Test Suite
Processor Verification Using Open Source Tools and the GCC Regression Test Suite
DVClub
 
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14hYuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
Yury M
 

Similar to fwts-plumbers-2011.pdf (20)

Cray XT Porting, Scaling, and Optimization Best Practices
Cray XT Porting, Scaling, and Optimization Best PracticesCray XT Porting, Scaling, and Optimization Best Practices
Cray XT Porting, Scaling, and Optimization Best Practices
 
ELC-E 2010: The Right Approach to Minimal Boot Times
ELC-E 2010: The Right Approach to Minimal Boot TimesELC-E 2010: The Right Approach to Minimal Boot Times
ELC-E 2010: The Right Approach to Minimal Boot Times
 
Embedded Recipes 2019 - Testing firmware the devops way
Embedded Recipes 2019 - Testing firmware the devops wayEmbedded Recipes 2019 - Testing firmware the devops way
Embedded Recipes 2019 - Testing firmware the devops way
 
Works on My Machine Syndrome
Works on My Machine SyndromeWorks on My Machine Syndrome
Works on My Machine Syndrome
 
May2010 hex-core-opt
May2010 hex-core-optMay2010 hex-core-opt
May2010 hex-core-opt
 
Building PoC ready ODM Platforms with Arm SystemReady v5.2.pdf
Building PoC ready ODM Platforms with Arm SystemReady v5.2.pdfBuilding PoC ready ODM Platforms with Arm SystemReady v5.2.pdf
Building PoC ready ODM Platforms with Arm SystemReady v5.2.pdf
 
Squeezing Blood From a Stone V1.2
Squeezing Blood From a Stone V1.2Squeezing Blood From a Stone V1.2
Squeezing Blood From a Stone V1.2
 
Self-Aware Applications: Automatic Production Monitoring (NDC Sydney 2017)
Self-Aware Applications: Automatic Production Monitoring (NDC Sydney 2017)Self-Aware Applications: Automatic Production Monitoring (NDC Sydney 2017)
Self-Aware Applications: Automatic Production Monitoring (NDC Sydney 2017)
 
SFO15-TR9: PSCI, ACPI (and UEFI to boot)
SFO15-TR9: PSCI, ACPI (and UEFI to boot)SFO15-TR9: PSCI, ACPI (and UEFI to boot)
SFO15-TR9: PSCI, ACPI (and UEFI to boot)
 
Processor Verification Using Open Source Tools and the GCC Regression Test Suite
Processor Verification Using Open Source Tools and the GCC Regression Test SuiteProcessor Verification Using Open Source Tools and the GCC Regression Test Suite
Processor Verification Using Open Source Tools and the GCC Regression Test Suite
 
Adrian marinica continuous integration in the visual studio world
Adrian marinica   continuous integration in the visual studio worldAdrian marinica   continuous integration in the visual studio world
Adrian marinica continuous integration in the visual studio world
 
BIOS, Linux and Firmware Test Suite in-between
BIOS, Linux and  Firmware Test Suite in-betweenBIOS, Linux and  Firmware Test Suite in-between
BIOS, Linux and Firmware Test Suite in-between
 
IVI-COM Action
IVI-COM ActionIVI-COM Action
IVI-COM Action
 
Fut Lsi
Fut LsiFut Lsi
Fut Lsi
 
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14hYuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
 
TI TechDays 2010: swiftBoot
TI TechDays 2010: swiftBootTI TechDays 2010: swiftBoot
TI TechDays 2010: swiftBoot
 
Windows Internals: fuzzing, hijacking and weaponizing kernel objects
Windows Internals: fuzzing, hijacking and weaponizing kernel objectsWindows Internals: fuzzing, hijacking and weaponizing kernel objects
Windows Internals: fuzzing, hijacking and weaponizing kernel objects
 
2009-08-24 The Linux Audit Subsystem Deep Dive
2009-08-24 The Linux Audit Subsystem Deep Dive2009-08-24 The Linux Audit Subsystem Deep Dive
2009-08-24 The Linux Audit Subsystem Deep Dive
 
Using the New Apache Flink Kubernetes Operator in a Production Deployment
Using the New Apache Flink Kubernetes Operator in a Production DeploymentUsing the New Apache Flink Kubernetes Operator in a Production Deployment
Using the New Apache Flink Kubernetes Operator in a Production Deployment
 
taddm
taddmtaddm
taddm
 

Recently uploaded

Artificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdfArtificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdf
Kira Dess
 

Recently uploaded (20)

Worksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxWorksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptx
 
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
 
SLIDESHARE PPT-DECISION MAKING METHODS.pptx
SLIDESHARE PPT-DECISION MAKING METHODS.pptxSLIDESHARE PPT-DECISION MAKING METHODS.pptx
SLIDESHARE PPT-DECISION MAKING METHODS.pptx
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)
 
History of Indian Railways - the story of Growth & Modernization
History of Indian Railways - the story of Growth & ModernizationHistory of Indian Railways - the story of Growth & Modernization
History of Indian Railways - the story of Growth & Modernization
 
Basics of Relay for Engineering Students
Basics of Relay for Engineering StudentsBasics of Relay for Engineering Students
Basics of Relay for Engineering Students
 
UNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxUNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptx
 
CLOUD COMPUTING SERVICES - Cloud Reference Modal
CLOUD COMPUTING SERVICES - Cloud Reference ModalCLOUD COMPUTING SERVICES - Cloud Reference Modal
CLOUD COMPUTING SERVICES - Cloud Reference Modal
 
5G and 6G refer to generations of mobile network technology, each representin...
5G and 6G refer to generations of mobile network technology, each representin...5G and 6G refer to generations of mobile network technology, each representin...
5G and 6G refer to generations of mobile network technology, each representin...
 
Artificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdfArtificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdf
 
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas SachpazisSeismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
 
engineering chemistry power point presentation
engineering chemistry  power point presentationengineering chemistry  power point presentation
engineering chemistry power point presentation
 
What is Coordinate Measuring Machine? CMM Types, Features, Functions
What is Coordinate Measuring Machine? CMM Types, Features, FunctionsWhat is Coordinate Measuring Machine? CMM Types, Features, Functions
What is Coordinate Measuring Machine? CMM Types, Features, Functions
 
Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...
 
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdflitvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
 
Circuit Breakers for Engineering Students
Circuit Breakers for Engineering StudentsCircuit Breakers for Engineering Students
Circuit Breakers for Engineering Students
 
The Entity-Relationship Model(ER Diagram).pptx
The Entity-Relationship Model(ER Diagram).pptxThe Entity-Relationship Model(ER Diagram).pptx
The Entity-Relationship Model(ER Diagram).pptx
 
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdfInstruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
 
Developing a smart system for infant incubators using the internet of things ...
Developing a smart system for infant incubators using the internet of things ...Developing a smart system for infant incubators using the internet of things ...
Developing a smart system for infant incubators using the internet of things ...
 
Interfacing Analog to Digital Data Converters ee3404.pdf
Interfacing Analog to Digital Data Converters ee3404.pdfInterfacing Analog to Digital Data Converters ee3404.pdf
Interfacing Analog to Digital Data Converters ee3404.pdf
 

fwts-plumbers-2011.pdf

  • 1. Firmware test suite (fwts) Automated Testing of x86 firmware. Presentation by Colin King colin.king@canonical.com www.canonical.com September 2011
  • 2. 2 Presentation by Colin King Agenda ● Introduction ● Motivation ● History ● Key features ● Test flavours ● Utilities – extra goodies ● Participation
  • 3. 3 Presentation by Colin King Colin King colin.king@canonical.com cking on freenode IRC Ubuntu OEM Hardware Enablement Team Started working for Canonical in 2008 Work on suspend/resume, hibernate/resume Troubleshoot gnarly enablement issues Work on Kernel + firmware bugs (BIOS, ACPI, etc) who I am, what I do
  • 4. 4 Presentation by Colin King Why develop the Firmware Test Suite?
  • 5. 5 Presentation by Colin King Impact of buggy firmware: Machine won't boot or hangs Features don't work (e.g. hotkeys, battery, brightness controls, suspend/resume) Sub-optimal configuration – e.g. broken MTRRs Kernel can workaround some issues –> kernel warnings and error messages ..would be useful to detect and diagnose issues early and automatically. x86 Firmware – its buggy!
  • 6. 6 Presentation by Colin King Useful to test BIOS updates during early enablement Automatically detect errors Sanity check core functionality Ensure Linux + firmware interactions work Catch kernel warnings Where possible suggest fixes or workarounds Gather data firmware specific data for debug Aim – detect bugs and if possible get firmware fixed Automation: key to quick turnaround Get consistent results Detect regressions Automate firmware checking
  • 7. 7 Presentation by Colin King History
  • 8. 8 Presentation by Colin King Linux-ready Firmware Developer Kit (Intel) Release 3.0 seemed to die around October 2007 Covered 50% of what we required Could not plug interface into our test framework Firmware Test Suite May 2010 – Started with some tests from Firmware Developer Kit, new test framework, new logging mechanism, updated to work with 2.6.35+ kernels. Releases are in-sync with Ubuntu release schedules Maverick 10.10: fwts V0.18.04, 34 major tests Natty 11.04: fwts V0.22.13, 48 major tests Oneiric 11.10: fwts V0.23.23, 53 major tests Tested against tens of hundreds of systems History
  • 9. 9 Presentation by Colin King Key features
  • 10. 10 Presentation by Colin King Features Command line Designed to be used by other test tools ..or to be run stand alone ..and to gather data for a developer Batch tests – run without supervision Interactive tests – e.g. hotkey, lid, AC power. Extensive logging: Per test PASS/FAIL results Explain reasons for failures (ADVICE lines) Classify failures (CRITICAL, HIGH, LOW..) Summarise results Output log format can be configured Soak testing (suspend/resume, hibernate/resume) Key features
  • 11. 11 Presentation by Colin King Test flavours
  • 12. 12 Presentation by Colin King The kernel does a lot of sanity checking... Kernel logs contain useful warnings about BIOS ACPI and UEFI errors, can be a bit terse at times Parse, classify and log any errors Try to explain warnings and errors If possible, suggest fixes and/or workarounds Unfortunately kernel messages change every release Use regular expressions to pattern match Try to keep fwts in sync with latest kernel Kernel Log Checks
  • 13. 13 Presentation by Colin King BIOS tables can be extracted and inspected Sanity check configuration data DMI/SMBIOS tables MultiProcessor tables Sanity check BIOS has configured system sanely APIC edge/level config EBDA region reserved in e820 table MTRRs set correctly MSRs set consistently across CPUs CPU NX bit enabled CPU virtualization extensions enabled HDA audio pin configuration BIOS configuration inspection
  • 14. 14 Presentation by Colin King ACPI tables contain data + code: Configuration data ACPI Machine Language (AML) “byte code” "a complete design disaster in every way" -Linus Sanity check ACPI tables: Simple table checksums Limited checks on APIC, ECTD, FACP, HPET, MCFG, RSDT, RSDP, SBST, XSDT Check for multiple MADT MCFG entries also reserved in e820 table Simple WMI GUID checks ACPI Tables
  • 15. 15 Presentation by Colin King ACPI Machine Language Checks Uses the ACPICA execution engine in user space Evaluate common methods + objects Inspect return types – simple type checking Check for method parameter mismatches Check all acquired locks are released Sanity check a range of valid inputs Cons: Cannot fully emulate I/O ops or interactions via SMIs or Embedded Controller. AML Syntax check: Disassemble DSDT + SSDT, re-assemble Catches bugs in AML generated with Microsoft tools ACPI Tables – AML checking
  • 16. 16 Presentation by Colin King Work in progress! Like to sanity check boot services Would like to port fwts framework to UEFI Currently just have a tool to dump UEFI variables UEFI checks
  • 17. 17 Presentation by Colin King Utilities – extra goodies
  • 18. 18 Presentation by Colin King Like a small firmware Swiss Army Knife Gather data for bug reports All the necessary utilities in one tool Utilities included to dump and annotate: ACPI tables * BIOS EBDA region UEFI variables CMOS memory System memory map (e820 or UEFI memory map) MultiProcessor tables Firmware ROM(s) Disassemble AML * Dumped data can be fed into some fwts tests Utilities
  • 19. 19 Presentation by Colin King Participation
  • 20. 20 Presentation by Colin King Source: git://kernel.ubuntu.com/cking/fwts/.git Contributions welcome! Documentation: https://wiki.ubuntu.com/Kernel/Reference/fwts ..includes links to pages explaining each test ` with examples of usage and expected output Project Page: https://launchpad.net/~firmware-testing-team Participate..
  • 21. Questions please Thank you Colin King colin.king@canonical.com www.canonical.com