arch/s390/mm/pgtable.c
Source file repositories/reference/linux-study-clean/arch/s390/mm/pgtable.c
File Facts
- System
- Linux kernel
- Corpus path
arch/s390/mm/pgtable.c- Extension
.c- Size
- 8825 bytes
- Lines
- 356
- Domain
- Architecture Layer
- Bucket
- arch/s390
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/cpufeature.hlinux/export.hlinux/sched.hlinux/kernel.hlinux/errno.hlinux/gfp.hlinux/mm.hlinux/swap.hlinux/smp.hlinux/spinlock.hlinux/rcupdate.hlinux/slab.hlinux/leafops.hlinux/sysctl.hlinux/ksm.hlinux/mman.hasm/tlbflush.hasm/mmu_context.hasm/page-states.hasm/machine.h
Detected Declarations
function Authorfunction ptep_ipte_localfunction ptep_ipte_globalfunction ptep_flush_directfunction ptep_flush_lazyfunction cpumask_offunction ptep_xchg_directfunction ptep_reset_dat_protfunction ptep_xchg_lazyfunction ptep_modify_prot_startfunction ptep_modify_prot_commitfunction pmdp_idte_localfunction pmdp_idte_globalfunction pmdp_flush_directfunction pmdp_flush_lazyfunction cpumask_offunction pmdp_xchg_directfunction pmdp_xchg_lazyfunction pudp_idte_localfunction pudp_idte_globalfunction pudp_flush_directfunction pudp_xchg_directfunction pgtable_trans_huge_depositfunction pgtable_trans_huge_withdrawexport pgprot_writecombineexport ptep_xchg_directexport ptep_reset_dat_protexport ptep_xchg_lazyexport pmdp_xchg_directexport pmdp_xchg_lazyexport pudp_xchg_direct
Annotated Snippet
if (asce != -1UL) {
asce = asce ? : mm->context.asce;
opt |= IPTE_GUEST_ASCE;
}
__ptep_ipte(addr, ptep, opt, asce, IPTE_LOCAL);
} else {
__ptep_ipte(addr, ptep, 0, 0, IPTE_LOCAL);
}
}
static inline void ptep_ipte_global(struct mm_struct *mm, unsigned long addr,
pte_t *ptep, int nodat)
{
unsigned long opt, asce;
if (machine_has_tlb_guest()) {
opt = 0;
asce = READ_ONCE(mm->context.gmap_asce);
if (asce == 0UL || nodat)
opt |= IPTE_NODAT;
if (asce != -1UL) {
asce = asce ? : mm->context.asce;
opt |= IPTE_GUEST_ASCE;
}
__ptep_ipte(addr, ptep, opt, asce, IPTE_GLOBAL);
} else {
__ptep_ipte(addr, ptep, 0, 0, IPTE_GLOBAL);
}
}
static inline pte_t ptep_flush_direct(struct mm_struct *mm,
unsigned long addr, pte_t *ptep,
int nodat)
{
pte_t old;
old = *ptep;
if (unlikely(pte_val(old) & _PAGE_INVALID))
return old;
atomic_inc(&mm->context.flush_count);
if (cpu_has_tlb_lc() &&
cpumask_equal(mm_cpumask(mm), cpumask_of(smp_processor_id())))
ptep_ipte_local(mm, addr, ptep, nodat);
else
ptep_ipte_global(mm, addr, ptep, nodat);
atomic_dec(&mm->context.flush_count);
return old;
}
static inline pte_t ptep_flush_lazy(struct mm_struct *mm,
unsigned long addr, pte_t *ptep,
int nodat)
{
pte_t old;
old = *ptep;
if (unlikely(pte_val(old) & _PAGE_INVALID))
return old;
atomic_inc(&mm->context.flush_count);
if (cpumask_equal(&mm->context.cpu_attach_mask,
cpumask_of(smp_processor_id()))) {
set_pte(ptep, set_pte_bit(*ptep, __pgprot(_PAGE_INVALID)));
mm->context.flush_mm = 1;
} else
ptep_ipte_global(mm, addr, ptep, nodat);
atomic_dec(&mm->context.flush_count);
return old;
}
pte_t ptep_xchg_direct(struct mm_struct *mm, unsigned long addr,
pte_t *ptep, pte_t new)
{
pte_t old;
preempt_disable();
old = ptep_flush_direct(mm, addr, ptep, 1);
set_pte(ptep, new);
preempt_enable();
return old;
}
EXPORT_SYMBOL(ptep_xchg_direct);
/*
* Caller must check that new PTE only differs in _PAGE_PROTECT HW bit, so that
* RDP can be used instead of IPTE. See also comments at pte_allow_rdp().
*/
void ptep_reset_dat_prot(struct mm_struct *mm, unsigned long addr, pte_t *ptep,
pte_t new)
{
preempt_disable();
Annotation
- Immediate include surface: `linux/cpufeature.h`, `linux/export.h`, `linux/sched.h`, `linux/kernel.h`, `linux/errno.h`, `linux/gfp.h`, `linux/mm.h`, `linux/swap.h`.
- Detected declarations: `function Author`, `function ptep_ipte_local`, `function ptep_ipte_global`, `function ptep_flush_direct`, `function ptep_flush_lazy`, `function cpumask_of`, `function ptep_xchg_direct`, `function ptep_reset_dat_prot`, `function ptep_xchg_lazy`, `function ptep_modify_prot_start`.
- Atlas domain: Architecture Layer / arch/s390.
- Implementation status: integration 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.