From 9af38e16e5c8367c1d0a126d8e7960421ff21530 Mon Sep 17 00:00:00 2001 From: Kaige Fu Date: Wed, 23 May 2018 13:05:22 +0800 Subject: [PATCH] HV: Add log info when setup hvlog share buf We have two sbuf for hvlog: one is allocated by hv for "early hvlog" and the other one is allocated by SOS. Once SOS allocate the later one, the hv allocated sbufs would be released after the contents being copied, we call it sbuf switch. And there is a trick here to guarantee that the switch of a certain per_cpu sbuf is being done on exactly the certain physical CPU, that is doing the switch at the first print after SOS allocated and setup its sbuf. Because there are few logmsg within our current code, so will wait a bit long for the next print. For ordinary case, it should be ok. However, for the BTM(Boot Time Measurement) case, we need the content of "early hvlog" for boot time calculation and it is not ok. So, we print those prints to force the sbuf switch. Signed-off-by: Kaige Fu Reviewed-by: Kevin Tian --- hypervisor/debug/sbuf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hypervisor/debug/sbuf.c b/hypervisor/debug/sbuf.c index 486248dd7..e5cbb1e3f 100644 --- a/hypervisor/debug/sbuf.c +++ b/hypervisor/debug/sbuf.c @@ -186,5 +186,8 @@ int sbuf_share_setup(uint32_t pcpu_id, uint32_t sbuf_id, uint64_t *hva) return -EINVAL; per_cpu(sbuf, pcpu_id)[sbuf_id] = hva; + pr_info("%s share sbuf for pCPU[%u] with sbuf_id[%u] setup successfully", + __func__, pcpu_id, sbuf_id); + return 0; }