18 #include <linux/device.h>
20 #include <linux/slab.h>
22 #include <asm/uv/uv_hub.h>
29 static unsigned long *xpc_part_nasids;
32 static int xpc_nasid_mask_nbytes;
66 xpc_get_rsvd_page_pa(
int nasid)
70 unsigned long rp_pa = nasid;
75 enum xp_retval (*get_partition_rsvd_page_pa)
76 (
void *,
u64 *,
unsigned long *,
size_t *) =
87 ret = get_partition_rsvd_page_pa(buf, &cookie, &rp_pa, &len);
90 "address=0x%016lx, len=0x%016lx\n", ret,
91 (
unsigned long)cookie, rp_pa, len);
101 if (buf_base !=
NULL)
106 if (buf_base ==
NULL) {
108 "len=0x%016lx\n", buf_len);
139 struct xpc_rsvd_page *
rp;
141 unsigned long new_ts_jiffies;
162 "supported range (< 0 || >= %d)\n", rp->
SAL_partid,
193 if (new_ts_jiffies == 0 || new_ts_jiffies == rp->
ts_jiffies)
217 struct xpc_rsvd_page *remote_rp,
unsigned long *remote_rp_pa)
224 *remote_rp_pa = xpc_get_rsvd_page_pa(nasid);
225 if (*remote_rp_pa == 0)
234 if (discovered_nasids !=
NULL) {
235 unsigned long *remote_part_nasids =
239 discovered_nasids[l] |= remote_part_nasids[l];
289 "partition %d timed out\n", partid);
303 xpc_wakeup_channel_mgr(part);
305 xpc_arch_ops.cancel_partition_deactivation_request(part);
316 unsigned long irq_flags;
329 spin_unlock_irqrestore(&part->
act_lock, irq_flags);
341 unsigned long irq_flags;
347 spin_unlock_irqrestore(&part->
act_lock, irq_flags);
359 spin_unlock_irqrestore(&part->
act_lock, irq_flags);
366 spin_unlock_irqrestore(&part->
act_lock, irq_flags);
388 unsigned long irq_flags;
395 spin_unlock_irqrestore(&part->
act_lock, irq_flags);
411 void *remote_rp_base;
412 struct xpc_rsvd_page *remote_rp;
413 unsigned long remote_rp_pa;
418 struct xpc_rsvd_page *
rp;
419 unsigned long *discovered_nasids;
423 xpc_nasid_mask_nbytes,
425 if (remote_rp ==
NULL)
430 if (discovered_nasids ==
NULL) {
431 kfree(remote_rp_base);
435 rp = (
struct xpc_rsvd_page *)xpc_rsvd_page;
449 switch (region_size) {
461 for (region = 0; region < max_regions; region++) {
468 for (nasid = (region * region_size * 2);
469 nasid < ((region + 1) * region_size * 2); nasid += 2) {
476 if (
test_bit(nasid / 2, xpc_part_nasids)) {
478 "part of the local partition; skipping "
485 "not on Numa-Link network at reset\n",
490 if (
test_bit(nasid / 2, discovered_nasids)) {
492 "partition which was previously "
493 "discovered\n", nasid);
500 remote_rp, &remote_rp_pa);
503 "from nasid %d, reason=%d\n", nasid,
513 remote_rp_pa, nasid);
517 kfree(discovered_nasids);
518 kfree(remote_rp_base);
529 unsigned long part_nasid_pa;
531 part = &xpc_partitions[partid];
535 memset(nasid_mask, 0, xpc_nasid_mask_nbytes);
540 xpc_nasid_mask_nbytes);