Skip to content

Commit 2908f09

Browse files
zhouji3xlijinxia
authored andcommitted
hv: fix ramdump regression
this patch change type of global variable for saving registers on execption. global variable 'crash_ctx' should not be set to static. crash_ctx is for offline analysis when system crashed, not for runtime usage. as crash_ctx is only be set without being read, compiler will regard crash_ctx as an useless variable if it is set to static, and will not generate code for it. Tracked-On: #1295 Signed-off-by: zhouji3x <jianfengx.zhou@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
1 parent 52ee615 commit 2908f09

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

hypervisor/debug/dump.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,15 @@ static const char *const excp_names[32] = {
4444
[31] = "Intel Reserved"
4545
};
4646

47-
/* Global variable for save registers on exception */
48-
static struct intr_excp_ctx *crash_ctx;
47+
/*
48+
* Global variable for save registers on exception.
49+
* don't change crash_ctx to static.
50+
* crash_ctx is for offline analysis when system crashed, not for runtime usage.
51+
* as crash_ctx is only be set without being read, compiler will regard
52+
* crash_ctx as an useless variable if it is set to static, and will not
53+
* generate code for it.
54+
*/
55+
struct intr_excp_ctx *crash_ctx;
4956

5057
static void dump_guest_reg(struct vcpu *vcpu)
5158
{

0 commit comments

Comments
 (0)