[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 7/7] spapr_hcall: h_home_node_associativity now reads numa_ass
From: |
Daniel Henrique Barboza |
Subject: |
[PATCH v2 7/7] spapr_hcall: h_home_node_associativity now reads numa_assoc_array |
Date: |
Tue, 1 Sep 2020 09:56:45 -0300 |
home_node_associativity reply now uses the associativity
values for tcpu->node_id provided by numa_assoc_array.
This will avoid further changes in this code when numa_assoc_array
changes values, but it won't be enough to prevent further changes
if (falar aqui q se mudar o tamanho do array tem q mexer nessa
funcao tambem, falar q a macro associativity() deixa a automacao
de tudo mto unreadable)
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
hw/ppc/spapr_hcall.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
index c1d01228c6..2ec30efdcb 100644
--- a/hw/ppc/spapr_hcall.c
+++ b/hw/ppc/spapr_hcall.c
@@ -1878,9 +1878,13 @@ static target_ulong h_home_node_associativity(PowerPCCPU
*cpu,
target_ulong opcode,
target_ulong *args)
{
+ SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
target_ulong flags = args[0];
target_ulong procno = args[1];
PowerPCCPU *tcpu;
+ uint32_t assoc_domain1;
+ uint32_t assoc_domain2;
+ uint32_t assoc_domain3;
int idx;
/* only support procno from H_REGISTER_VPA */
@@ -1893,13 +1897,21 @@ static target_ulong
h_home_node_associativity(PowerPCCPU *cpu,
return H_P2;
}
+ /*
+ * Index 0 is the ibm,associativity size of the node,
+ * which isn't relevant here.
+ */
+ assoc_domain1 = smc->numa_assoc_array[tcpu->node_id][1];
+ assoc_domain2 = smc->numa_assoc_array[tcpu->node_id][2];
+ assoc_domain3 = smc->numa_assoc_array[tcpu->node_id][3];
+
/* sequence is the same as in the "ibm,associativity" property */
idx = 0;
#define ASSOCIATIVITY(a, b) (((uint64_t)(a) << 32) | \
((uint64_t)(b) & 0xffffffff))
- args[idx++] = ASSOCIATIVITY(0, 0);
- args[idx++] = ASSOCIATIVITY(0, tcpu->node_id);
+ args[idx++] = ASSOCIATIVITY(assoc_domain1, assoc_domain2);
+ args[idx++] = ASSOCIATIVITY(assoc_domain3, tcpu->node_id);
args[idx++] = ASSOCIATIVITY(procno, -1);
for ( ; idx < 6; idx++) {
args[idx] = -1;
--
2.26.2
- Re: [PATCH v2 3/7] spapr: introduce SpaprMachineClass::numa_assoc_array, (continued)
- [PATCH v2 5/7] spapr, spapr_numa: move lookup-arrays handling to spapr_numa.c, Daniel Henrique Barboza, 2020/09/01
- [PATCH v2 1/7] ppc: introducing spapr_numa.c NUMA code helper, Daniel Henrique Barboza, 2020/09/01
- [PATCH v2 4/7] spapr, spapr_numa: handle vcpu ibm,associativity, Daniel Henrique Barboza, 2020/09/01
- [PATCH v2 6/7] spapr_numa: move NVLink2 associativity handling to spapr_numa.c, Daniel Henrique Barboza, 2020/09/01
- [PATCH v2 7/7] spapr_hcall: h_home_node_associativity now reads numa_assoc_array,
Daniel Henrique Barboza <=
- Re: [PATCH v2 0/7] pseries NUMA distance rework, David Gibson, 2020/09/02