本文へ移動
cccskills
無料GitHub で公開

hypervisor-internals

Use when studying Intel VT-x or AMD-V internals: VMCS and VMCB, EPT and NPT, VM exit handling, APIC virtualization, or building a minimal type-1 hypervisor. Not for running VMs: use qemu-kvm.

インストール方法を見る

含まれるファイル(2)

  • SKILL.md6.9 KB
  • agents/openai.yaml230 B

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Hypervisor internals

Contract

FieldBound contract
TriggerA VM exit storm or EPT violation needs diagnosing, a KVM or Hyper-V behavior needs mapping to the hardware feature under it, a hypervisor CVE needs triage, or an educational hypervisor is being built.
AuthorityRead-only. The skill reads kernel headers, sysfs, and module parameters and answers in chat. Nothing on disk changes, so there is nothing to roll back. No remote mutation.
Side effectChat output only.
DoneThe hardware structure and exit reason in question are named with their header constants, the Intel and AMD forms are both given where they differ, and the tuning or mitigation lever is identified.

Inputs

  • Question (required): a structure, an exit reason, a paging level, or a symptom such as slow nested virtualization.
  • Vendor (optional): Intel VT-x or AMD-V. Both are covered; the answer names each form.
  • Host access (optional): needed to quote kvm_intel or kvm_amd module parameters and the vulnerability files.

Procedure

  1. Place the hypervisor. A type-1 hypervisor (Hyper-V, Xen, ESXi) runs on the hardware; a type-2 (KVM with QEMU, VirtualBox) runs inside a host OS. KVM sits in the host kernel and exposes /dev/kvm; QEMU is its user-space device model. Done when: the user knows which layer the question lives in.
  2. Walk the Intel VMX life cycle. VMXON enters VMX root mode; the hypervisor fills a VMCS with guest state, host state, and control fields; VMLAUNCH or VMRESUME enters the guest; the guest runs until a VM exit returns to the host handler at the host RIP in the VMCS; VMXOFF leaves VMX operation. Done when: each instruction is placed on the path.
VMCS areaContents
Guest stateGeneral registers, CR0, CR3, CR4, segment selectors, RIP, RSP
Host stateHost RIP (the exit handler), host CR3
ControlsPin-based, processor-based, VM-exit, and VM-entry controls
Exit informationExit reason, exit qualification, guest linear address
  1. Read exit reasons from the kernel's own header. Basic exit reason codes from arch/x86/include/uapi/asm/vmx.h: 0 exception or NMI, 1 external interrupt, 2 triple fault, 10 CPUID, 12 HLT, 28 CR access, 30 I/O instruction, 31 MSR read, 32 MSR write, 48 EPT violation, 49 EPT misconfiguration. Done when: the observed exit reason maps to a constant.
  2. Give the AMD form. EFER.SVME enables SVM; the VMCB holds a control area (intercept vectors for CPUID, MSR, and I/O, the nested paging enable bit, the ASID) and a guest save area; VMRUN enters the guest and #VMEXIT returns. Exit codes from arch/x86/include/uapi/asm/svm.h: 0x72 CPUID, 0x78 HLT, 0x7b I/O, 0x7c MSR, 0x400 nested page fault. Done when: the Intel concept has its AMD counterpart.
IntelAMD
VMCSVMCB
VMXON and VMXOFFEFER.SVME
VMLAUNCH and VMRESUMEVMRUN
EPTNPT
  1. Explain second-level paging. The guest page tables map guest virtual to guest physical; EPT or NPT, owned by the hypervisor, maps guest physical to host physical. An EPT violation exit means the guest touched an unmapped guest-physical address or violated the EPT permission bits. Nested virtualization adds another level of walk, which is where its cost comes from. Done when: the address that faulted is placed on one of the two walks.
  2. Tune the exit rate with bitmaps. The 4 KiB MSR bitmap chooses per MSR whether a read or write exits; the I/O bitmap chooses per port. A hypervisor intercepts control MSRs such as IA32_FEATURE_CONTROL and IA32_EFER and passes through the rest. Done when: the MSR or port causing an exit storm is identified and its bitmap bit is the proposed lever.
  3. Cover interrupt virtualization. Virtual interrupt delivery avoids an exit on EOI, posted interrupts let hardware inject without an exit, and TPR shadowing avoids exits on priority changes. Intel injects through the VM-entry interruption-information field; AMD through V_IRQ and V_INTR_PRIO in the VMCB. On a Linux host these appear as kvm_intel parameters (enable_apicv, enable_device_posted_irqs, ept, nested, vpid, pml) under /sys/module/kvm_intel/parameters/. Done when: the interrupt path from device to guest ISR is drawn.
  4. Name the side-channel mitigations. L1TF is mitigated by flushing L1D on VM entry (kvm_intel parameter vmentry_l1d_flush; state in /sys/devices/system/cpu/vulnerabilities/l1tf). Read that directory for the current host state before making a claim about it. Done when: the mitigation and its sysfs evidence are named.
  5. For an educational hypervisor, follow this order: detect support (X86_FEATURE_VMX or X86_FEATURE_SVM, exposed as vmx or svm in /proc/cpuinfo), enable VMX or SVM, allocate the VMCS or VMCB and fill host and guest state, handle exits for CPUID and HLT, add EPT or NPT with an identity map, then inject interrupts. Done when: the next step in that order is identified.
  6. Show the KVM API when the question is how QEMU talks to the kernel. Done when: the ioctl sequence is stated.
int kvm = open("/dev/kvm", O_RDWR);
ioctl(kvm, KVM_GET_API_VERSION, 0);            /* must be 12 */
int vm = ioctl(kvm, KVM_CREATE_VM, 0);
/* KVM_SET_USER_MEMORY_REGION maps guest memory before any vCPU runs. */
int vcpu = ioctl(vm, KVM_CREATE_VCPU, 0);
/* mmap the vCPU fd for KVM_GET_VCPU_MMAP_SIZE bytes to read the exit reason. */
ioctl(vcpu, KVM_RUN, 0);                        /* returns on each VM exit */

For running guests and passing through devices, use qemu-kvm. For lighter isolation without a VM, use containers-internals. For the guest OS side, use os-dev-scratch. For host kernel mitigations, use kernel-security.

Failure and recovery

Failure classBehavior
VM exit storm on MSR accessThe MSR bitmap intercepts a hot MSR. Pass that MSR through when it is safe.
EPT misconfiguration exitA malformed EPT entry (reserved bits or bad memory type). Check the entry against the SDM format.
Nested guest slowTwo-level page walk plus exits forwarded through the outer hypervisor. Enable hardware assists, limit nesting depth.
VMXON failsCR0 or CR4 fixed bits are wrong, or IA32_FEATURE_CONTROL is locked without VMX enabled. Check both.
Guest triple faultThe guest's IDT or an unhandled exception in early boot. Check the guest interrupt setup.
Every port I/O exitsThe I/O bitmap traps everything. Shrink it to the emulated ports.

Output

A chat answer naming the structure, the exit reason with its header constant, the Intel and AMD forms, and the lever (bitmap, parameter, or paging change) that addresses the symptom, with the sysfs or header evidence quoted.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Use when explaining System V AMD64, ARM AAPCS, RISC-V psABI, stack frames, variadic calls, or FFI register rules. Not for the Rust FFI binding layer: use rust-ffi.

日本語の概要は準備中です。原文の説明を表示しています。

OutlineDriven/odin-claude-plugin372026年9月29日 更新

Use when configuring ADC sampling time, DMA-driven ADC, calibration, or DAC channel setup on bare-metal MCUs. Not for the DMA stream itself: use dma-baremetal.

日本語の概要は準備中です。原文の説明を表示しています。

OutlineDriven/odin-claude-plugin372026年9月29日 更新

af-xdp

無料

Use when creating AF_XDP sockets, configuring UMEM and XSK rings, writing an XDP redirect program, or choosing copy versus zero-copy mode. Not for full kernel bypass: use dpdk.

日本語の概要は準備中です。原文の説明を表示しています。

OutlineDriven/odin-claude-plugin372026年9月29日 更新

Use when a completed session needs an agent-environment retrospective. Not for an engineering retrospective from telemetry: use engineering-retrospective.

日本語の概要は準備中です。原文の説明を表示しています。

OutlineDriven/odin-claude-plugin372026年9月29日 更新

Use when a redacted, trimmed agent transcript must be appended to a GitHub PR or issue body, with human approval and preview. Not for automated or model-initiated insertion.

日本語の概要は準備中です。原文の説明を表示しています。

OutlineDriven/odin-claude-plugin372026年9月29日 更新

agents-md

無料

Use when a repo needs agent setup, AGENTS.md added or made lean, CLAUDE.md audited, or agent instructions scored or pruned. Not for remote, credential, publish, deploy, or irreversible changes.

日本語の概要は準備中です。原文の説明を表示しています。

OutlineDriven/odin-claude-plugin372026年9月29日 更新

OutlineDriven のスキルをすべて見る

このスキルの問題を報告する