virt: tegra: tegra_hv: print total IVC and mempool memory usage

bug 4115385
bug 4136301

Change-Id: Idfdf1b3a45943b4da58bb7da9070825472ec3d53
Signed-off-by: Shreshtha SAHU <ssahu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2997776
Reviewed-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-by: Kasinadha Dendukuri <kdendukuri@nvidia.com>
Tested-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Shreshtha SAHU
2023-02-23 09:11:13 +00:00
committed by mobile promotions
parent 9a65689ba2
commit 36531e7e1d

View File

@@ -410,6 +410,8 @@ static int tegra_hv_setup(struct tegra_hv_data *hvd)
uint32_t i;
int ret;
uint32_t *interrupts_arr;
uint64_t ivcsize = 0;
uint64_t mpsize = 0;
hvd->dev = of_find_compatible_node(NULL, NULL, "nvidia,tegra-hv");
if (!hvd->dev) {
@@ -576,6 +578,9 @@ static int tegra_hv_setup(struct tegra_hv_data *hvd)
ERR("failed to add queue #%u\n", qd->id);
return ret;
}
ivcsize += qd->size;
BUG_ON(ivcsize < qd->size);
}
hvd->mempools =
@@ -600,10 +605,15 @@ static int tegra_hv_setup(struct tegra_hv_data *hvd)
ivmk->size = mpd->size;
ivmk->peer_vmid = mpd->peer_vmid;
mpsize += mpd->size;
BUG_ON(mpsize < mpd->size);
INFO("added mempool %u: ipa=%llx size=%llx peer=%u\n",
mpd->id, mpd->pa, mpd->size, mpd->peer_vmid);
}
INFO("Memory usage: ivc:0x%llx mempool=0x%llx\n", ivcsize, mpsize);
return 0;
}