arch/powerpc/platforms/pseries/mobility.c
Source file repositories/reference/linux-study-clean/arch/powerpc/platforms/pseries/mobility.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/platforms/pseries/mobility.c- Extension
.c- Size
- 19242 bytes
- Lines
- 833
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- 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.
- 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/cpu.hlinux/kernel.hlinux/kobject.hlinux/nmi.hlinux/sched.hlinux/smp.hlinux/stat.hlinux/stop_machine.hlinux/completion.hlinux/device.hlinux/delay.hlinux/slab.hlinux/stringify.hasm/machdep.hasm/nmi.hasm/rtas.hpseries.hvas.hpapr-hvpipe.h../../kernel/cacheinfo.h
Detected Declarations
struct update_props_workareastruct pseries_suspend_infoenum vasi_aborting_entityfunction register_nmi_wd_lpm_factor_sysctlfunction mobility_rtas_callfunction delete_dt_nodefunction update_dt_propertyfunction update_dt_nodefunction add_dt_nodefunction delete_dt_nodefunction pseries_devicetree_updatefunction post_mobility_fixupfunction poll_vasi_statefunction wait_for_vasi_session_suspendingfunction wait_for_vasi_session_completedfunction poll_vasi_statefunction prod_singlefunction prod_othersfunction for_each_online_cpufunction clamp_slb_sizefunction do_suspendfunction do_joinfunction pseries_cancel_migrationfunction pseries_suspendfunction pseries_migrate_partitionfunction rtas_syscall_dispatch_ibm_suspend_mefunction migration_storefunction mobility_sysfs_initmodule init register_nmi_wd_lpm_factor_sysctl
Annotated Snippet
device_initcall(register_nmi_wd_lpm_factor_sysctl);
#endif /* CONFIG_SYSCTL */
#endif /* CONFIG_PPC_WATCHDOG */
static int mobility_rtas_call(int token, char *buf, s32 scope)
{
int rc;
spin_lock(&rtas_data_buf_lock);
memcpy(rtas_data_buf, buf, RTAS_DATA_BUF_SIZE);
rc = rtas_call(token, 2, 1, NULL, rtas_data_buf, scope);
memcpy(buf, rtas_data_buf, RTAS_DATA_BUF_SIZE);
spin_unlock(&rtas_data_buf_lock);
return rc;
}
static int delete_dt_node(struct device_node *dn)
{
struct device_node *pdn;
bool is_platfac;
pdn = of_get_parent(dn);
is_platfac = of_node_is_type(dn, "ibm,platform-facilities") ||
of_node_is_type(pdn, "ibm,platform-facilities");
of_node_put(pdn);
/*
* The drivers that bind to nodes in the platform-facilities
* hierarchy don't support node removal, and the removal directive
* from firmware is always followed by an add of an equivalent
* node. The capability (e.g. RNG, encryption, compression)
* represented by the node is never interrupted by the migration.
* So ignore changes to this part of the tree.
*/
if (is_platfac) {
pr_notice("ignoring remove operation for %pOFfp\n", dn);
return 0;
}
pr_debug("removing node %pOFfp\n", dn);
dlpar_detach_node(dn);
return 0;
}
static int update_dt_property(struct device_node *dn, struct property **prop,
const char *name, u32 vd, char *value)
{
struct property *new_prop = *prop;
int more = 0;
/* A negative 'vd' value indicates that only part of the new property
* value is contained in the buffer and we need to call
* ibm,update-properties again to get the rest of the value.
*
* A negative value is also the two's compliment of the actual value.
*/
if (vd & 0x80000000) {
vd = ~vd + 1;
more = 1;
}
if (new_prop) {
/* partial property fixup */
char *new_data = kzalloc(new_prop->length + vd, GFP_KERNEL);
if (!new_data)
return -ENOMEM;
memcpy(new_data, new_prop->value, new_prop->length);
memcpy(new_data + new_prop->length, value, vd);
kfree(new_prop->value);
new_prop->value = new_data;
new_prop->length += vd;
} else {
new_prop = kzalloc_obj(*new_prop);
if (!new_prop)
return -ENOMEM;
new_prop->name = kstrdup(name, GFP_KERNEL);
if (!new_prop->name) {
kfree(new_prop);
return -ENOMEM;
}
new_prop->length = vd;
new_prop->value = kzalloc(new_prop->length, GFP_KERNEL);
if (!new_prop->value) {
kfree(new_prop->name);
Annotation
- Immediate include surface: `linux/cpu.h`, `linux/kernel.h`, `linux/kobject.h`, `linux/nmi.h`, `linux/sched.h`, `linux/smp.h`, `linux/stat.h`, `linux/stop_machine.h`.
- Detected declarations: `struct update_props_workarea`, `struct pseries_suspend_info`, `enum vasi_aborting_entity`, `function register_nmi_wd_lpm_factor_sysctl`, `function mobility_rtas_call`, `function delete_dt_node`, `function update_dt_property`, `function update_dt_node`, `function add_dt_node`, `function delete_dt_node`.
- Atlas domain: Architecture Layer / arch/powerpc.
- 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.