SlideShare une entreprise Scribd logo
1  sur  18
Télécharger pour lire hors ligne
kexec/kdump implementation in
         Linux Kernel and Xen hypervisor
           usage, history and current developments


Sponsored by:

                &
Agenda


•What is kexec and kdump ?
•History of kexec/kdump development in Linux Kernel and Xen.
•Current developments.
•Future plans.
•Resources.
•Questions and Answers ?
What is kexec and kdump ?




•kexec and kdump are companions.
•kdump uses most of the code from kexec.
•kexec allows machine restart without jumping into BIOS.
•kdump eases kernel debugging when running system was crashed.
What is kexec ?
•kexec allows machine restart without jumping into BIOS.
•It greatly speeds up system initialization.
•kexec does not care about current system state.
•It is role of administrator to prepare system for restart.
•BIOS does not initialize the devices.
•Can lead to unpredictable state when devices were not properly
shutdown.
•Load specified kernel and other modules (if user requires it) into memory
(kexec -l|--load <kernel-image> …).
•Jump       into      initialization     code      which      finally   calls
new kernel (kexec -e|--exec …).
What is kdump ?
•kdump eases kernel debugging when running system was crashed.
•Requires reserved memory (say 128 MB) that cannot be touched.
•Ignores the current state of the machine - just tries to boot.
•Boot    system     with     crashkernel    option     (Linux     Kernel   or
Xen hypervisor).
•Load specified crash kernel into previously reserved memory by
crashkernel option (kexec -p|--load-panic <kernel-image> …).
•… the system will reboot into the dump-capture kernel if a system crash is
triggered. Trigger points are located in panic(), die(), die_nmi() and in the
sysrq handler (ALT-SysRq-c). … (linux/Documentation/kdump/kdump.txt).
What is kdump ?

•New system running under dump-capture kernel expose raw image of
memory of crashed system through /dev/oldmem device interface.
•Through /proc/vmcore ELF format image of memory of crashed system is
available.
•ELF format image is useful for GDB and Crash tool.
•… Before analyzing the dump image, you should reboot into a stable kernel. …
(linux/Documentation/kdump/kdump.txt).


•kexec and kdump are excellent tools, albeit they have some shortcomings.
What is kexec and kdump ?




kexec/kdump infrastructure:
   •kexec-tools - userspace tools.
   •kexec/kdump implementation in Linux Kernel.
   •kexec/kdump implementation in Xen.
Details of kexec load phase

•kexec -l|--load <kernel-image> …
•Compute a hash (SHA 256) of the loaded kernel.
•kexec calls sys_kexec_load().
•sys_kexec_load() loads kernel into memory and establishes
identity page tables for the kexec kernel.
•On        Xen        hypervisor        dom0      kernel      calls
HYPERVISOR_kexec_op(KEXEC_CMD_kexec_load,                      …)
hypercall which loads kernel into memory on behalf of dom0 kernel.
Details of kexec execution phase

•kexec -e|--exec …
•kexec calls sys_reboot() with LINUX_REBOOT_CMD_KEXEC cmd
argument which later calls kernel_kexec(),
•kernel_kexec()         calls   machine_kexec()   which   prepare
arguments for relocate_kernel() and calls it.
•On Xen hypervisor dom0 kernel does not call relocate_kernel()
directly.       First           of       all      it         calls
HYPERVISOR_kexec_op(KEXEC_CMD_kexec, …) hypercall which
later calls relocate_kernel().
Details of kexec execution phase

•relocate_kernel() switch to identity page tables, relocate
kernel and then jump into purgatory code.
•purgatory code do some arch specific setup (vga reset, PIC init,
backup first 640K of memory on x86 platform if it is panic
kernel …).
•Verify a hash (SHA 256) of the loaded kernel established at load
phase and jump into kexec kernel.
•New kernel executes as usual.
History of kexec/kdump development in Linux Kernel and Xen



•kexec/kdump were introduced in Linux Kernel Ver. 2.6.13.
•Currently (Linux Kernel Ver. 3.0) kexec/kdump support is available on
eight platforms (ARM, IA-64, MIPS, PowerPC, S/390, SH, Tile, x86).
•kexec/kdump in Xen is available since Ver. 3.0.4.
•kexec/kdump under Xen dom0 is not available with paravirt kernel,
but it is with old style Xenlinux patches.
Current developments


•kexec/kdump implementation in Linux Kernel is quite stable.
•kexec/kdump implementation in Xen is quite stable too.
•Xenlinux kernels receiving only fixes (if any).
•kexec/kdump implementation for pvops Linux Kernel is under
development now.
•This work is sponsored by Google under Google Summer of
Code 2011 program.
Current developments


•Development is based off 2.6.32 Novell SLES11 Xen kexec/kdump
changes.
•Initial implementation patch (only for dom0) will be posted shortly
on Xen-devel and LKML.
•It requires a lot of cleanups.
•Currently there are more implementation questions than technical
ones.
•kexec-tools requires some modification also (will be posted shortly
on kexec@lists.infradead.org, Xen-devel and LKML).
Future plans



•kexec/kdump support for PV guest domains.
•kexec/kdump support for PVonHVM guest domains (some work is
done by Olaf Hering).
•kexec/kdump support for HVM guest domains - it works, however,
some cleanups would be required.
Future plans



Automatic Xen/dom0 kernel crash recovery:
   •Xen or dom0 kernel crashing (guest domains were running).
   •New incarnation of Xen hypervisor and dom0 kernel is started.
   •Guest domains are restarted from point at which they were
   running when Xen/dom0 kernel crash occurred.
Resources

•http://www.kernel.org/ - The Linux Kernel Archives
•ftp://ftp.kernel.org/pub/linux/utils/kernel/kexec/ - kexec-tools src
•git://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git        -
kexec-tools development tree
•kexec man page
•Linux Kernel source: linux/Documentation/kdump/
•http://www.xen.org/products/xenhyp.html - Xen Hypervisor
•http://xenbits.xen.org/ - Xen Source Repositories
•http://people.redhat.com/~anderson/ - Crash tool
Questions and Answers ?
Thank you for attention

Contenu connexe

Tendances

Linux Kernel Image
Linux Kernel ImageLinux Kernel Image
Linux Kernel Image
艾鍗科技
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
Macpaul Lin
 

Tendances (20)

Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !
Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !
Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !
 
U-Boot - An universal bootloader
U-Boot - An universal bootloader U-Boot - An universal bootloader
U-Boot - An universal bootloader
 
Build your own embedded linux distributions by yocto project
Build your own embedded linux distributions by yocto projectBuild your own embedded linux distributions by yocto project
Build your own embedded linux distributions by yocto project
 
Embedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernelEmbedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernel
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/Core
 
Linux Kernel Image
Linux Kernel ImageLinux Kernel Image
Linux Kernel Image
 
Linux boot process
Linux boot processLinux boot process
Linux boot process
 
Yocto - Embedded Linux Distribution Maker
Yocto - Embedded Linux Distribution MakerYocto - Embedded Linux Distribution Maker
Yocto - Embedded Linux Distribution Maker
 
U Boot or Universal Bootloader
U Boot or Universal BootloaderU Boot or Universal Bootloader
U Boot or Universal Bootloader
 
linux device driver
linux device driverlinux device driver
linux device driver
 
Bootloaders (U-Boot)
Bootloaders (U-Boot) Bootloaders (U-Boot)
Bootloaders (U-Boot)
 
A practical guide to buildroot
A practical guide to buildrootA practical guide to buildroot
A practical guide to buildroot
 
Embedded linux network device driver development
Embedded linux network device driver developmentEmbedded linux network device driver development
Embedded linux network device driver development
 
A History of Linux
A History of LinuxA History of Linux
A History of Linux
 
Qt5 (minimal) on beaglebone, with Yocto
Qt5 (minimal) on beaglebone, with YoctoQt5 (minimal) on beaglebone, with Yocto
Qt5 (minimal) on beaglebone, with Yocto
 
Static partitioning virtualization on RISC-V
Static partitioning virtualization on RISC-VStatic partitioning virtualization on RISC-V
Static partitioning virtualization on RISC-V
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
 
Yocto project and open embedded training
Yocto project and open embedded trainingYocto project and open embedded training
Yocto project and open embedded training
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux Developers
 

Similaire à kexec / kdump implementation in Linux Kernel and Xen hypervisor

Kdump-FUDcon-2015-Session
Kdump-FUDcon-2015-SessionKdump-FUDcon-2015-Session
Kdump-FUDcon-2015-Session
Buland Singh
 

Similaire à kexec / kdump implementation in Linux Kernel and Xen hypervisor (20)

Kdump and the kernel crash dump analysis
Kdump and the kernel crash dump analysisKdump and the kernel crash dump analysis
Kdump and the kernel crash dump analysis
 
Kdump-FUDcon-2015-Session
Kdump-FUDcon-2015-SessionKdump-FUDcon-2015-Session
Kdump-FUDcon-2015-Session
 
From printk to QEMU: Xen/Linux Kernel debugging
From printk to QEMU: Xen/Linux Kernel debuggingFrom printk to QEMU: Xen/Linux Kernel debugging
From printk to QEMU: Xen/Linux Kernel debugging
 
Kdump
KdumpKdump
Kdump
 
Stateless Hypervisors at Scale
Stateless Hypervisors at ScaleStateless Hypervisors at Scale
Stateless Hypervisors at Scale
 
RHEL5 XEN HandOnTraining_v0.4.pdf
RHEL5 XEN HandOnTraining_v0.4.pdfRHEL5 XEN HandOnTraining_v0.4.pdf
RHEL5 XEN HandOnTraining_v0.4.pdf
 
Linux Kernel Tour
Linux Kernel TourLinux Kernel Tour
Linux Kernel Tour
 
kdump: usage and_internals
kdump: usage and_internalskdump: usage and_internals
kdump: usage and_internals
 
Docker and kubernetes
Docker and kubernetesDocker and kubernetes
Docker and kubernetes
 
Introduction To Linux Kernel Modules
Introduction To Linux Kernel ModulesIntroduction To Linux Kernel Modules
Introduction To Linux Kernel Modules
 
Lec 10-linux-review
Lec 10-linux-reviewLec 10-linux-review
Lec 10-linux-review
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module Programming
 
Docker Support
Docker Support Docker Support
Docker Support
 
System Device Tree and Lopper: Concrete Examples - ELC NA 2022
System Device Tree and Lopper: Concrete Examples - ELC NA 2022System Device Tree and Lopper: Concrete Examples - ELC NA 2022
System Device Tree and Lopper: Concrete Examples - ELC NA 2022
 
CERN OpenStack Cloud Control Plane - From VMs to K8s
CERN OpenStack Cloud Control Plane - From VMs to K8sCERN OpenStack Cloud Control Plane - From VMs to K8s
CERN OpenStack Cloud Control Plane - From VMs to K8s
 
”Bare-Metal Container" presented at HPCC2016
”Bare-Metal Container" presented at HPCC2016”Bare-Metal Container" presented at HPCC2016
”Bare-Metal Container" presented at HPCC2016
 
Erlang on OSv
Erlang on OSvErlang on OSv
Erlang on OSv
 
Seattle2015 xen
Seattle2015 xenSeattle2015 xen
Seattle2015 xen
 
Chen Haibo
Chen HaiboChen Haibo
Chen Haibo
 
Using Docker with OpenStack - Hands On!
 Using Docker with OpenStack - Hands On! Using Docker with OpenStack - Hands On!
Using Docker with OpenStack - Hands On!
 

Plus de The Linux Foundation

Plus de The Linux Foundation (20)

ELC2019: Static Partitioning Made Simple
ELC2019: Static Partitioning Made SimpleELC2019: Static Partitioning Made Simple
ELC2019: Static Partitioning Made Simple
 
XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...
XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...
XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...
 
XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...
XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...
XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...
 
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
 
XPDDS19 Keynote: Unikraft Weather Report
XPDDS19 Keynote:  Unikraft Weather ReportXPDDS19 Keynote:  Unikraft Weather Report
XPDDS19 Keynote: Unikraft Weather Report
 
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
 
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, XilinxXPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
 
XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...
XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...
XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...
 
XPDDS19: Memories of a VM Funk - Mihai Donțu, Bitdefender
XPDDS19: Memories of a VM Funk - Mihai Donțu, BitdefenderXPDDS19: Memories of a VM Funk - Mihai Donțu, Bitdefender
XPDDS19: Memories of a VM Funk - Mihai Donțu, Bitdefender
 
OSSJP/ALS19: The Road to Safety Certification: Overcoming Community Challeng...
OSSJP/ALS19:  The Road to Safety Certification: Overcoming Community Challeng...OSSJP/ALS19:  The Road to Safety Certification: Overcoming Community Challeng...
OSSJP/ALS19: The Road to Safety Certification: Overcoming Community Challeng...
 
OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making...
 OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making... OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making...
OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making...
 
XPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, Citrix
XPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, CitrixXPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, Citrix
XPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, Citrix
 
XPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltd
XPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltdXPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltd
XPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltd
 
XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...
XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...
XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...
 
XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D
XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&DXPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D
XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D
 
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM SystemsXPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
 
XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...
XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...
XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...
 
XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...
XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...
XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...
 
XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...
XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...
XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...
 
XPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSE
XPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSEXPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSE
XPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSE
 

Dernier

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Dernier (20)

Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
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
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
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
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
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
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
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
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 

kexec / kdump implementation in Linux Kernel and Xen hypervisor

  • 1. kexec/kdump implementation in Linux Kernel and Xen hypervisor usage, history and current developments Sponsored by: &
  • 2. Agenda •What is kexec and kdump ? •History of kexec/kdump development in Linux Kernel and Xen. •Current developments. •Future plans. •Resources. •Questions and Answers ?
  • 3. What is kexec and kdump ? •kexec and kdump are companions. •kdump uses most of the code from kexec. •kexec allows machine restart without jumping into BIOS. •kdump eases kernel debugging when running system was crashed.
  • 4. What is kexec ? •kexec allows machine restart without jumping into BIOS. •It greatly speeds up system initialization. •kexec does not care about current system state. •It is role of administrator to prepare system for restart. •BIOS does not initialize the devices. •Can lead to unpredictable state when devices were not properly shutdown. •Load specified kernel and other modules (if user requires it) into memory (kexec -l|--load <kernel-image> …). •Jump into initialization code which finally calls new kernel (kexec -e|--exec …).
  • 5. What is kdump ? •kdump eases kernel debugging when running system was crashed. •Requires reserved memory (say 128 MB) that cannot be touched. •Ignores the current state of the machine - just tries to boot. •Boot system with crashkernel option (Linux Kernel or Xen hypervisor). •Load specified crash kernel into previously reserved memory by crashkernel option (kexec -p|--load-panic <kernel-image> …). •… the system will reboot into the dump-capture kernel if a system crash is triggered. Trigger points are located in panic(), die(), die_nmi() and in the sysrq handler (ALT-SysRq-c). … (linux/Documentation/kdump/kdump.txt).
  • 6. What is kdump ? •New system running under dump-capture kernel expose raw image of memory of crashed system through /dev/oldmem device interface. •Through /proc/vmcore ELF format image of memory of crashed system is available. •ELF format image is useful for GDB and Crash tool. •… Before analyzing the dump image, you should reboot into a stable kernel. … (linux/Documentation/kdump/kdump.txt). •kexec and kdump are excellent tools, albeit they have some shortcomings.
  • 7. What is kexec and kdump ? kexec/kdump infrastructure: •kexec-tools - userspace tools. •kexec/kdump implementation in Linux Kernel. •kexec/kdump implementation in Xen.
  • 8. Details of kexec load phase •kexec -l|--load <kernel-image> … •Compute a hash (SHA 256) of the loaded kernel. •kexec calls sys_kexec_load(). •sys_kexec_load() loads kernel into memory and establishes identity page tables for the kexec kernel. •On Xen hypervisor dom0 kernel calls HYPERVISOR_kexec_op(KEXEC_CMD_kexec_load, …) hypercall which loads kernel into memory on behalf of dom0 kernel.
  • 9. Details of kexec execution phase •kexec -e|--exec … •kexec calls sys_reboot() with LINUX_REBOOT_CMD_KEXEC cmd argument which later calls kernel_kexec(), •kernel_kexec() calls machine_kexec() which prepare arguments for relocate_kernel() and calls it. •On Xen hypervisor dom0 kernel does not call relocate_kernel() directly. First of all it calls HYPERVISOR_kexec_op(KEXEC_CMD_kexec, …) hypercall which later calls relocate_kernel().
  • 10. Details of kexec execution phase •relocate_kernel() switch to identity page tables, relocate kernel and then jump into purgatory code. •purgatory code do some arch specific setup (vga reset, PIC init, backup first 640K of memory on x86 platform if it is panic kernel …). •Verify a hash (SHA 256) of the loaded kernel established at load phase and jump into kexec kernel. •New kernel executes as usual.
  • 11. History of kexec/kdump development in Linux Kernel and Xen •kexec/kdump were introduced in Linux Kernel Ver. 2.6.13. •Currently (Linux Kernel Ver. 3.0) kexec/kdump support is available on eight platforms (ARM, IA-64, MIPS, PowerPC, S/390, SH, Tile, x86). •kexec/kdump in Xen is available since Ver. 3.0.4. •kexec/kdump under Xen dom0 is not available with paravirt kernel, but it is with old style Xenlinux patches.
  • 12. Current developments •kexec/kdump implementation in Linux Kernel is quite stable. •kexec/kdump implementation in Xen is quite stable too. •Xenlinux kernels receiving only fixes (if any). •kexec/kdump implementation for pvops Linux Kernel is under development now. •This work is sponsored by Google under Google Summer of Code 2011 program.
  • 13. Current developments •Development is based off 2.6.32 Novell SLES11 Xen kexec/kdump changes. •Initial implementation patch (only for dom0) will be posted shortly on Xen-devel and LKML. •It requires a lot of cleanups. •Currently there are more implementation questions than technical ones. •kexec-tools requires some modification also (will be posted shortly on kexec@lists.infradead.org, Xen-devel and LKML).
  • 14. Future plans •kexec/kdump support for PV guest domains. •kexec/kdump support for PVonHVM guest domains (some work is done by Olaf Hering). •kexec/kdump support for HVM guest domains - it works, however, some cleanups would be required.
  • 15. Future plans Automatic Xen/dom0 kernel crash recovery: •Xen or dom0 kernel crashing (guest domains were running). •New incarnation of Xen hypervisor and dom0 kernel is started. •Guest domains are restarted from point at which they were running when Xen/dom0 kernel crash occurred.
  • 16. Resources •http://www.kernel.org/ - The Linux Kernel Archives •ftp://ftp.kernel.org/pub/linux/utils/kernel/kexec/ - kexec-tools src •git://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git - kexec-tools development tree •kexec man page •Linux Kernel source: linux/Documentation/kdump/ •http://www.xen.org/products/xenhyp.html - Xen Hypervisor •http://xenbits.xen.org/ - Xen Source Repositories •http://people.redhat.com/~anderson/ - Crash tool
  • 18. Thank you for attention