From: Daniel Henrique Barboza <danielhb413@gmail.com>
To: qemu-devel@nongnu.org
Cc: Daniel Henrique Barboza <danielhb413@gmail.com>,
qemu-ppc@nongnu.org, david@gibson.dropbear.id.au
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 [thread overview]
Message-ID: <20200901125645.118026-8-danielhb413@gmail.com> (raw)
In-Reply-To: <20200901125645.118026-1-danielhb413@gmail.com>
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
next prev parent reply other threads:[~2020-09-01 13:05 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-01 12:56 [PATCH v2 0/7] pseries NUMA distance rework Daniel Henrique Barboza
2020-09-01 12:56 ` [PATCH v2 1/7] ppc: introducing spapr_numa.c NUMA code helper Daniel Henrique Barboza
2020-09-01 12:56 ` [PATCH v2 2/7] ppc/spapr_nvdimm: turn spapr_dt_nvdimm() static Daniel Henrique Barboza
2020-09-01 12:56 ` [PATCH v2 3/7] spapr: introduce SpaprMachineClass::numa_assoc_array Daniel Henrique Barboza
2020-09-03 1:51 ` David Gibson
2020-09-03 11:28 ` Daniel Henrique Barboza
2020-09-01 12:56 ` [PATCH v2 4/7] spapr, spapr_numa: handle vcpu ibm,associativity Daniel Henrique Barboza
2020-09-01 12:56 ` [PATCH v2 5/7] spapr, spapr_numa: move lookup-arrays handling to spapr_numa.c Daniel Henrique Barboza
2020-09-03 1:34 ` David Gibson
2020-09-03 11:22 ` Daniel Henrique Barboza
2020-09-01 12:56 ` [PATCH v2 6/7] spapr_numa: move NVLink2 associativity " Daniel Henrique Barboza
2020-09-03 1:56 ` David Gibson
2020-09-03 14:20 ` Daniel Henrique Barboza
2020-09-01 12:56 ` Daniel Henrique Barboza [this message]
2020-09-03 1:46 ` [PATCH v2 7/7] spapr_hcall: h_home_node_associativity now reads numa_assoc_array David Gibson
2020-09-03 11:17 ` Daniel Henrique Barboza
2020-09-03 1:35 ` [PATCH v2 0/7] pseries NUMA distance rework David Gibson
2020-09-03 1:49 ` David Gibson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200901125645.118026-8-danielhb413@gmail.com \
--to=danielhb413@gmail.com \
--cc=david@gibson.dropbear.id.au \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).