SlideShare a Scribd company logo
Device Virtualization and Management in Xen 
Lingfei Kong 
2014-11-10 
Contents 
1 Device Virtualization and Management in Xen 2 
1.1 Note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 
2 Agenda 3 
3 Xen Virtualizaiton Architecture 4 
3.1 Note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 
4 Device Virtualization 4 
4.1 Note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 
5 Paravirtualization of Devices 4 
6 Backends and Frontends 6 
7 Backends and Frontends 7 
7.1 Note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 
8 Backends and Frontends - Device Initialization 10 
8.1 Note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 
9 Backends and Frontends - Device Closedown 11 
10 Backends and Frontends - Device Closedown 13 
11 Full Virtualization of Devices 14 
11.1 Note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 
12 No Virtualization 15 
1
13 No Virtualization 16 
13.1 Note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 
14 No Virtualization 17 
14.1 Note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 
15 Reference 18 
16 Q & A 18 
1 Device Virtualization and Management in Xen 
slide 
2
1.1 Note notes 
• All test cases: 268, related to device: 100, The are important cases 
2 Agenda slide 
• Xen Virtualization Architecture 
• Device Virtualization 
• Paravirtualization of Devices 
• Backends and Frontends 
• Backends and Frontends - Device Initialization 
• Backends and Frontends - Device Closedown 
• Full Virtualization of Devices 
• No Virtualization 
• Q & A 
• Reference 
3
3 Xen Virtualizaiton Architecture slide 
3.1 Note notes 
• 3 layers 
4 Device Virtualization slide 
• Paravirtualization of Devices 
• Full Virtualization of Devices 
• No Virtualization 
4.1 Note notes 
5 Paravirtualization of Devices slide 
• General approach to device management 
4
• Dom0 manages the actual device driver and exports a generic class of 
device 
• Use Backend/Frontend model 
• PV on HVM 
– From rhel6 
* xen_emul_unplug=never -> this will force guest to use em-ulated 
devices 
* xen_emul_unplug=unnecessary -> will use pv driver if there 
are xen pv drivers loaded 
• Advantage of Paravirtualization Devices: 
– Allows guest operating systems to implement only one device 
driver for each generic class of devices 
– Much easier to make a new operating system usable 
– Similar performance to physical machine > 90% 
• Each virtual device has three major components 
– A shared memory page containing the ring buffers 
– An event channel signaling activity in the ring 
– A XenStore entry containing configuration information 
5
6 Backends and Frontends slide 
• Guest issues device request to frontend driver, frontend driver commu-nicates 
with backend driver. 
Backend queues up the request and eventually issues the request to the 
actual underlying hardware 
• Backend 
– Runs in privileged domain 
– Multiplexing the use of the device 
– Responsible for protecting the security and privacy of data 
• Frontend 
– Runs in unpriviledge guests 
– Need pv drivers installed on guest os 
6
7 Backends and Frontends slide 
• XenBus and XenStore 
– XenBus provides a bus abstraction for paravirtualized drivers to 
communicate between backend/frontend drivers 
– Use XenStore to exchange the basic parameters needed to make 
the connection between frontend and backend drivers 
– Both user space and kernel code can write to the XenStore.The 
kernel code writes to the XenStore by using XenBus. 
* xenstore-ls, xenstore-list, xenstore-read, xenstore-write, xenstore-r 
– Glance of XenStore 
7
– Backend and Frontend connect(take block device driver for exam-ple) 
7.1 Note notes 
• /vm/uuid/{image,device,shadow_memory,uuid,on_crash,on_reboot,start_time,on_poweroff,name,• /vm/uuid/image/{ostype,kernel,cmdline,ramdisk} 
• /vm/uuid/device/{frontend,frontend-id,backend-id,backend} 
• local/domain 
8
9
8 Backends and Frontends - Device Initialization 
slide 
10
8.1 Note notes 
• The details to be written are: 
The details to be written are: 
/local/domain/0/backend/vbd/U/<deviceID>/... 
frontend /local/domain/U/device/vbd/<deviceID> 
frontend-id U 
state XenbusStateInitialising 
... <device-specific details> 
/local/domain/U/device/vbd/<deviceID>/... 
backend /local/domain/0/backend/vbd/U/<deviceID> 
backend-id 0 
state XenbusStateInitialising 
... <device-specific details> 
• netback_probe(), blkback_prob() 
• page map, page transfer 
9 Backends and Frontends - Device Closedown 
slide 
• Device unplug request to Xend 
11
12
10 Backends and Frontends - Device Closedown 
slide 
• Device driver encounter an error 
13
11 Full Virtualization of Devices slide 
• Use actual device driver to communicate with the emulated device 
14
• No need pv/frontend drivers installed on guest os 
• Use qemu-dm to provide device emulation for HVM guests with virtu-alization 
extensions such as Intel-VT or AMD-V 
• Disadvantage of full virtualization devices 
– Less portable than the paravirtualized model 
– Less performance than the paravirtualized mode 
11.1 Note notes 
• VT-x add 10 opcodes, such as: VMCALL, VMXON, VMXOFF, VM-RESUME, 
VMWRITE, VMREAD 
• AMD-V add 8 opcodes 
• VMD-V, IOMMU, VT-D 
• VMCS, VMCB 
• There is of course a performance cost for using QEMU, so there are 
chances that usage of QEMU will be replaced in the future with dif-ferent 
soulutions which have lower performance costs. 
• SVM stands for "Secure Virtual Machine". 
12 No Virtualization slide 
• Grant physical devices directly to an unprivileged domain 
15
• The guest (domU) needs to have a driver for the actual PCI device, 
PV guests also need to have a generic Xen PCI frontend driver. 
• Xen PCI passthru to a PV (paravirtual) guest 
– If you want DMA 
* Add "swiotlb=force" to guest’s kernel command line 
– PCI quirks 
* No permission 
pciback 0000:08:00.0: Driver tried to write to a read-only 
configuration space field at offset 0xe0, size 2. This may be 
harmless, but if you have problems with your device: 
* lspci -nn 
* Add vendor id to /etc/xen/xend-pci-permissive.sxp 
13 No Virtualization slide 
• Xen PCI passthru to an HVM (fully virtualized) guest 
– No special configuration for the guest kernel 
• Granting Control of a PCI Device 
– PCI pass-through 
* Enable VT-d in BIOS 
* Hide PCI Device from Dom0 
16
#lspci -D |grep USB 
0000:00:0b.0 USB controller: NVIDIA Corporation MCP51 USB Controller (rev 0000:00:0b.1 USB controller: NVIDIA Corporation MCP51 USB Controller (rev # echo 0000:00:0b.1 > /sys/bus/pci/devices/0000:00:0b.1/driver/unbind 
13.1 Note notes 
• NIC, disk controller, HBA, USB controller, firewire controller, sound-card, 
etc 
14 No Virtualization slide 
• – * Binding the PCI Device to pciback driver 
# modprobe pciback 
# lsmod |grep pciback 
pciback 65617 0 
# echo 0000:00:0b.1 > /sys/bus/pci/drivers/pciback/new_slot 
# echo 0000:00:0b.1 > /sys/bus/pci/drivers/pciback/bind 
* Check the hidden PCI Device 
# xm pci-list-assignable-devices 
0000:00:0b.1 
* Granting the PCI Device to Another Domain 
# xm pci-detach <guest> <pci device> 
14.1 Note 
• <domain>:<bus>:<slot>.<function>: domain refers to a PCI do-main 
not xen domain 
• 
17
15 Reference slide 
• Block device model 
• PCI pass-through 
• Xen PCI Passthrough 
• XenStore 
• Backend and Fontend 
• Virtualization Background 
• Driver Domain 
16 Q & A slide 
18

More Related Content

What's hot

ACRN vMeet-Up EU 2021 - debug ACRN hypervisor
ACRN vMeet-Up EU 2021 - debug ACRN hypervisorACRN vMeet-Up EU 2021 - debug ACRN hypervisor
ACRN vMeet-Up EU 2021 - debug ACRN hypervisor
Project ACRN
 
Project ACRN Device Model architecture introduction
Project ACRN Device Model architecture introductionProject ACRN Device Model architecture introduction
Project ACRN Device Model architecture introduction
Project ACRN
 
XS Boston 2008 OpenSolaris
XS Boston 2008 OpenSolarisXS Boston 2008 OpenSolaris
XS Boston 2008 OpenSolaris
The Linux Foundation
 
Virtualization basics
Virtualization basics Virtualization basics
Virtualization basics
Chandrani Ray Chowdhury
 
ACRN vMeet-Up EU 2021 - Bridging Orchestrator and Hard Realtime Workload Cons...
ACRN vMeet-Up EU 2021 - Bridging Orchestrator and Hard Realtime Workload Cons...ACRN vMeet-Up EU 2021 - Bridging Orchestrator and Hard Realtime Workload Cons...
ACRN vMeet-Up EU 2021 - Bridging Orchestrator and Hard Realtime Workload Cons...
Project ACRN
 
Virtualization
VirtualizationVirtualization
Virtualization
Edris Nasihat Kon
 
XS Japan 2008 BitVisor English
XS Japan 2008 BitVisor EnglishXS Japan 2008 BitVisor English
XS Japan 2008 BitVisor English
The Linux Foundation
 
Hardware supports for Virtualization
Hardware supports for VirtualizationHardware supports for Virtualization
Hardware supports for VirtualizationYoonje Choi
 
ACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introduction
ACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introductionACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introduction
ACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introduction
Project ACRN
 
Project ACRN Yocto Project meta-acrn layer introduction
Project ACRN Yocto Project meta-acrn layer introductionProject ACRN Yocto Project meta-acrn layer introduction
Project ACRN Yocto Project meta-acrn layer introduction
Project ACRN
 
Project ACRN configuration scenarios and config tool
Project ACRN configuration scenarios and config toolProject ACRN configuration scenarios and config tool
Project ACRN configuration scenarios and config tool
Project ACRN
 
ACRN vMeet-Up EU 2021 - hypervisor new platform enabling
ACRN vMeet-Up EU 2021 - hypervisor new platform enablingACRN vMeet-Up EU 2021 - hypervisor new platform enabling
ACRN vMeet-Up EU 2021 - hypervisor new platform enabling
Project ACRN
 
Hardware support for efficient virtualization
Hardware support for efficient virtualizationHardware support for efficient virtualization
Hardware support for efficient virtualization
Lennox Wu
 
Project ACRN Device Passthrough Introduction
Project ACRN Device Passthrough IntroductionProject ACRN Device Passthrough Introduction
Project ACRN Device Passthrough Introduction
Project ACRN
 
XPDS16: Display Handler, a Client Display Framework for Xen - Brendan Kerrig...
XPDS16:  Display Handler, a Client Display Framework for Xen - Brendan Kerrig...XPDS16:  Display Handler, a Client Display Framework for Xen - Brendan Kerrig...
XPDS16: Display Handler, a Client Display Framework for Xen - Brendan Kerrig...
The Linux Foundation
 
ACRN vMeet-Up EU 2021 - Boot Process and Secure Boot
ACRN vMeet-Up EU 2021 - Boot Process and Secure BootACRN vMeet-Up EU 2021 - Boot Process and Secure Boot
ACRN vMeet-Up EU 2021 - Boot Process and Secure Boot
Project ACRN
 
2014.08.30 Virtual Machine Threat 세미나
2014.08.30 Virtual Machine Threat 세미나2014.08.30 Virtual Machine Threat 세미나
2014.08.30 Virtual Machine Threat 세미나
용환 노
 
Virtualization Technology Overview
Virtualization Technology OverviewVirtualization Technology Overview
Virtualization Technology Overview
OpenCity Community
 
ACRN vMeet-Up EU 2021 - installation and configuration introduction
ACRN vMeet-Up EU 2021 - installation and configuration introductionACRN vMeet-Up EU 2021 - installation and configuration introduction
ACRN vMeet-Up EU 2021 - installation and configuration introduction
Project ACRN
 

What's hot (20)

ACRN vMeet-Up EU 2021 - debug ACRN hypervisor
ACRN vMeet-Up EU 2021 - debug ACRN hypervisorACRN vMeet-Up EU 2021 - debug ACRN hypervisor
ACRN vMeet-Up EU 2021 - debug ACRN hypervisor
 
Project ACRN Device Model architecture introduction
Project ACRN Device Model architecture introductionProject ACRN Device Model architecture introduction
Project ACRN Device Model architecture introduction
 
XS Boston 2008 OpenSolaris
XS Boston 2008 OpenSolarisXS Boston 2008 OpenSolaris
XS Boston 2008 OpenSolaris
 
[ppt]
[ppt][ppt]
[ppt]
 
Virtualization basics
Virtualization basics Virtualization basics
Virtualization basics
 
ACRN vMeet-Up EU 2021 - Bridging Orchestrator and Hard Realtime Workload Cons...
ACRN vMeet-Up EU 2021 - Bridging Orchestrator and Hard Realtime Workload Cons...ACRN vMeet-Up EU 2021 - Bridging Orchestrator and Hard Realtime Workload Cons...
ACRN vMeet-Up EU 2021 - Bridging Orchestrator and Hard Realtime Workload Cons...
 
Virtualization
VirtualizationVirtualization
Virtualization
 
XS Japan 2008 BitVisor English
XS Japan 2008 BitVisor EnglishXS Japan 2008 BitVisor English
XS Japan 2008 BitVisor English
 
Hardware supports for Virtualization
Hardware supports for VirtualizationHardware supports for Virtualization
Hardware supports for Virtualization
 
ACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introduction
ACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introductionACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introduction
ACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introduction
 
Project ACRN Yocto Project meta-acrn layer introduction
Project ACRN Yocto Project meta-acrn layer introductionProject ACRN Yocto Project meta-acrn layer introduction
Project ACRN Yocto Project meta-acrn layer introduction
 
Project ACRN configuration scenarios and config tool
Project ACRN configuration scenarios and config toolProject ACRN configuration scenarios and config tool
Project ACRN configuration scenarios and config tool
 
ACRN vMeet-Up EU 2021 - hypervisor new platform enabling
ACRN vMeet-Up EU 2021 - hypervisor new platform enablingACRN vMeet-Up EU 2021 - hypervisor new platform enabling
ACRN vMeet-Up EU 2021 - hypervisor new platform enabling
 
Hardware support for efficient virtualization
Hardware support for efficient virtualizationHardware support for efficient virtualization
Hardware support for efficient virtualization
 
Project ACRN Device Passthrough Introduction
Project ACRN Device Passthrough IntroductionProject ACRN Device Passthrough Introduction
Project ACRN Device Passthrough Introduction
 
XPDS16: Display Handler, a Client Display Framework for Xen - Brendan Kerrig...
XPDS16:  Display Handler, a Client Display Framework for Xen - Brendan Kerrig...XPDS16:  Display Handler, a Client Display Framework for Xen - Brendan Kerrig...
XPDS16: Display Handler, a Client Display Framework for Xen - Brendan Kerrig...
 
ACRN vMeet-Up EU 2021 - Boot Process and Secure Boot
ACRN vMeet-Up EU 2021 - Boot Process and Secure BootACRN vMeet-Up EU 2021 - Boot Process and Secure Boot
ACRN vMeet-Up EU 2021 - Boot Process and Secure Boot
 
2014.08.30 Virtual Machine Threat 세미나
2014.08.30 Virtual Machine Threat 세미나2014.08.30 Virtual Machine Threat 세미나
2014.08.30 Virtual Machine Threat 세미나
 
Virtualization Technology Overview
Virtualization Technology OverviewVirtualization Technology Overview
Virtualization Technology Overview
 
ACRN vMeet-Up EU 2021 - installation and configuration introduction
ACRN vMeet-Up EU 2021 - installation and configuration introductionACRN vMeet-Up EU 2021 - installation and configuration introduction
ACRN vMeet-Up EU 2021 - installation and configuration introduction
 

Similar to Device virtualization and management in xen

Rmll Virtualization As Is Tool 20090707 V1.0
Rmll Virtualization As Is Tool 20090707 V1.0Rmll Virtualization As Is Tool 20090707 V1.0
Rmll Virtualization As Is Tool 20090707 V1.0guest72e8c1
 
Virtualization, The future of computing (archived)
Virtualization, The future of computing (archived)Virtualization, The future of computing (archived)
Virtualization, The future of computing (archived)
Bud Siddhisena
 
PCI Pass-through - FreeBSD VM on Hyper-V (MeetBSD California 2016)
PCI Pass-through - FreeBSD VM on Hyper-V (MeetBSD California 2016)PCI Pass-through - FreeBSD VM on Hyper-V (MeetBSD California 2016)
PCI Pass-through - FreeBSD VM on Hyper-V (MeetBSD California 2016)
iXsystems
 
The Unofficial VCAP / VCP VMware Study Guide
The Unofficial VCAP / VCP VMware Study GuideThe Unofficial VCAP / VCP VMware Study Guide
The Unofficial VCAP / VCP VMware Study Guide
Veeam Software
 
Virtualization & Network Connectivity
Virtualization & Network Connectivity Virtualization & Network Connectivity
Virtualization & Network Connectivity
itplant
 
VSS-2.pdf
VSS-2.pdfVSS-2.pdf
VSS-2.pdf
RiyaBatool
 
SR-IOV Introduce
SR-IOV IntroduceSR-IOV Introduce
SR-IOV Introduce
Lingfei Kong
 
RHEL5 XEN HandOnTraining_v0.4.pdf
RHEL5 XEN HandOnTraining_v0.4.pdfRHEL5 XEN HandOnTraining_v0.4.pdf
RHEL5 XEN HandOnTraining_v0.4.pdf
Paul Yang
 
2virtualizationtechnologyoverview 13540659831745-phpapp02-121127193019-phpapp01
2virtualizationtechnologyoverview 13540659831745-phpapp02-121127193019-phpapp012virtualizationtechnologyoverview 13540659831745-phpapp02-121127193019-phpapp01
2virtualizationtechnologyoverview 13540659831745-phpapp02-121127193019-phpapp01Vietnam Open Infrastructure User Group
 
OffensiveCon2022: Case Studies of Fuzzing with Xen
OffensiveCon2022: Case Studies of Fuzzing with XenOffensiveCon2022: Case Studies of Fuzzing with Xen
OffensiveCon2022: Case Studies of Fuzzing with Xen
Tamas K Lengyel
 
Xen revisited
Xen revisitedXen revisited
Xen revisited
Shahbaz Sidhu
 
Storage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdf
Storage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdfStorage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdf
Storage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdf
aaajjj4
 
Fuzzing_with_Xen.pdf
Fuzzing_with_Xen.pdfFuzzing_with_Xen.pdf
Fuzzing_with_Xen.pdf
distortdistort
 
XS Boston 2008 Networking Direct Assignment
XS Boston 2008 Networking Direct AssignmentXS Boston 2008 Networking Direct Assignment
XS Boston 2008 Networking Direct Assignment
The Linux Foundation
 
Securing Your Cloud With the Xen Hypervisor by Russell Pavlicek
Securing Your Cloud With the Xen Hypervisor by Russell PavlicekSecuring Your Cloud With the Xen Hypervisor by Russell Pavlicek
Securing Your Cloud With the Xen Hypervisor by Russell Pavlicek
buildacloud
 
Build-a-Cloud Day - Securing Your Cloud with Xen
Build-a-Cloud Day - Securing Your Cloud with XenBuild-a-Cloud Day - Securing Your Cloud with Xen
Build-a-Cloud Day - Securing Your Cloud with Xen
The Linux Foundation
 
S4 xen hypervisor_20080622
S4 xen hypervisor_20080622S4 xen hypervisor_20080622
S4 xen hypervisor_20080622Todd Deshane
 
XS Boston 2008 Self IO Emulation
XS Boston 2008 Self IO EmulationXS Boston 2008 Self IO Emulation
XS Boston 2008 Self IO Emulation
The Linux Foundation
 
Microsoft Windows Server 2012 Early Adopter Guide
Microsoft Windows Server 2012 Early Adopter GuideMicrosoft Windows Server 2012 Early Adopter Guide
Microsoft Windows Server 2012 Early Adopter Guide
Kingfin Enterprises Limited
 

Similar to Device virtualization and management in xen (20)

Rmll Virtualization As Is Tool 20090707 V1.0
Rmll Virtualization As Is Tool 20090707 V1.0Rmll Virtualization As Is Tool 20090707 V1.0
Rmll Virtualization As Is Tool 20090707 V1.0
 
RMLL / LSM 2009
RMLL / LSM 2009RMLL / LSM 2009
RMLL / LSM 2009
 
Virtualization, The future of computing (archived)
Virtualization, The future of computing (archived)Virtualization, The future of computing (archived)
Virtualization, The future of computing (archived)
 
PCI Pass-through - FreeBSD VM on Hyper-V (MeetBSD California 2016)
PCI Pass-through - FreeBSD VM on Hyper-V (MeetBSD California 2016)PCI Pass-through - FreeBSD VM on Hyper-V (MeetBSD California 2016)
PCI Pass-through - FreeBSD VM on Hyper-V (MeetBSD California 2016)
 
The Unofficial VCAP / VCP VMware Study Guide
The Unofficial VCAP / VCP VMware Study GuideThe Unofficial VCAP / VCP VMware Study Guide
The Unofficial VCAP / VCP VMware Study Guide
 
Virtualization & Network Connectivity
Virtualization & Network Connectivity Virtualization & Network Connectivity
Virtualization & Network Connectivity
 
VSS-2.pdf
VSS-2.pdfVSS-2.pdf
VSS-2.pdf
 
SR-IOV Introduce
SR-IOV IntroduceSR-IOV Introduce
SR-IOV Introduce
 
RHEL5 XEN HandOnTraining_v0.4.pdf
RHEL5 XEN HandOnTraining_v0.4.pdfRHEL5 XEN HandOnTraining_v0.4.pdf
RHEL5 XEN HandOnTraining_v0.4.pdf
 
2virtualizationtechnologyoverview 13540659831745-phpapp02-121127193019-phpapp01
2virtualizationtechnologyoverview 13540659831745-phpapp02-121127193019-phpapp012virtualizationtechnologyoverview 13540659831745-phpapp02-121127193019-phpapp01
2virtualizationtechnologyoverview 13540659831745-phpapp02-121127193019-phpapp01
 
OffensiveCon2022: Case Studies of Fuzzing with Xen
OffensiveCon2022: Case Studies of Fuzzing with XenOffensiveCon2022: Case Studies of Fuzzing with Xen
OffensiveCon2022: Case Studies of Fuzzing with Xen
 
Xen revisited
Xen revisitedXen revisited
Xen revisited
 
Storage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdf
Storage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdfStorage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdf
Storage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdf
 
Fuzzing_with_Xen.pdf
Fuzzing_with_Xen.pdfFuzzing_with_Xen.pdf
Fuzzing_with_Xen.pdf
 
XS Boston 2008 Networking Direct Assignment
XS Boston 2008 Networking Direct AssignmentXS Boston 2008 Networking Direct Assignment
XS Boston 2008 Networking Direct Assignment
 
Securing Your Cloud With the Xen Hypervisor by Russell Pavlicek
Securing Your Cloud With the Xen Hypervisor by Russell PavlicekSecuring Your Cloud With the Xen Hypervisor by Russell Pavlicek
Securing Your Cloud With the Xen Hypervisor by Russell Pavlicek
 
Build-a-Cloud Day - Securing Your Cloud with Xen
Build-a-Cloud Day - Securing Your Cloud with XenBuild-a-Cloud Day - Securing Your Cloud with Xen
Build-a-Cloud Day - Securing Your Cloud with Xen
 
S4 xen hypervisor_20080622
S4 xen hypervisor_20080622S4 xen hypervisor_20080622
S4 xen hypervisor_20080622
 
XS Boston 2008 Self IO Emulation
XS Boston 2008 Self IO EmulationXS Boston 2008 Self IO Emulation
XS Boston 2008 Self IO Emulation
 
Microsoft Windows Server 2012 Early Adopter Guide
Microsoft Windows Server 2012 Early Adopter GuideMicrosoft Windows Server 2012 Early Adopter Guide
Microsoft Windows Server 2012 Early Adopter Guide
 

More from Lingfei Kong

Emacs presentation
Emacs presentationEmacs presentation
Emacs presentation
Lingfei Kong
 
It经典图书(附免费下载地址)
It经典图书(附免费下载地址)It经典图书(附免费下载地址)
It经典图书(附免费下载地址)
Lingfei Kong
 
Shell实现的windows回收站功能的脚本
Shell实现的windows回收站功能的脚本Shell实现的windows回收站功能的脚本
Shell实现的windows回收站功能的脚本
Lingfei Kong
 
Python学习笔记
Python学习笔记Python学习笔记
Python学习笔记
Lingfei Kong
 
Kdump
KdumpKdump
Congfigure python as_ide
Congfigure python as_ideCongfigure python as_ide
Congfigure python as_ide
Lingfei Kong
 

More from Lingfei Kong (7)

Emacs presentation
Emacs presentationEmacs presentation
Emacs presentation
 
It经典图书(附免费下载地址)
It经典图书(附免费下载地址)It经典图书(附免费下载地址)
It经典图书(附免费下载地址)
 
Shell实现的windows回收站功能的脚本
Shell实现的windows回收站功能的脚本Shell实现的windows回收站功能的脚本
Shell实现的windows回收站功能的脚本
 
Python学习笔记
Python学习笔记Python学习笔记
Python学习笔记
 
Kdump
KdumpKdump
Kdump
 
Congfigure python as_ide
Congfigure python as_ideCongfigure python as_ide
Congfigure python as_ide
 
Emacs tutorial
Emacs tutorialEmacs tutorial
Emacs tutorial
 

Recently uploaded

UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 

Recently uploaded (20)

UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 

Device virtualization and management in xen

  • 1. Device Virtualization and Management in Xen Lingfei Kong 2014-11-10 Contents 1 Device Virtualization and Management in Xen 2 1.1 Note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2 Agenda 3 3 Xen Virtualizaiton Architecture 4 3.1 Note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 4 Device Virtualization 4 4.1 Note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 5 Paravirtualization of Devices 4 6 Backends and Frontends 6 7 Backends and Frontends 7 7.1 Note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 8 Backends and Frontends - Device Initialization 10 8.1 Note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 9 Backends and Frontends - Device Closedown 11 10 Backends and Frontends - Device Closedown 13 11 Full Virtualization of Devices 14 11.1 Note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 12 No Virtualization 15 1
  • 2. 13 No Virtualization 16 13.1 Note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 14 No Virtualization 17 14.1 Note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 15 Reference 18 16 Q & A 18 1 Device Virtualization and Management in Xen slide 2
  • 3. 1.1 Note notes • All test cases: 268, related to device: 100, The are important cases 2 Agenda slide • Xen Virtualization Architecture • Device Virtualization • Paravirtualization of Devices • Backends and Frontends • Backends and Frontends - Device Initialization • Backends and Frontends - Device Closedown • Full Virtualization of Devices • No Virtualization • Q & A • Reference 3
  • 4. 3 Xen Virtualizaiton Architecture slide 3.1 Note notes • 3 layers 4 Device Virtualization slide • Paravirtualization of Devices • Full Virtualization of Devices • No Virtualization 4.1 Note notes 5 Paravirtualization of Devices slide • General approach to device management 4
  • 5. • Dom0 manages the actual device driver and exports a generic class of device • Use Backend/Frontend model • PV on HVM – From rhel6 * xen_emul_unplug=never -> this will force guest to use em-ulated devices * xen_emul_unplug=unnecessary -> will use pv driver if there are xen pv drivers loaded • Advantage of Paravirtualization Devices: – Allows guest operating systems to implement only one device driver for each generic class of devices – Much easier to make a new operating system usable – Similar performance to physical machine > 90% • Each virtual device has three major components – A shared memory page containing the ring buffers – An event channel signaling activity in the ring – A XenStore entry containing configuration information 5
  • 6. 6 Backends and Frontends slide • Guest issues device request to frontend driver, frontend driver commu-nicates with backend driver. Backend queues up the request and eventually issues the request to the actual underlying hardware • Backend – Runs in privileged domain – Multiplexing the use of the device – Responsible for protecting the security and privacy of data • Frontend – Runs in unpriviledge guests – Need pv drivers installed on guest os 6
  • 7. 7 Backends and Frontends slide • XenBus and XenStore – XenBus provides a bus abstraction for paravirtualized drivers to communicate between backend/frontend drivers – Use XenStore to exchange the basic parameters needed to make the connection between frontend and backend drivers – Both user space and kernel code can write to the XenStore.The kernel code writes to the XenStore by using XenBus. * xenstore-ls, xenstore-list, xenstore-read, xenstore-write, xenstore-r – Glance of XenStore 7
  • 8. – Backend and Frontend connect(take block device driver for exam-ple) 7.1 Note notes • /vm/uuid/{image,device,shadow_memory,uuid,on_crash,on_reboot,start_time,on_poweroff,name,• /vm/uuid/image/{ostype,kernel,cmdline,ramdisk} • /vm/uuid/device/{frontend,frontend-id,backend-id,backend} • local/domain 8
  • 9. 9
  • 10. 8 Backends and Frontends - Device Initialization slide 10
  • 11. 8.1 Note notes • The details to be written are: The details to be written are: /local/domain/0/backend/vbd/U/<deviceID>/... frontend /local/domain/U/device/vbd/<deviceID> frontend-id U state XenbusStateInitialising ... <device-specific details> /local/domain/U/device/vbd/<deviceID>/... backend /local/domain/0/backend/vbd/U/<deviceID> backend-id 0 state XenbusStateInitialising ... <device-specific details> • netback_probe(), blkback_prob() • page map, page transfer 9 Backends and Frontends - Device Closedown slide • Device unplug request to Xend 11
  • 12. 12
  • 13. 10 Backends and Frontends - Device Closedown slide • Device driver encounter an error 13
  • 14. 11 Full Virtualization of Devices slide • Use actual device driver to communicate with the emulated device 14
  • 15. • No need pv/frontend drivers installed on guest os • Use qemu-dm to provide device emulation for HVM guests with virtu-alization extensions such as Intel-VT or AMD-V • Disadvantage of full virtualization devices – Less portable than the paravirtualized model – Less performance than the paravirtualized mode 11.1 Note notes • VT-x add 10 opcodes, such as: VMCALL, VMXON, VMXOFF, VM-RESUME, VMWRITE, VMREAD • AMD-V add 8 opcodes • VMD-V, IOMMU, VT-D • VMCS, VMCB • There is of course a performance cost for using QEMU, so there are chances that usage of QEMU will be replaced in the future with dif-ferent soulutions which have lower performance costs. • SVM stands for "Secure Virtual Machine". 12 No Virtualization slide • Grant physical devices directly to an unprivileged domain 15
  • 16. • The guest (domU) needs to have a driver for the actual PCI device, PV guests also need to have a generic Xen PCI frontend driver. • Xen PCI passthru to a PV (paravirtual) guest – If you want DMA * Add "swiotlb=force" to guest’s kernel command line – PCI quirks * No permission pciback 0000:08:00.0: Driver tried to write to a read-only configuration space field at offset 0xe0, size 2. This may be harmless, but if you have problems with your device: * lspci -nn * Add vendor id to /etc/xen/xend-pci-permissive.sxp 13 No Virtualization slide • Xen PCI passthru to an HVM (fully virtualized) guest – No special configuration for the guest kernel • Granting Control of a PCI Device – PCI pass-through * Enable VT-d in BIOS * Hide PCI Device from Dom0 16
  • 17. #lspci -D |grep USB 0000:00:0b.0 USB controller: NVIDIA Corporation MCP51 USB Controller (rev 0000:00:0b.1 USB controller: NVIDIA Corporation MCP51 USB Controller (rev # echo 0000:00:0b.1 > /sys/bus/pci/devices/0000:00:0b.1/driver/unbind 13.1 Note notes • NIC, disk controller, HBA, USB controller, firewire controller, sound-card, etc 14 No Virtualization slide • – * Binding the PCI Device to pciback driver # modprobe pciback # lsmod |grep pciback pciback 65617 0 # echo 0000:00:0b.1 > /sys/bus/pci/drivers/pciback/new_slot # echo 0000:00:0b.1 > /sys/bus/pci/drivers/pciback/bind * Check the hidden PCI Device # xm pci-list-assignable-devices 0000:00:0b.1 * Granting the PCI Device to Another Domain # xm pci-detach <guest> <pci device> 14.1 Note • <domain>:<bus>:<slot>.<function>: domain refers to a PCI do-main not xen domain • 17
  • 18. 15 Reference slide • Block device model • PCI pass-through • Xen PCI Passthrough • XenStore • Backend and Fontend • Virtualization Background • Driver Domain 16 Q & A slide 18