Skip to content

Commit 1745a7b

Browse files
davejiangdjbw
authored andcommitted
ACPI: HMAT: Introduce 2 levels of generic port access class
In order to compute access0 and access1 classes for CXL memory, 2 levels of generic port information must be stored. Access0 will indicate the generic port access coordinates to the closest initiator and access1 will indicate the generic port access coordinates to the cloest CPU. Cc: Rafael J. Wysocki <rafael@kernel.org> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Tested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Dave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/20240308220055.2172956-4-dave.jiang@intel.com Signed-off-by: Dan Williams <dan.j.williams@intel.com>
1 parent 11270e5 commit 1745a7b

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

drivers/acpi/numa/hmat.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ struct target_cache {
5959
};
6060

6161
enum {
62-
NODE_ACCESS_CLASS_GENPORT_SINK = ACCESS_COORDINATE_MAX,
62+
NODE_ACCESS_CLASS_GENPORT_SINK_LOCAL = ACCESS_COORDINATE_MAX,
63+
NODE_ACCESS_CLASS_GENPORT_SINK_CPU,
6364
NODE_ACCESS_CLASS_MAX,
6465
};
6566

@@ -141,7 +142,7 @@ int acpi_get_genport_coordinates(u32 uid,
141142
if (!target)
142143
return -ENOENT;
143144

144-
*coord = target->coord[NODE_ACCESS_CLASS_GENPORT_SINK];
145+
*coord = target->coord[NODE_ACCESS_CLASS_GENPORT_SINK_LOCAL];
145146

146147
return 0;
147148
}
@@ -695,7 +696,8 @@ static void hmat_update_target_attrs(struct memory_target *target,
695696
int i;
696697

697698
/* Don't update for generic port if there's no device handle */
698-
if (access == NODE_ACCESS_CLASS_GENPORT_SINK &&
699+
if ((access == NODE_ACCESS_CLASS_GENPORT_SINK_LOCAL ||
700+
access == NODE_ACCESS_CLASS_GENPORT_SINK_CPU) &&
699701
!(*(u16 *)target->gen_port_device_handle))
700702
return;
701703

@@ -736,7 +738,8 @@ static void hmat_update_target_attrs(struct memory_target *target,
736738
list_for_each_entry(initiator, &initiators, node) {
737739
u32 value;
738740

739-
if (access == ACCESS_COORDINATE_CPU &&
741+
if ((access == ACCESS_COORDINATE_CPU ||
742+
access == NODE_ACCESS_CLASS_GENPORT_SINK_CPU) &&
740743
!initiator->has_cpu) {
741744
clear_bit(initiator->processor_pxm, p_nodes);
742745
continue;
@@ -775,7 +778,9 @@ static void hmat_update_generic_target(struct memory_target *target)
775778
static DECLARE_BITMAP(p_nodes, MAX_NUMNODES);
776779

777780
hmat_update_target_attrs(target, p_nodes,
778-
NODE_ACCESS_CLASS_GENPORT_SINK);
781+
NODE_ACCESS_CLASS_GENPORT_SINK_LOCAL);
782+
hmat_update_target_attrs(target, p_nodes,
783+
NODE_ACCESS_CLASS_GENPORT_SINK_CPU);
779784
}
780785

781786
static void hmat_register_target_initiators(struct memory_target *target)

0 commit comments

Comments
 (0)