arch/x86/include/asm/xen/page.h
Source file repositories/reference/linux-study-clean/arch/x86/include/asm/xen/page.h
File Facts
- System
- Linux kernel
- Corpus path
arch/x86/include/asm/xen/page.h- Extension
.h- Size
- 9551 bytes
- Lines
- 361
- Domain
- Architecture Layer
- Bucket
- arch/x86
- 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/kernel.hlinux/types.hlinux/spinlock.hlinux/pfn.hlinux/mm.hlinux/device.hasm/extable.hasm/page.hxen/xen.hxen/interface/xen.hxen/interface/grant_table.h
Detected Declarations
function set_foreign_p2m_mappingfunction clear_foreign_p2m_mappingfunction xen_safe_write_ulongfunction xen_safe_read_ulongfunction pfn_to_mfnfunction __pfn_to_mfnfunction pfn_to_mfnfunction phys_to_machine_mapping_validfunction mfn_to_pfn_no_overridesfunction mfn_to_pfnfunction phys_to_machinefunction machine_to_physfunction pfn_to_gfnfunction gfn_to_pfnfunction p2mfunction virt_to_pfnfunction pte_mfnfunction mfn_ptefunction pte_val_mafunction __pte_mafunction xen_arch_need_swiotlb
Annotated Snippet
#ifndef _ASM_X86_XEN_PAGE_H
#define _ASM_X86_XEN_PAGE_H
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/spinlock.h>
#include <linux/pfn.h>
#include <linux/mm.h>
#include <linux/device.h>
#include <asm/extable.h>
#include <asm/page.h>
#include <xen/xen.h>
#include <xen/interface/xen.h>
#include <xen/interface/grant_table.h>
/* Xen machine address */
typedef struct xmaddr {
phys_addr_t maddr;
} xmaddr_t;
/* Xen pseudo-physical address */
typedef struct xpaddr {
phys_addr_t paddr;
} xpaddr_t;
#ifdef CONFIG_X86_64
#define XEN_PHYSICAL_MASK __sme_clr((1UL << 52) - 1)
#else
#define XEN_PHYSICAL_MASK __PHYSICAL_MASK
#endif
#define XEN_PTE_MFN_MASK ((pteval_t)(((signed long)PAGE_MASK) & \
XEN_PHYSICAL_MASK))
#define XMADDR(x) ((xmaddr_t) { .maddr = (x) })
#define XPADDR(x) ((xpaddr_t) { .paddr = (x) })
/**** MACHINE <-> PHYSICAL CONVERSION MACROS ****/
#define INVALID_P2M_ENTRY (~0UL)
#define FOREIGN_FRAME_BIT (1UL<<(BITS_PER_LONG-1))
#define IDENTITY_FRAME_BIT (1UL<<(BITS_PER_LONG-2))
#define FOREIGN_FRAME(m) ((m) | FOREIGN_FRAME_BIT)
#define IDENTITY_FRAME(m) ((m) | IDENTITY_FRAME_BIT)
#define P2M_PER_PAGE (PAGE_SIZE / sizeof(unsigned long))
extern unsigned long *machine_to_phys_mapping;
extern unsigned long machine_to_phys_nr;
extern unsigned long *xen_p2m_addr;
extern unsigned long xen_p2m_size;
extern unsigned long xen_max_p2m_pfn;
extern int xen_alloc_p2m_entry(unsigned long pfn);
extern unsigned long get_phys_to_machine(unsigned long pfn);
extern bool set_phys_to_machine(unsigned long pfn, unsigned long mfn);
extern bool __set_phys_to_machine(unsigned long pfn, unsigned long mfn);
extern unsigned long __init set_phys_range_identity(unsigned long pfn_s,
unsigned long pfn_e);
#ifdef CONFIG_XEN_PV
extern int set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops,
struct gnttab_map_grant_ref *kmap_ops,
struct page **pages, unsigned int count);
extern int clear_foreign_p2m_mapping(struct gnttab_unmap_grant_ref *unmap_ops,
struct gnttab_unmap_grant_ref *kunmap_ops,
struct page **pages, unsigned int count);
#else
static inline int
set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops,
struct gnttab_map_grant_ref *kmap_ops,
struct page **pages, unsigned int count)
{
return 0;
}
static inline int
clear_foreign_p2m_mapping(struct gnttab_unmap_grant_ref *unmap_ops,
struct gnttab_unmap_grant_ref *kunmap_ops,
struct page **pages, unsigned int count)
{
return 0;
}
#endif
/*
* Helper functions to write or read unsigned long values to/from
* memory, when the access may fault.
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/types.h`, `linux/spinlock.h`, `linux/pfn.h`, `linux/mm.h`, `linux/device.h`, `asm/extable.h`, `asm/page.h`.
- Detected declarations: `function set_foreign_p2m_mapping`, `function clear_foreign_p2m_mapping`, `function xen_safe_write_ulong`, `function xen_safe_read_ulong`, `function pfn_to_mfn`, `function __pfn_to_mfn`, `function pfn_to_mfn`, `function phys_to_machine_mapping_valid`, `function mfn_to_pfn_no_overrides`, `function mfn_to_pfn`.
- Atlas domain: Architecture Layer / arch/x86.
- 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.