clear-pkgs-linux-iot-lts2018/0987-SEP-Bug-fix-to-prevent...

58 lines
2.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Manisha Chinthapally <manisha.chinthapally@intel.com>
Date: Fri, 15 Feb 2019 14:00:28 -0800
Subject: [PATCH] SEP Bug fix to prevent Vtune crash with event multiplexing
SEP doesn't support Multiplexing of events for ACRN.
Vtune/SEP crashes when MUX events are provided,
Fixed the issue by exiting gracefully instead of crashing.
Tracked-on: PKT-1745
Signed-off-by: Lim, Min Yeol <min.yeol.lim@intel.com>
Signed-off-by: Manisha Chinthapally <manisha.chinthapally@intel.com>
---
drivers/platform/x86/sepdk/include/lwpmudrv_struct.h | 5 ++++-
drivers/platform/x86/sepdk/sep/lwpmudrv.c | 3 +++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/platform/x86/sepdk/include/lwpmudrv_struct.h b/drivers/platform/x86/sepdk/include/lwpmudrv_struct.h
index 629750152fdb..6afb2ac8839d 100644
--- a/drivers/platform/x86/sepdk/include/lwpmudrv_struct.h
+++ b/drivers/platform/x86/sepdk/include/lwpmudrv_struct.h
@@ -1475,7 +1475,8 @@ struct DRV_SETUP_INFO_NODE_S {
U64 matrix_inaccessible : 1;
U64 page_table_isolation : 2;
U64 pebs_ignored_by_pti : 1;
- U64 reserved1 : 47;
+ U64 core_event_mux_unavailable : 1;
+ U64 reserved1 : 46;
} s1;
} u1;
U64 reserved2;
@@ -1495,6 +1496,8 @@ struct DRV_SETUP_INFO_NODE_S {
((info)->u1.s1.page_table_isolation)
#define DRV_SETUP_INFO_pebs_ignored_by_pti(info) \
((info)->u1.s1.pebs_ignored_by_pti)
+#define DRV_SETUP_INFO_core_event_mux_unavailable(info) \
+ ((info)->u1.s1.core_event_mux_unavailable)
#define DRV_SETUP_INFO_PTI_DISABLED 0
#define DRV_SETUP_INFO_PTI_KPTI 1
diff --git a/drivers/platform/x86/sepdk/sep/lwpmudrv.c b/drivers/platform/x86/sepdk/sep/lwpmudrv.c
index 6f6772433cce..799c61cde378 100644
--- a/drivers/platform/x86/sepdk/sep/lwpmudrv.c
+++ b/drivers/platform/x86/sepdk/sep/lwpmudrv.c
@@ -6173,6 +6173,9 @@ static OS_STATUS lwpmudrv_Get_Drv_Setup_Info(IOCTL_ARGS args)
DRV_SETUP_INFO_PTI_KPTI;
}
#endif
+#if defined(DRV_SEP_ACRN_ON)
+ DRV_SETUP_INFO_core_event_mux_unavailable(&req_drv_setup_info) = 1;
+#endif
SEP_DRV_LOG_TRACE("DRV_SETUP_INFO nmi_mode %d.",
DRV_SETUP_INFO_nmi_mode(&req_drv_setup_info));
--
https://clearlinux.org