arch/arm64/kvm/hyp/include/hyp/debug-sr.h
Source file repositories/reference/linux-study-clean/arch/arm64/kvm/hyp/include/hyp/debug-sr.h
File Facts
- System
- Linux kernel
- Corpus path
arch/arm64/kvm/hyp/include/hyp/debug-sr.h- Extension
.h- Size
- 4940 bytes
- Lines
- 173
- Domain
- Architecture Layer
- Bucket
- arch/arm64
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/compiler.hlinux/kvm_host.hasm/debug-monitors.hasm/kvm_asm.hasm/kvm_hyp.hasm/kvm_mmu.h
Detected Declarations
function Copyrightfunction __debug_save_statefunction __debug_restore_statefunction __debug_switch_to_guest_commonfunction __debug_switch_to_host_common
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (C) 2015 - ARM Ltd
* Author: Marc Zyngier <marc.zyngier@arm.com>
*/
#ifndef __ARM64_KVM_HYP_DEBUG_SR_H__
#define __ARM64_KVM_HYP_DEBUG_SR_H__
#include <linux/compiler.h>
#include <linux/kvm_host.h>
#include <asm/debug-monitors.h>
#include <asm/kvm_asm.h>
#include <asm/kvm_hyp.h>
#include <asm/kvm_mmu.h>
#define read_debug(r,n) read_sysreg(r##n##_el1)
#define write_debug(v,r,n) write_sysreg(v, r##n##_el1)
#define save_debug(ptr,reg,nr) \
switch (nr) { \
case 15: ptr[15] = read_debug(reg, 15); \
fallthrough; \
case 14: ptr[14] = read_debug(reg, 14); \
fallthrough; \
case 13: ptr[13] = read_debug(reg, 13); \
fallthrough; \
case 12: ptr[12] = read_debug(reg, 12); \
fallthrough; \
case 11: ptr[11] = read_debug(reg, 11); \
fallthrough; \
case 10: ptr[10] = read_debug(reg, 10); \
fallthrough; \
case 9: ptr[9] = read_debug(reg, 9); \
fallthrough; \
case 8: ptr[8] = read_debug(reg, 8); \
fallthrough; \
case 7: ptr[7] = read_debug(reg, 7); \
fallthrough; \
case 6: ptr[6] = read_debug(reg, 6); \
fallthrough; \
case 5: ptr[5] = read_debug(reg, 5); \
fallthrough; \
case 4: ptr[4] = read_debug(reg, 4); \
fallthrough; \
case 3: ptr[3] = read_debug(reg, 3); \
fallthrough; \
case 2: ptr[2] = read_debug(reg, 2); \
fallthrough; \
case 1: ptr[1] = read_debug(reg, 1); \
fallthrough; \
default: ptr[0] = read_debug(reg, 0); \
}
#define restore_debug(ptr,reg,nr) \
switch (nr) { \
case 15: write_debug(ptr[15], reg, 15); \
fallthrough; \
case 14: write_debug(ptr[14], reg, 14); \
fallthrough; \
case 13: write_debug(ptr[13], reg, 13); \
fallthrough; \
case 12: write_debug(ptr[12], reg, 12); \
fallthrough; \
case 11: write_debug(ptr[11], reg, 11); \
fallthrough; \
case 10: write_debug(ptr[10], reg, 10); \
fallthrough; \
case 9: write_debug(ptr[9], reg, 9); \
fallthrough; \
case 8: write_debug(ptr[8], reg, 8); \
fallthrough; \
case 7: write_debug(ptr[7], reg, 7); \
fallthrough; \
case 6: write_debug(ptr[6], reg, 6); \
fallthrough; \
case 5: write_debug(ptr[5], reg, 5); \
fallthrough; \
case 4: write_debug(ptr[4], reg, 4); \
fallthrough; \
case 3: write_debug(ptr[3], reg, 3); \
fallthrough; \
case 2: write_debug(ptr[2], reg, 2); \
fallthrough; \
case 1: write_debug(ptr[1], reg, 1); \
fallthrough; \
default: write_debug(ptr[0], reg, 0); \
}
Annotation
- Immediate include surface: `linux/compiler.h`, `linux/kvm_host.h`, `asm/debug-monitors.h`, `asm/kvm_asm.h`, `asm/kvm_hyp.h`, `asm/kvm_mmu.h`.
- Detected declarations: `function Copyright`, `function __debug_save_state`, `function __debug_restore_state`, `function __debug_switch_to_guest_common`, `function __debug_switch_to_host_common`.
- Atlas domain: Architecture Layer / arch/arm64.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.