AMD SEV Update Linux Security Summit David Kaplan, Security Architect

Similar documents
PROTECTING VM REGISTER STATE WITH AMD SEV-ES DAVID KAPLAN LSS 2017

KVM CPU MODEL IN SYSCALL EMULATION MODE ALEXANDRU DUTU, JOHN SLICE JUNE 14, 2015

AMD IOMMU VERSION 2 How KVM will use it. Jörg Rödel August 16th, 2011

Panel Discussion: The Future of I/O From a CPU Architecture Perspective

AMD CORPORATE TEMPLATE AMD Radeon Open Compute Platform Felix Kuehling

OPENCL TM APPLICATION ANALYSIS AND OPTIMIZATION MADE EASY WITH AMD APP PROFILER AND KERNELANALYZER

SIMULATOR AMD RESEARCH JUNE 14, 2015

AMD Graphics Team Last Updated February 11, 2013 APPROVED FOR PUBLIC DISTRIBUTION. 1 3DMark Overview February 2013 Approved for public distribution


INTRODUCTION TO OPENCL TM A Beginner s Tutorial. Udeepta Bordoloi AMD

AMD APU and Processor Comparisons. AMD Client Desktop Feb 2013 AMD

AMD RYZEN PROCESSOR WITH RADEON VEGA GRAPHICS CORPORATE BRAND GUIDELINES

AMD Graphics Team Last Updated April 29, 2013 APPROVED FOR PUBLIC DISTRIBUTION. 1 3DMark Overview April 2013 Approved for public distribution

Enhance your Cloud Security with AMD EPYC Hardware Memory Encryption

AMD Pacifica Virtualization Technology

HETEROGENEOUS SYSTEM ARCHITECTURE: PLATFORM FOR THE FUTURE

AMD ACCELERATING TECHNOLOGIES FOR EXASCALE COMPUTING FELLOW 3 OCTOBER 2016

Maximizing Six-Core AMD Opteron Processor Performance with RHEL

ROCm: An open platform for GPU computing exploration

Designing Natural Interfaces

AMD Security and Server innovation

Generic System Calls for GPUs

Use cases. Faces tagging in photo and video, enabling: sharing media editing automatic media mashuping entertaining Augmented reality Games

RegMutex: Inter-Warp GPU Register Time-Sharing

EFFICIENT SPARSE MATRIX-VECTOR MULTIPLICATION ON GPUS USING THE CSR STORAGE FORMAT

viewdle! - machine vision experts

Run Anywhere. The Hardware Platform Perspective. Ben Pollan, AMD Java Labs October 28, 2008

FLASH MEMORY SUMMIT Adoption of Caching & Hybrid Solutions

CAUTIONARY STATEMENT This presentation contains forward-looking statements concerning Advanced Micro Devices, Inc. (AMD) including, but not limited to

The Rise of Open Programming Frameworks. JC BARATAULT IWOCL May 2015

EXPLOITING ACCELERATOR-BASED HPC FOR ARMY APPLICATIONS

INTERFERENCE FROM GPU SYSTEM SERVICE REQUESTS

HyperTransport Technology

SOLUTION TO SHADER RECOMPILES IN RADEONSI SEPTEMBER 2015

3D Numerical Analysis of Two-Phase Immersion Cooling for Electronic Components

Runtime VM Protection By Intel Multi-Key Total Memory Encryption (MKTME)

CAUTIONARY STATEMENT 1 AMD NEXT HORIZON NOVEMBER 6, 2018

ADVANCED RENDERING EFFECTS USING OPENCL TM AND APU Session Olivier Zegdoun AMD Sr. Software Engineer

Understanding GPGPU Vector Register File Usage

AMD HD3D Technology. Setup Guide. 1 AMD HD3D TECHNOLOGY: Setup Guide

CAUTIONARY STATEMENT This presentation contains forward-looking statements concerning Advanced Micro Devices, Inc. (AMD) including, but not limited to

The Road to the AMD. Fiji GPU. Featuring Die Stacking and HBM Technology 1 THE ROAD TO THE AMD FIJI GPU ECTC 2016 MAY 2015

Sequential Consistency for Heterogeneous-Race-Free

MEASURING AND MODELING ON-CHIP INTERCONNECT POWER ON REAL HARDWARE

THE PROGRAMMER S GUIDE TO THE APU GALAXY. Phil Rogers, Corporate Fellow AMD

Vulkan (including Vulkan Fast Paths)

LIQUIDVR TODAY AND TOMORROW GUENNADI RIGUER, SOFTWARE ARCHITECT

Fusion Enabled Image Processing

AMD EPYC CORPORATE BRAND GUIDELINES

AMD RYZEN CORPORATE BRAND GUIDELINES

White Paper AMD64 TECHNOLOGY SPECULATIVE STORE BYPASS DISABLE

HPG 2011 HIGH PERFORMANCE GRAPHICS HOT 3D

Pattern-based analytics to estimate and track yield risk of designs down to 7nm

ACCELERATING MATRIX PROCESSING WITH GPUs. Nicholas Malaya, Shuai Che, Joseph Greathouse, Rene van Oostrum, and Michael Schulte AMD Research

NEXT-GENERATION MATRIX 3D IMMERSIVE USER INTERFACE [ M3D-IUI ] H Raghavendra Swamy AMD Senior Software Engineer

DR. LISA SU

Multi-core processors are here, but how do you resolve data bottlenecks in native code?

MIGRATION OF LEGACY APPLICATIONS TO HETEROGENEOUS ARCHITECTURES Francois Bodin, CTO, CAPS Entreprise. June 2011

clarmor: A DYNAMIC BUFFER OVERFLOW DETECTOR FOR OPENCL KERNELS CHRIS ERB, JOE GREATHOUSE, MAY 16, 2018

HIGHLY PARALLEL COMPUTING IN PHYSICS-BASED RENDERING OpenCL Raytracing Based. Thibaut PRADOS OPTIS Real-Time & Virtual Reality Manager

Desktop Telepresence Arrived! Sudha Valluru ViVu CEO

AMD Radeon ProRender plug-in for Unreal Engine. Installation Guide

BIOMEDICAL DATA ANALYSIS ON HETEROGENEOUS PLATFORM. Dong Ping Zhang Heterogeneous System Architecture AMD

HPCA 18. Reliability-aware Data Placement for Heterogeneous memory Architecture

Gestural and Cinematic Interfaces - DX11. David Brebner Unlimited Realities CTO

Automatic Intra-Application Load Balancing for Heterogeneous Systems

Pacifica Next Generation Architecture for Efficient Virtual Machines

What is KVM? KVM patch. Modern hypervisors must do many things that are already done by OSs Scheduler, Memory management, I/O stacks

Introduction of AMD Advanced Virtual Interrupt Controller

The mobile computing evolution. The Griffin architecture. Memory enhancements. Power management. Thermal management

AMD AIB Partner Guidelines. Version February, 2015

1 HiPEAC January, 2012 Public TASKS, FUTURES AND ASYNCHRONOUS PROGRAMMING

An Introduction to Platform Security

Virtually Impossible

AMD S X86 OPEN64 COMPILER. Michael Lai AMD

Accelerating Applications. the art of maximum performance computing James Spooner Maxeler VP of Acceleration

Driver Options in AMD Radeon Pro Settings. User Guide

FUSION PROCESSORS AND HPC

STREAMING VIDEO DATA INTO 3D APPLICATIONS Session Christopher Mayer AMD Sr. Software Engineer

Intel Graphics Virtualization on KVM. Aug KVM Forum 2011 Rev. 3

Micro VMMs and Nested Virtualization

D3D12 & Vulkan: Lessons learned. Dr. Matthäus G. Chajdas Developer Technology Engineer, AMD

Computer Architecture Background

Heterogeneous Computing

User Manual. Nvidia Jetson Series Carrier board Aetina ACE-N622

64-bit ARM Unikernels on ukvm

Changing your Driver Options with Radeon Pro Settings. Quick Start User Guide v3.0

SUSE An introduction...

SCALING DGEMM TO MULTIPLE CAYMAN GPUS AND INTERLAGOS MANY-CORE CPUS FOR HPL

Red Hat Enterprise Virtualization Hypervisor Roadmap. Bhavna Sarathy Senior Technology Product Manager, Red Hat

GPGPU COMPUTE ON AMD. Udeepta Bordoloi April 6, 2011

Cilk Plus: Multicore extensions for C and C++

Resource Saving: Latest Innovation in Optimized Cloud Infrastructure

ARM-KVM: Weather Report Korea Linux Forum

STM/PE & XHIM. Eugene D. Myers Trust Mechanisms Information Assurance Research NSA/CSS Research Directorate May 24, 2018

Introducing NVDIMM-X: Designed to be the World s Fastest NAND-Based SSD Architecture and a Platform for the Next Generation of New Media SSDs

AMD Radeon ProRender plug-in for Universal Scene Description. Installation Guide

Introduction Construction State of the Art. Virtualization. Bernhard Kauer OS Group TU Dresden Dresden,

Changing your Driver Options with Radeon Pro Settings. Quick Start User Guide v2.1

Accelerating NVMe I/Os in Virtual Machine via SPDK vhost* Solution Ziye Yang, Changpeng Liu Senior software Engineer Intel

Transcription:

AMD SEV Update Linux Security Summit 2018 David Kaplan, Security Architect

WHY NOT TRUST THE HYPERVISOR? Guest Perspective o Hypervisor is code I don t control o I can t tell if the hypervisor is compromised o I have obligations to protect my data o o o o Financial data Customer data Health records Etc. o I want assurances of privacy Hypervisor Perspective o I need to convince more customers to use my services o I don t want to be able to see what customers are doing o I want to provide assurances of privacy o I want to limit my customer s exposures to bugs Security is a important concern for cloud growth 2 AMD SEV UPDATE LINUX SECURITY SUMMIT 2018

HARDWARE MEMORY ENCRYPTION - ATTACKS DEFENDED BY AMD SME + SEV Physical Access Attacks Admin Access Attacks Probe the physical DRAM interface Install HW device that accesses guest memory Freeze then steal DIMMs Steal NVDIMMs Administrator scrapes memory of guest data areas Administrator injects code into a guest VM Hypervisor bug allows hosted guest to steal data from other guests 3 AMD SEV UPDATE LINUX SECURITY SUMMIT 2018

AMD HARDWARE MEMORY ENCRYPTION SECURE ENCRYPTED VIRTUALIZATION (SEV) - COMPONENTS AMD Secure Processor Manages keys during VM lifecycle Runs SEV API firmware https://developer.amd.com/wp-content/resources/55766.pdf CPU Hypervisor AMD Secure Processor SOC Hypervisor Calls SEV API as needed for VM management Is protected with its own key Guest OS Chooses which pages to encrypt via page tables Guest OS Kernel VM Memory Controller Example Development Environment KVM/QEMU Hypervisor Linux Kernel for Guest OVMF (UEFI) for Guest BIOS SEV API (run in the AMD Secure Processor Firmware) Memory 4 AMD SEV UPDATE LINUX SECURITY SUMMIT 2018

DEMO <video> 5 AMD SEV UPDATE LINUX SECURITY SUMMIT 2018

SEV DEVELOPMENT UPDATE Feature Supported Version Notes SME (Host Encryption) Linux 4.14 SEV (Guest Support) Linux 4.15 OVMF >= July 6, 2018 SEV (KVM HV Support) Linux 4.16/QEMU 2.12 Libvirt 4.5 VirtIO support Linux 4.15 Not including virtio-gpu VirtIO-GPU support Linux 4.19/QEMU 3.1 SEV Guest Migration - Available on AMD Github SEV Tool - SEV Save & Restore - SEV-ES Support - Completed In Progress Ubuntu 18.04, Fedora 28, SLES 15 all are supported as SEV guests Fedora 28 and SLES 15 are supported as SEV hypervisors 6 AMD SEV UPDATE LINUX SECURITY SUMMIT 2018

SEV-ES ARCHITECTURE AT A GLANCE World switches now swap ALL register state Includes all segment registers, GPRs, FPU state (see Table B-4 in APM Vol2) All register state is encrypted with the guest encryption key Integrity value is calculated and stored in a protected page The guest is notified by a new exception (#VC) when certain events occur The guest decides what state (if any) to share with the HV The guest invokes the HV to perform the required tasks The guest updates its state based on the output from the HV VMCB Segment State Control State GPR State FPU State Hypervisor The guest and HV use a special structure to communicate Guest-Hypervisor Communication Block (GHCB) Location set by guest, mapped as unencrypted memory page GHCB #VC Handler Guest 7 AMD SEV UPDATE LINUX SECURITY SUMMIT 2018

TYPES OF EXITS Automatic Exits (AE) Events that occur asynchronously to the guest (e.g. interrupts) Events that do not require exposing guest state (e.g. HLT) Nested page faults not due to MMIO emulation AE events save all state and exit to HV Only action HV can do is just resume the guest w/o modifications Non-Automatic Exits (NAE) All other exit events NAE events cause a #VC instead of a VMEXIT Guest handler may invoke the HV via VMGEXIT instruction Code Name Notes HW Advances RIP 52h VMEXIT_MC Machine check exception No 60h VMEXIT_INTR Physical INTR No 61h VMEXIT_NMI Physical NMI No 63h VMEXIT_INIT Physical INIT No 64h VMEXIT_VINTR Virtual INTR No 77h VMEXIT_PAUSE PAUSE instruction Yes 78h VMEXIT_HLT HLT instruction Yes 7Fh VMEXIT_SHUTDOWN Shutdown No 8Fh VMEXIT_EFER_WRITE_TRAP Write to EFER Yes 90h- VMEXIT_CR[0-15]_WRITE_TRAP Write to CRx Yes 9Fh 400h VMEXIT_NPF Only if PFCODE[3]=0 (no No reserved bit error) 403h VMEXIT_VMGEXIT VMGEXIT instruction Yes -1 VMEXIT_INVALID Invalid guest state - 8 AMD SEV UPDATE LINUX SECURITY SUMMIT 2018

NAE FLOW EXAMPLE CPUID Guest CPU HW Hypervisor Guest triggers VMEXIT condition Read ErrorCode => CPUID Write CPUID_EXIT to GHCB Copy RAX to GHCB #VC handler copies state to GHCB VMGEXIT Send #VC to guest Save/encrypt guest state Load HV state HV handles exit VMRUN Read GHCB => see CPUID_EXIT Read RAX, emulate CPUID Write RAX/RBX/RCX/RDX to GHCB Copy RAX/RBX/RCX/RDX to register state #VC handler modifies state Save HV state Load/decrypt guest state IRET 9 AMD SEV UPDATE LINUX SECURITY SUMMIT 2018

GHCB SPECIFICATION To attempt to standardize guest<->hypervisor interfaces, AMD has distributed a proposed GHCB Software Specification (see https://developer.amd.com/sev/) GHCB Specification defines: Layout of GHCB memory page (4kb) What #VC exceptions guests are expected to handle (super-set of all supported HV intercepts) What values guests are expected to provide to the HV for each #VC What the HV is expected to provide on each VMGEXIT How SEV-ES guests are to be bootstrapped (including multi-vcpu environments) NMI handling for SEV-ES guests Goal: To the greatest extent possible, provide a unified interface across all guest OS s and hypervisors that support SEV-ES 10 AMD SEV UPDATE LINUX SECURITY SUMMIT 2018

GHCB PROTOCOL NAE Event State to Hypervisor State from Hypervisor Notes MSR_PROT (RDMSR) CPUID RCX SW_EXITCODE=0x7c SW_EXITINFO1=0 SW_EXITINFO2=0 RAX RCX XCR0 (for RAX=0xd) SW_EXITCODE=0x72 SW_EXITINFO1=0 SW_EXITINFO2=0 RAX RDX RAX RBX RCX RDX XCR0 is only required to be supplied when a request for CPUID 0000_000D is made. See proposed GHCB document for more details 11 AMD SEV UPDATE LINUX SECURITY SUMMIT 2018

FEEDBACK SO FAR GHCB Specification is still undergoing review, comments are welcome! Comments: GHCB memory layout matching VMCB layout -- Keeps hypervisor logic uniform, just changes where it gets values Required registers for most intercepts -- Hypervisors are very uniform in this area GHCB protocol negotiation -- Allow guest code to determine SEV-ES support at runtime Specific cases: VMMCALL AP startup Debug support SMM support 12 AMD SEV UPDATE LINUX SECURITY SUMMIT 2018

CONTAINERS WITH SEV HYPERVISOR-BASED RUNTIME WITH SEV Docker with runc (default) Docker with Kata Containers & SEV 13 AMD SEV UPDATE LINUX SECURITY SUMMIT 2018

DEMO: SEV RUNTIME DROP-IN REPLACEMENT FOR RUNC Docker with runc (default) Docker with SEV containers 14 AMD SEV UPDATE LINUX SECURITY SUMMIT 2018

CONCLUSION Upstream SEV work is progressing across multiple projects SEV-ES hardware is available today, software still in progress GHCB specification attempting to unify guest<->hypervisor para-virt interfaces Exploring other uses of SEV, such as with Kata Containers References: AMD SEV info (https://developer.amd.com/sev/) Github (with getting started scripts): https://github.com/amdese/amdsev Kata Container prototype: https://github.com/amdese/amdsev/tree/kata AMD64 Architecture Programmer s Manual Volume 2: System Programming (sections 7.10 and 15.34) Secure Encrypted Virtualization Key Management 15 AMD SEV UPDATE LINUX SECURITY SUMMIT 2018

DISCLAIMER & ATTRIBUTION The information presented in this document is for informational purposes only and may contain technical inaccuracies, omissions and typographical errors. The information contained herein is subject to change and may be rendered inaccurate for many reasons, including but not limited to product and roadmap changes, component and motherboard version changes, new model and/or product releases, product differences between differing manufacturers, software changes, BIOS flashes, firmware upgrades, or the like. AMD assumes no obligation to update or otherwise correct or revise this information. However, AMD reserves the right to revise this information and to make changes from time to time to the content hereof without obligation of AMD to notify any person of such revisions or changes. AMD MAKES NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE CONTENTS HEREOF AND ASSUMES NO RESPONSIBILITY FOR ANY INACCURACIES, ERRORS OR OMISSIONS THAT MAY APPEAR IN THIS INFORMATION. AMD SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE. IN NO EVENT WILL AMD BE LIABLE TO ANY PERSON FOR ANY DIRECT, INDIRECT, SPECIAL OR OTHER CONSEQUENTIAL DAMAGES ARISING FROM THE USE OF ANY INFORMATION CONTAINED HEREIN, EVEN IF AMD IS EXPRESSLY ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. ATTRIBUTION 2018 Advanced Micro Devices, Inc. All rights reserved. AMD, the AMD Arrow logo and combinations thereof are trademarks of Advanced Micro Devices, Inc. in the United States and/or other jurisdictions. ARM and Cortex are registered trademarks of ARM Limited in the UK and other countries. Other names are for informational purposes only and may be trademarks of their respective owners. 17 AMD SEV UPDATE LINUX SECURITY SUMMIT 2018