Skip to content

Commit ad2d855

Browse files
zhouji3xlijinxia
authored andcommitted
hv: save registers on exception
This patch is for crashmode/ramdump. when exception occur: 1) save registers; 2) flush cache Signed-off-by: zhouji3x <jianfengx.zhou@intel.com> Reviewed-by: Yin Fengwei <fengwei.yin@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent 977c4b2 commit ad2d855

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

hypervisor/debug/dump.c

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

47+
/* Global variable for save registers on exception */
48+
struct intr_excp_ctx *crash_ctx;
49+
4750
static void dump_guest_reg(struct vcpu *vcpu)
4851
{
4952
struct run_context *cur_context =
@@ -283,4 +286,8 @@ void dump_exception(struct intr_excp_ctx *ctx, uint32_t cpu_id)
283286
show_host_call_trace(ctx->rsp, ctx->rbp, cpu_id);
284287
/* Dump guest context */
285288
dump_guest_context(cpu_id);
289+
290+
/* Save registers*/
291+
crash_ctx = ctx;
292+
CACHE_FLUSH_INVALIDATE_ALL();
286293
}

0 commit comments

Comments
 (0)