arch/powerpc/include/asm/vas.h
Source file repositories/reference/linux-study-clean/arch/powerpc/include/asm/vas.h
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/include/asm/vas.h- Extension
.h- Size
- 8100 bytes
- Lines
- 295
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- 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/sched/mm.hlinux/mmu_context.hasm/icswx.huapi/asm/vas-api.h
Detected Declarations
struct vas_user_win_refstruct vas_windowstruct vas_user_win_opsstruct vas_rx_win_attrstruct vas_tx_win_attrstruct hv_vas_all_capsstruct vas_all_capsenum vas_cop_typefunction put_vas_user_win_reffunction vas_user_win_add_mm_context
Annotated Snippet
struct vas_user_win_ref {
struct pid *pid; /* PID of owner */
struct pid *tgid; /* Thread group ID of owner */
struct mm_struct *mm; /* Linux process mm_struct */
struct mutex mmap_mutex; /* protects paste address mmap() */
/* with DLPAR close/open windows */
struct vm_area_struct *vma; /* Save VMA and used in DLPAR ops */
};
/*
* Common VAS window struct on PowerNV and PowerVM
*/
struct vas_window {
u32 winid;
u32 wcreds_max; /* Window credits */
u32 status; /* Window status used in OS */
enum vas_cop_type cop;
struct vas_user_win_ref task_ref;
char *dbgname;
struct dentry *dbgdir;
};
/*
* User space window operations used for powernv and powerVM
*/
struct vas_user_win_ops {
struct vas_window * (*open_win)(int vas_id, u64 flags,
enum vas_cop_type);
u64 (*paste_addr)(struct vas_window *);
int (*close_win)(struct vas_window *);
};
static inline void put_vas_user_win_ref(struct vas_user_win_ref *ref)
{
/* Drop references to pid, tgid, and mm */
put_pid(ref->pid);
put_pid(ref->tgid);
if (ref->mm)
mmdrop(ref->mm);
}
static inline void vas_user_win_add_mm_context(struct vas_user_win_ref *ref)
{
mm_context_add_vas_window(ref->mm);
/*
* Even a process that has no foreign real address mapping can
* use an unpaired COPY instruction (to no real effect). Issue
* CP_ABORT to clear any pending COPY and prevent a covert
* channel.
*
* __switch_to() will issue CP_ABORT on future context switches
* if process / thread has any open VAS window (Use
* current->mm->context.vas_windows).
*/
asm volatile(PPC_CP_ABORT);
}
/*
* Receive window attributes specified by the (in-kernel) owner of window.
*/
struct vas_rx_win_attr {
u64 rx_fifo;
int rx_fifo_size;
int wcreds_max;
bool pin_win;
bool rej_no_credit;
bool tx_wcred_mode;
bool rx_wcred_mode;
bool tx_win_ord_mode;
bool rx_win_ord_mode;
bool data_stamp;
bool nx_win;
bool fault_win;
bool user_win;
bool notify_disable;
bool intr_disable;
bool notify_early;
int lnotify_lpid;
int lnotify_pid;
int lnotify_tid;
u32 pswid;
int tc_mode;
};
/*
* Window attributes specified by the in-kernel owner of a send window.
*/
Annotation
- Immediate include surface: `linux/sched/mm.h`, `linux/mmu_context.h`, `asm/icswx.h`, `uapi/asm/vas-api.h`.
- Detected declarations: `struct vas_user_win_ref`, `struct vas_window`, `struct vas_user_win_ops`, `struct vas_rx_win_attr`, `struct vas_tx_win_attr`, `struct hv_vas_all_caps`, `struct vas_all_caps`, `enum vas_cop_type`, `function put_vas_user_win_ref`, `function vas_user_win_add_mm_context`.
- Atlas domain: Architecture Layer / arch/powerpc.
- 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.