SlideShare a Scribd company logo
1 of 18
Download to read offline
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 hypervisorProject ACRN
 
Project ACRN Device Model architecture introduction
Project ACRN Device Model architecture introductionProject ACRN Device Model architecture introduction
Project ACRN Device Model architecture introductionProject ACRN
 
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
 
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 introductionProject 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 introductionProject 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 toolProject 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 enablingProject ACRN
 
Hardware support for efficient virtualization
Hardware support for efficient virtualizationHardware support for efficient virtualization
Hardware support for efficient virtualizationLennox Wu
 
Project ACRN Device Passthrough Introduction
Project ACRN Device Passthrough IntroductionProject ACRN Device Passthrough Introduction
Project ACRN Device Passthrough IntroductionProject 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 BootProject 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 OverviewOpenCity 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 introductionProject 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 GuideVeeam Software
 
Virtualization & Network Connectivity
Virtualization & Network Connectivity Virtualization & Network Connectivity
Virtualization & Network Connectivity itplant
 
RHEL5 XEN HandOnTraining_v0.4.pdf
RHEL5 XEN HandOnTraining_v0.4.pdfRHEL5 XEN HandOnTraining_v0.4.pdf
RHEL5 XEN HandOnTraining_v0.4.pdfPaul 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 XenTamas K Lengyel
 
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.pdfaaajjj4
 
XS Boston 2008 Networking Direct Assignment
XS Boston 2008 Networking Direct AssignmentXS Boston 2008 Networking Direct Assignment
XS Boston 2008 Networking Direct AssignmentThe Linux Foundation
 
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 XenThe 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 Pavlicekbuildacloud
 
S4 xen hypervisor_20080622
S4 xen hypervisor_20080622S4 xen hypervisor_20080622
S4 xen hypervisor_20080622Todd Deshane
 
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 GuideKingfin Enterprises Limited
 

Similar to Device virtualization and management in xen (20)

RMLL / LSM 2009
RMLL / LSM 2009RMLL / LSM 2009
RMLL / LSM 2009
 
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
 
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
 
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
 
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
 
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 presentationLingfei Kong
 
It经典图书(附免费下载地址)
It经典图书(附免费下载地址)It经典图书(附免费下载地址)
It经典图书(附免费下载地址)Lingfei Kong
 
Shell实现的windows回收站功能的脚本
Shell实现的windows回收站功能的脚本Shell实现的windows回收站功能的脚本
Shell实现的windows回收站功能的脚本Lingfei Kong
 
Python学习笔记
Python学习笔记Python学习笔记
Python学习笔记Lingfei Kong
 
Congfigure python as_ide
Congfigure python as_ideCongfigure python as_ide
Congfigure python as_ideLingfei 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

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 

Recently uploaded (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

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