spapr_numa: use spapr_numa_get_vcpu_assoc() in home_node hcall
commit876ab8d89d0d288945334c8caa908b07ef847de2
authorDaniel Henrique Barboza <danielhb413@gmail.com>
Fri, 4 Sep 2020 17:24:22 +0000 (4 14:24 -0300)
committerDavid Gibson <david@gibson.dropbear.id.au>
Tue, 8 Sep 2020 01:34:30 +0000 (8 11:34 +1000)
tree648da7413b4d393002611131d415c5530db7a7a7
parentd370f9cf0aac54b091047392427d3d5ec93182c3
spapr_numa: use spapr_numa_get_vcpu_assoc() in home_node hcall

The current implementation of h_home_node_associativity hard codes
the values of associativity domains of the vcpus. Let's make
it consider the values already initialized in spapr->numa_assoc_array,
via the spapr_numa_get_vcpu_assoc() helper.

We want to set it and forget it, and for that we also need to
assert that we don't overflow the registers of the hypercall.
>From R4 to R9 we can squeeze in 12 associativity domains for
vcpus, so let's assert that VCPU_ASSOC_SIZE -1 isn't greater
than that.

Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20200904172422.617460-4-danielhb413@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr_numa.c