aboutsummaryrefslogtreecommitdiff
path: root/include/npu2.h
diff options
context:
space:
mode:
authorAlexey Kardashevskiy <aik@ozlabs.ru>2018-12-04 15:41:55 +1100
committerStewart Smith <stewart@linux.ibm.com>2019-02-25 23:04:20 -0600
commitba1d95a1d460e0241d21561194c4cd06e518f329 (patch)
treee2eb8d60c289bc044e873a16aec392697798e71c /include/npu2.h
parentb821f8c2a8e38c18b0dd976b15f699d243a6099f (diff)
downloadskiboot-ba1d95a1d460e0241d21561194c4cd06e518f329.zip
skiboot-ba1d95a1d460e0241d21561194c4cd06e518f329.tar.gz
skiboot-ba1d95a1d460e0241d21561194c4cd06e518f329.tar.bz2
npu2: Add XTS_BDF_MAP wildcard refcount
Currently PID wildcard is programmed into the NPU once and never cleared up. This works for the bare metal as MSR does not change while the host OS is running. However with the device virtualization, we need to keep track of wildcard entries use and clear them up before switching a GPU from a host to a guest or vice versa. This adds refcount to a NPU2, one counter per wildcard entry. The index is a short lparid (4 bits long) which is allocated in opal_npu_map_lpar() and should be smaller than NPU2_XTS_BDF_MAP_SIZE (defined as 16). Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Acked-by: Reza Arbab <arbab@linux.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'include/npu2.h')
-rw-r--r--include/npu2.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/npu2.h b/include/npu2.h
index 0e79e0e..cfa3b1f 100644
--- a/include/npu2.h
+++ b/include/npu2.h
@@ -19,6 +19,7 @@
#include <pci.h>
#include <phys-map.h>
+#include <npu2-regs.h>
/* Debugging options */
#define NPU2DBG(p, fmt, a...) prlog(PR_DEBUG, "NPU%d: " fmt, \
@@ -158,6 +159,7 @@ struct npu2 {
uint32_t total_devices;
struct npu2_dev *devices;
enum phys_map_type gpu_map_type;
+ int ctx_ref[NPU2_XTS_BDF_MAP_SIZE];
/* IODA cache */
uint64_t tve_cache[16];