Writing (and testing) device drivers without hardware PJ Waskiewicz, LAN Access Division, Intel Corp. Title.

Slides:



Advertisements
Similar presentations
Virtualization Dr. Michael L. Collard
Advertisements

Virtual Machines What Why How Powerpoint?. What is a Virtual Machine? A Piece of software that emulates hardware.  Might emulate the I/O devices  Might.
Keith Wiles DPACC vNF Overview and Proposed methods Keith Wiles – v0.5.
Network Implementation for Xen and KVM Class project for E : Network System Design and Implantation 12 Apr 2010 Kangkook Jee (kj2181)
Students:Gilad Goldman Lior Kamran Supervisor:Mony Orbach Part A Presentation Network Sniffer.
KVM/ARM: The Design and Implementation of the Linux ARM Hypervisor Fall 2014 Presented By: Probir Roy.
A. Frank - P. Weisberg Operating Systems Structure of Operating Systems.
Virtual Machines. Virtualization Virtualization deals with “extending or replacing an existing interface so as to mimic the behavior of another system”
Virtualization for Cloud Computing
CSE 451: Operating Systems Winter 2012 Module 18 Virtual Machines Mark Zbikowski and Gary Kimura.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Windows Azure Conference 2014 Running Docker on Windows Azure.
Why do so many chips fail? Ira Chayut, Verification Architect (opinions are my own and do not necessarily represent the opinion of my employer)
Eric Keller, Evan Green Princeton University PRESTO /22/08 Virtualizing the Data Plane Through Source Code Merging.
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 14, 2005 Operating System.
The Best of Both Worlds with On-Demand Virtualization Thawan Kooburat and Michael M. Swift On-Demand Virtualization allows systems to benefit from virtualization.
VirtualBox What you need to know to build a Virtual Machine.
Virtual Machine and its Role in Distributed Systems.
INTRODUCTION SOFTWARE HARDWARE DIFFERENCE BETWEEN THE S/W AND H/W.
© 2012 xtUML.org Bill Chown – Mentor Graphics Model Driven Engineering.
1 CSE 451 Section 2: Interrupts, Syscalls, Virtual Machines, and Project 1.
 Virtual machine systems: simulators for multiple copies of a machine on itself.  Virtual machine (VM): the simulated machine.  Virtual machine monitor.
CS 346 – Chapter 2 OS services –OS user interface –System calls –System programs How to make an OS –Implementation –Structure –Virtual machines Commitment.
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
Simics: A Full System Simulation Platform Synopsis by Jen Miller 19 March 2004.
Full and Para Virtualization
iSER update 2014 OFA Developer Workshop Eyal Salomon
Lecture 26 Virtual Machine Monitors. Virtual Machines Goal: run an guest OS over an host OS Who has done this? Why might it be useful? Examples: Vmware,
Virtualization One computer can do the job of multiple computers, by sharing the resources of a single computer across multiple environments. Turning hardware.
Hands-On Virtual Computing
CSE 451: Operating Systems Winter 2015 Module 25 Virtual Machine Monitors Mark Zbikowski Allen Center 476 © 2013 Gribble, Lazowska,
Cloud Computing – UNIT - II. VIRTUALIZATION Virtualization Hiding the reality The mantra of smart computing is to intelligently hide the reality Binary->
Unit 2 VIRTUALISATION. Unit 2 - Syllabus Basics of Virtualization Types of Virtualization Implementation Levels of Virtualization Virtualization Structures.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
April 15, 2013 Atul Kwatra Principal Engineer Intel Corporation Hardware/Software Co-design using SystemC/TLM – Challenges & Opportunities ISCUG ’13.
Intro To Virtualization Mohammed Morsi
Open Source Virtualisation and Consolidation. Whoami ● Linux and Open Source Consultant ● „Infrastructure Architect“ ● Linux since 0.98 ● IANAKH ● Senior.
Virtualization With:. Virtualization With: What Kind of Virtualization? Full virtualization Platform Resource.
Computer System Structures
Benefits of a Virtual SIL
Virtualization for Cloud Computing
Virtualization.
Operating System & Application Software
Fundamentals Sunny Sharma Microsoft
Kernel Design & Implementation
Operating System Structure
Current Generation Hypervisor Type 1 Type 2.
Virtualization Dr. Michael L. Collard
The Mach System Sri Ramkrishna.
Mechanism: Limited Direct Execution
Lecture 24 Virtual Machine Monitors
Operating System Structure
Java Win32 native Java VM Linux OS ARM VM Runtime Windows OS
Virtualization overview
Chapter 3: Windows7 Part 1.
OS Virtualization.
Winter 2016 (c) Ian Davis.
Virtualization Techniques
Chapter 2: The Linux System Part 1
Shenghsun Cho, Mrunal Patel, Han Chen, Michael Ferdman, Peter Milder
A Survey on Virtualization Technologies
Chapter 8: Memory management
Virtual Platforms Driving Software Quality in Pre-Silicon
Language Processors Application Domain – ideas concerning the behavior of a software. Execution Domain – Ideas implemented in Computer System. Semantic.
Reverse engineering through full system simulations
System calls….. C-program->POSIX call
Virtualization Dr. S. R. Ahmed.
CSE 451: Operating Systems Autumn Module 24 Virtual Machine Monitors
Interrupt Message Store
Hypervisor A hypervisor or virtual machine monitor (VMM) is computer software, firmware or hardware that creates and runs virtual machines. A computer.
Presentation transcript:

Writing (and testing) device drivers without hardware PJ Waskiewicz, LAN Access Division, Intel Corp. Title

2 Who Am I PJ Waskiewicz ● Linux developer in LAN Access Division ● Maintained previous 10 GbE driver (ixgbe) ● Working on next-gen 40 GbE product ● Work on large bandwidth scaling techniques

Networking++ Fast networking... ● 40 GbE is the new frontier for data center communications … that does everything… ● All the normal Ethernet tricks ● Bakes a great apple pie ● Can leap tall buildings in a single bound … and has market scheduling targets ● What else is new?... and accelerates the Cloud ● It's the future, right?

4 Shift Left ● Hardware + Software = Complete product ● Feature-complete software by A-0 silicon ● Software needs to happen earlier HW Schedule SW Schedule HW Schedule SW Schedule

Write SW without the HW? Hardware emulation to the rescue! ● Product in early design when “Shift Left” happened ● Driver developers challenged to be “Code Complete” with new features when A-0 arrives ● HW spec not yet solidified Oh crap, now what?

LAD’s Hardware emulation so far FPGAs – $$$ – Planned, but in stages that don't match SW's Shift Left schedule – Requires working RTL which won't be ready soon RTL simulator – $$$$$ – Requires working RTL – Typically can load native drivers Software emulator (bus function driver) – Windows only, not portable to multiple OS's

How about QEMU/KVM Emulation? HW System emulation in Virtual Machines – QEMU emulates many systems – KVM gives Linux kernel support for VM acceleration Supports many hardware types and peripherals – X86 and other architectures – Various network and other devices Supports many OS’s in VMs – Windows, Linux, BSD Open source – We can modify the existing internals – We can add our own!

QEMU: Emulation and Virtualization QEMU runs as Linux user process QEMU Shell Linux kernel

QEMU: Emulation and Virtualization QEMU runs as Linux user process Guest OS runs in QEMU shell QEMU Shell Linux kernel Guest OS

QEMU: Emulation and Virtualization QEMU runs as Linux user process Guest OS runs in QEMU shell Guest OS “sees” HW presented by QEMU shell QEMU Shell Linux kernel Guest OS Emulated HW

QEMU: Emulation and Virtualization QEMU Shell Linux kernel Guest OS Emulated HW

Goals Support Linux and Windows driver development – Emulate the device register set – Emulate basic device functionality – Give feedback to HW designers – Make it useful for other OS's as well Don't worry about being perfect – Don't need high performance – Don't need every single planned feature

Creating a new device Start with existing e1000 emulation Match device requirements with HW specs Implement different packet descriptor formats Implement firmware doorbell registers Register PCI BARs Add device specific features Many more...

14 Simple code example ● Attach R/O register to callback ● QEMU traps MMIO write

15 More complex example ● Use RFC for TSO to implement logic ● Follows internal device logic

16 “Implementing” Firmware ● Firmware comprised of command descriptor, doorbell ● Fill out descriptor, ring doorbell ● Process descriptor, writeback result

17 Recent Breakthroughs ● Last few weeks we added timer support to emulated device ● Make use of QEMU's built-in high-res timer ● Useful for modeling interrupt coalescing, modeling EEPROM/BMC semaphore timing

18 “Messing” with the device ● Unit test framework inside product model ● Hooked to dummy register ● Can be used to inject errors, among other things ● Another dummy register to change PF behavior ● Verifies multifunction device behavior

19 Impact in LAD OS Drivers are already operational – Hotpaths are being exercised – HW design ideas being proven in SW Dozens of bugs found and fixed in multiple OS drivers – First bugs found and fixed months prior to scheduled initial FPGA arrival HW Test and Diagnostics tools built against emulation Other network product groups beginning to use the model

Benefits to You Much more likely to hit schedule – Enables maximum “Shift Left” Better complete SW/HW product – Everything gets better/earlier review Can be applied to other HW products – Modeling peripherals probably easiest – Modeling CPU behaviors may be more challenging

Extra Benefits HW team getting Shift Left benefits – HW SV folks testing their tools on our emulator Diagnostics, SW test, and support folks as well – Enough driver and emulator working for all to Shift Left VMs are easier to restart after a crash – Faster development turnaround – Allows for remote development Open software is “free” (as in beer) – Cost is Intel engineering time to build emulation – Result could be returned to community, assist Design Wins Build Kernel infrastructure sooner

22 Next Steps ● Implementation of more advanced features ● Expand preboot driver development ● Explore integrating RTL into backend ● Explore running “real” firmware engine ● Expand to other product lines in Intel

23 Enhancing QEMU ● Push device “stub” into QEMU to support this model ● Implement true firmware core in QEMU. Tensilica? ARC? ● Implement easier RTL integration for future use

Lessons Learned Emulating hardware has given much better insight into hardware operation, leading to better designed drivers Emulating early allowed us to test changes in hardware architecture for sanity and have meaningful input to that architecture Having an emulator this early allowed the entire extended product team to collaborate closer much earlier than previous projects