arch/s390/kvm/kvm-s390.h
Source file repositories/reference/linux-study-clean/arch/s390/kvm/kvm-s390.h
File Facts
- System
- Linux kernel
- Corpus path
arch/s390/kvm/kvm-s390.h- Extension
.h- Size
- 19809 bytes
- Lines
- 628
- Domain
- Architecture Layer
- Bucket
- arch/s390
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/hrtimer.hlinux/kvm.hlinux/kvm_host.hlinux/lockdep.hasm/facility.hasm/processor.hasm/sclp.hdat.hgmap.h
Detected Declarations
function kvm_s390_fpu_storefunction kvm_s390_fpu_loadfunction kvm_s390_set_cpuflagsfunction kvm_s390_clear_cpuflagsfunction kvm_s390_test_cpuflagsfunction is_vcpu_stoppedfunction is_vcpu_idlefunction kvm_is_ucontrolfunction kvm_s390_get_prefixfunction kvm_s390_set_prefixfunction kvm_s390_get_base_disp_sfunction kvm_s390_get_base_disp_siyfunction kvm_s390_get_base_disp_ssefunction kvm_s390_get_regs_rrefunction kvm_s390_get_base_disp_rsyfunction kvm_s390_get_base_disp_rsfunction kvm_s390_set_psw_ccfunction test_kvm_facilityfunction set_kvm_facilityfunction test_kvm_cpu_featfunction kvm_s390_user_cpu_state_ctrlfunction kvm_s390_set_user_cpu_state_ctrlfunction kvm_s390_get_gfn_endfunction kvm_s390_get_gisa_descfunction gpa_to_hvafunction kvm_s390_pv_get_handlefunction kvm_s390_pv_cpu_get_handlefunction __kvm_s390_pv_destroy_pagefunction kvm_s390_inject_prog_irqfunction kvm_s390_inject_program_intfunction kvm_s390_rewind_pswfunction kvm_s390_forward_pswfunction kvm_s390_retry_instrfunction kvm_s390_vcpu_block_allfunction kvm_s390_vcpu_unblock_allfunction kvm_s390_get_tod_clock_fastfunction kvm_s390_inject_prog_irqfunction kvm_s390_use_sca_entriesfunction kvm_s390_cur_gmap_fault_is_write
Annotated Snippet
#ifndef ARCH_S390_KVM_S390_H
#define ARCH_S390_KVM_S390_H
#include <linux/hrtimer.h>
#include <linux/kvm.h>
#include <linux/kvm_host.h>
#include <linux/lockdep.h>
#include <asm/facility.h>
#include <asm/processor.h>
#include <asm/sclp.h>
#include "dat.h"
#include "gmap.h"
#define KVM_S390_UCONTROL_MEMSLOT (KVM_USER_MEM_SLOTS + 0)
union kvm_s390_quad {
__uint128_t sixteen;
unsigned long eight;
unsigned int four;
unsigned short two;
unsigned char one;
};
static inline void kvm_s390_fpu_store(struct kvm_run *run)
{
fpu_stfpc(&run->s.regs.fpc);
if (cpu_has_vx())
save_vx_regs((__vector128 *)&run->s.regs.vrs);
else
save_fp_regs((freg_t *)&run->s.regs.fprs);
}
static inline void kvm_s390_fpu_load(struct kvm_run *run)
{
fpu_lfpc_safe(&run->s.regs.fpc);
if (cpu_has_vx())
load_vx_regs((__vector128 *)&run->s.regs.vrs);
else
load_fp_regs((freg_t *)&run->s.regs.fprs);
}
/* Transactional Memory Execution related macros */
#define IS_TE_ENABLED(vcpu) ((vcpu->arch.sie_block->ecb & ECB_TE))
#define TDB_FORMAT1 1
#define IS_ITDB_VALID(vcpu) \
((*(char *)phys_to_virt((vcpu)->arch.sie_block->itdba) == TDB_FORMAT1))
extern debug_info_t *kvm_s390_dbf;
extern debug_info_t *kvm_s390_dbf_uv;
#define KVM_UV_EVENT(d_kvm, d_loglevel, d_string, d_args...)\
do { \
debug_sprintf_event((d_kvm)->arch.dbf, d_loglevel, d_string "\n", \
d_args); \
debug_sprintf_event(kvm_s390_dbf_uv, d_loglevel, \
"%d: " d_string "\n", (d_kvm)->userspace_pid, \
d_args); \
} while (0)
#define KVM_EVENT(d_loglevel, d_string, d_args...)\
do { \
debug_sprintf_event(kvm_s390_dbf, d_loglevel, d_string "\n", \
d_args); \
} while (0)
#define VM_EVENT(d_kvm, d_loglevel, d_string, d_args...)\
do { \
debug_sprintf_event(d_kvm->arch.dbf, d_loglevel, d_string "\n", \
d_args); \
} while (0)
#define VCPU_EVENT(d_vcpu, d_loglevel, d_string, d_args...)\
do { \
debug_sprintf_event(d_vcpu->kvm->arch.dbf, d_loglevel, \
"%02d[%016lx-%016lx]: " d_string "\n", d_vcpu->vcpu_id, \
d_vcpu->arch.sie_block->gpsw.mask, d_vcpu->arch.sie_block->gpsw.addr,\
d_args); \
} while (0)
static inline void kvm_s390_set_cpuflags(struct kvm_vcpu *vcpu, u32 flags)
{
atomic_or(flags, &vcpu->arch.sie_block->cpuflags);
}
static inline void kvm_s390_clear_cpuflags(struct kvm_vcpu *vcpu, u32 flags)
{
atomic_andnot(flags, &vcpu->arch.sie_block->cpuflags);
}
static inline bool kvm_s390_test_cpuflags(struct kvm_vcpu *vcpu, u32 flags)
Annotation
- Immediate include surface: `linux/hrtimer.h`, `linux/kvm.h`, `linux/kvm_host.h`, `linux/lockdep.h`, `asm/facility.h`, `asm/processor.h`, `asm/sclp.h`, `dat.h`.
- Detected declarations: `function kvm_s390_fpu_store`, `function kvm_s390_fpu_load`, `function kvm_s390_set_cpuflags`, `function kvm_s390_clear_cpuflags`, `function kvm_s390_test_cpuflags`, `function is_vcpu_stopped`, `function is_vcpu_idle`, `function kvm_is_ucontrol`, `function kvm_s390_get_prefix`, `function kvm_s390_set_prefix`.
- Atlas domain: Architecture Layer / arch/s390.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.