clear-pkgs-linux-iot-lts2018/0559-sos-vhm-add-HC_SETUP_H...

85 lines
2.9 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zhi Jin <zhi.jin@intel.com>
Date: Wed, 1 Aug 2018 14:58:50 +0800
Subject: [PATCH] sos: vhm: add HC_SETUP_HV_NPK_LOG hypercall
This hypercall is used to enable/disable/configure the hypervisor
NPK log.
Tracked-On: https://github.com/projectacrn/acrn-hypervisor/issues/1138
Signed-off-by: Zhi Jin <zhi.jin@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
---
drivers/vhm/vhm_hypercall.c | 5 +++++
include/linux/vhm/acrn_hv_defs.h | 18 ++++++++++++++++++
include/linux/vhm/vhm_hypercall.h | 1 +
3 files changed, 24 insertions(+)
diff --git a/drivers/vhm/vhm_hypercall.c b/drivers/vhm/vhm_hypercall.c
index 9a92d68..d994835 100644
--- a/drivers/vhm/vhm_hypercall.c
+++ b/drivers/vhm/vhm_hypercall.c
@@ -92,6 +92,11 @@ inline long hcall_setup_sbuf(unsigned long sbuf_head)
return acrn_hypercall1(HC_SETUP_SBUF, sbuf_head);
}
+inline long hcall_setup_hv_npk_log(unsigned long hv_npk_log)
+{
+ return acrn_hypercall1(HC_SETUP_HV_NPK_LOG, hv_npk_log);
+}
+
inline long hcall_set_sstate_data(unsigned long sx_data_addr)
{
return acrn_hypercall1(HC_PM_SET_SSTATE_DATA, sx_data_addr);
diff --git a/include/linux/vhm/acrn_hv_defs.h b/include/linux/vhm/acrn_hv_defs.h
index 223702c..24ca7be 100644
--- a/include/linux/vhm/acrn_hv_defs.h
+++ b/include/linux/vhm/acrn_hv_defs.h
@@ -108,6 +108,7 @@
/* DEBUG */
#define HC_ID_DBG_BASE 0x60UL
#define HC_SETUP_SBUF _HC_ID(HC_ID, HC_ID_DBG_BASE + 0x00)
+#define HC_SETUP_HV_NPK_LOG _HC_ID(HC_ID, HC_ID_DBG_BASE + 0x01)
/* Power management */
#define HC_ID_PM_BASE 0x80UL
@@ -188,6 +189,23 @@ struct sbuf_setup_param {
uint64_t gpa;
} __attribute__((aligned(8)));
+struct hv_npk_log_param {
+ /* the setup command for the hypervisor NPK log */
+ uint16_t cmd;
+
+ /* the setup result for the hypervisor NPK log */
+ uint16_t res;
+
+ /* the loglevel for the hypervisor NPK log */
+ uint16_t loglevel;
+
+ /* Reserved */
+ uint16_t reserved;
+
+ /* the MMIO address for the hypervisor NPK log */
+ uint64_t mmio_addr;
+} __attribute__((aligned(8)));
+
struct vm_gpa2hpa {
uint64_t gpa; /* IN: gpa to translation */
uint64_t hpa; /* OUT: -1 means invalid gpa */
diff --git a/include/linux/vhm/vhm_hypercall.h b/include/linux/vhm/vhm_hypercall.h
index 0a3869b..703b35b 100644
--- a/include/linux/vhm/vhm_hypercall.h
+++ b/include/linux/vhm/vhm_hypercall.h
@@ -146,6 +146,7 @@ inline long hcall_destroy_vm(unsigned long vmid);
inline long hcall_reset_vm(unsigned long vmid);
inline long hcall_query_vm_state(unsigned long vmid);
inline long hcall_setup_sbuf(unsigned long sbuf_head);
+inline long hcall_setup_hv_npk_log(unsigned long hv_npk_log);
inline long hcall_set_sstate_data(unsigned long sx_data_addr);
inline long hcall_get_cpu_state(unsigned long cmd, unsigned long state_pa);
inline long hcall_set_memory_regions(unsigned long pa_regions);
--
https://clearlinux.org