Intel & FreeBSD: Better Together Ben Widawsky Agenda

● Introduction (OTC & Me) ● Intel’s past involvement with BSD ● Intel’s latest involvement with BSD ● What’s next ● Power Management deep-dive ● Q&A Ben Widawsky

● Introduced to FreeBSD 5.0 in 2003 by kensmith@ ● Software Developer at Intel since 2005 ● Focus switched to FreeBSD upstream work in 2018 ● Diverse career Intel Open Source Technology Center (OTC)

● Organization specializing in Open Source ● 20 years building expertise and acquiring industry talent ○ The other Alan Cox ● Contributes to over 100 community projects ● Community Friendly licensing ○ Match the ecosystem when possible ■ GPLv2 or GPLv3 for utilities close to Kernel ■ Apache for cloud BSD-Friendly Case Studies

Intel Linux Graphics Intel Network Drivers ● Intel releases code GPL/BSD ● Internally developed ● Intel develops Linux driver ● Intel releases GPL code for Linux ● Community ports to FreeBSD and BSD code for FreeBSD

● Work required from community ● No work required from community ● Licenses can become mixed ● Licenses are clear ● Developed largely in the open ● Developed largely internally ● Easy for community to contribute ● Difficult to take community contributions Agenda

● Introduction (OTC & Me) ● Intel’s past involvement with BSD Intel’s Past Contributions

● 2011 ○ jimharris@ started on integrated SAS controller in the Intel C600 ● 2012 ○ jimharris@ merged isci(4), nvme(4), nvd(4), nvmecontrol(8) ● 2013 ○ NTB (Non-Transparent Bridge) driver (by carl@) ○ jimharris@ ported VTune drivers to FreeBSD ● 2014 ○ jimharris@ merged ismt(4) ○ DPDK on FreeBSD ○ jimharris@ ported pcm Intel’s Past Contributions (cont’d)

● 2015 ○ Intel Ethernet team designates FreeBSD as Tier 1 OS ○ cem@ merged an ioat(4) based on version developed by jimharris@ ● 2017 ○ Intel Ethernet adopts iflib(9) as standard for future Ethernet driver releases ○ Intel Ethernet releases iflib(9) drivers for 10Gbe Ethernet Products ○ Glenn Weinberg ported PMDK

Intel and FreeBSD Foundation establish collaborative relationship Intel Adopts Security First Pledge

● Intel is working closely with our partners with the shared goal of restoring confidence in the security of our customers’ data ● Intel engages with FreeBSD Foundation to help ensure coordinated disclosure method to help mitigate side-channel security issues ● Intel works collaboratively ahead of public disclosure to develop: ○ Engineering mitigation ○ Relevant guidance and documentation ○ 2-way communication channel ● Results in mitigated software and guidance in advance of disclosure Agenda

● Introduction (OTC & Me) ● Intel’s past involvement with BSD ● Intel’s latest involvement with BSD Humble Beginnings (2018)

● OTC forms a FreeBSD team ○ Liaison and support for security mitigations ○ OS/Hardware enabling in “spare time” ● Early tasks ○ Laundry list of things to enable ○ Scrubbing and prioritizing ● Goal - Be useful ○ Doing instead of talking The Context Switch

● Environment adjusting ○ Decreasing build times ○ Remote debugging (serial ports, kgdb, ddb, etc) ○ Obtaining machines ● Acclimatize to community ○ Get small patches committed ✓ 7 patches since July ○ Port a useful tool ✓ Turbostat ○ Participate in community discussion/reviews ✓ Session leader BSDCam 2018 Power Management ✓ Nvdimm testing ○ Find 10 year old bug ✓ UFS + Quota + rename Do Things People Care About

● Current Active Work ○ iflib(9) drivers for Intel 40Gbe Ethernet products ■ done ○ nvdimm namespace support ■ working on setting attributes in geom ○ power management improvements ■ debugging ○ Thunderbolt ■ scoping Agenda

● Introduction (OTC & Me) ● Intel’s past involvement with BSD ● Intel’s new involvement with BSD ● What’s next Figuring Out What to Do

Ideally: 1. community wants 2. sales interest 3. has a developer available and interested 4. customers are ready to deploy. Stated Goal

“Make Intel products run better on FreeBSD.” - Ben Widawsky 10/10/18 Requests So Far

● Device Drivers ● Device Drivers ○ Intel Networking 100Gbe ○ Intel Wireless ○ Better NVMe Error Handling ○ Intel Graphics ○ QAT ○ Thunderbolt ○ DSA (Data Streaming Accelerator) ○ / ● Power Management / Performance ● Power Management / Performance ○ Runtime Power Management ○ Suspend Resume Improvements ● Internal/External APIs ▪ Robustness ● Security ▪ S4 ○ Enabling root of trust ○ Turbo Boost KPT ● Bhyve ▪ ● Stability ○ GPU passthrough ○ CI / test farm ○ USB passthrough ● Tools/Libraries ● Internal/External APIs ○ CET ○ CUDA + Other HPC ○ DPDK ○ ALTQ replacement ○ SPDK ○ /fsevents ○ Snap ● Code Cleanup ○ RDT ○ Unification of i386, amd64, and x86 ○ Better VTune support ● Tools ○ Nvme firmware updater ○ Powertop port Prioritization Rating What We’re Doing

PM

NVDIMM

TB Call to Action

● Help me prioritize the work ○ Help me understand where we can co-invest ● Help me find new work ○ If a task has impact for Intel, Alliance with communities, and is feasible, send it my way! ● Power Management ○ If you have ideas on how runtime power management should look ○ Help me move the point in the Venn diagram ● Be nice :-) Agenda

● Introduction (OTC & Me) ● Intel’s past involvement with BSD ● Intel’s new involvement with BSD ● What’s next ● Power Management deep-dive Power Management Goals

1.Understand the existing suspend/resume path 2.Add a “suspend-to-idle” option Reality 3.Emulated S3 a.Enable s0ix for platforms which support it Goal 4.Design a runtime power management framework 5.Take a platform and make that work

“The definition of insanity is doing the same thing over and over and expecting different results.”

‐ Albert Einstein Sleep Flow

Down ACPI Down Lid Close Devices Prep CPU S3 Sleep Sx Event Button

Power Restore Button CPU S5 ACPI Power Off Wake

Up Devices Emulated S3 Flow aka Suspend to Idle

Down ACPI Down Lid Close Devices Prep CPU S3 Sleep Sx Event Button

Power Restore Idle CPU Button CPU S5 ACPI Power Off Wake

Up Devices Opportunistic Idle

Delay

hysteresis LPI? Idle CPU Wake Event

Device Idle Device Idle Device Idle Device Idle Device Idle Up Devices

Refcount vs. Poll All devices or just some? Power Management Status

● Suspend-to-idle debugging ○ Random wakeups ○ Random poweroff ○ Dead ● Beginning to think about runtime PM ● Wishlist ○ rtcwake equivalent (help remote testing) ○ serial portless debugging ○ nvme(4) robustification ○ Bring devices back up on failures in sleep path ■ Example: prints in wakeup events Agenda

● Introduction (OTC & Me) ● Intel’s past involvement with BSD ● Intel’s new involvement with BSD ● What’s next ● Power Management deep-dive ● Q&A Thanks + Q&A

▪ Jim Harris - Contributing the non-network Intel history ▪ Shan Greer - Contributing network driver Intel history ▪ Eric Joyner - Explaining the licensing in network driver team ▪ John Venn ▪ FreeBSD community ▪ jhb@ ▪ emaste@ Contacts/Links

● Email ○ [email protected] - “official stuff” ○ [email protected] - FreeBSD stuff ○ [email protected] - everything else ● Personal Twitter ○ @widawsky ● Personal Blog ○ https://bwidawsk.net - Add to the blog ● Docs/Links ○ Low Power Idle ○ https://01.org/