From 03ae242eb770b041e786355faaf0241aadc9346b Mon Sep 17 00:00:00 2001 From: Yonghua Huang Date: Tue, 22 May 2018 22:32:24 +0800 Subject: [PATCH] HV:initialize variables before reference in vmx.c - to avoid complains from code static scan tool Signed-off-by: Yonghua Huang --- hypervisor/arch/x86/vmx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hypervisor/arch/x86/vmx.c b/hypervisor/arch/x86/vmx.c index 43a3f9dff..50607bdf4 100644 --- a/hypervisor/arch/x86/vmx.c +++ b/hypervisor/arch/x86/vmx.c @@ -372,7 +372,7 @@ static void init_guest_state(struct vcpu *vcpu) /* Limit */ limit = 0xFFFF; } else if (get_vcpu_mode(vcpu) == PAGE_PROTECTED_MODE) { - descriptor_table gdtb; + descriptor_table gdtb = {0, 0}; /* Base *//* TODO: Should guest GDTB point to host GDTB ? */ /* Obtain the current global descriptor table base */ @@ -407,7 +407,7 @@ static void init_guest_state(struct vcpu *vcpu) /* Limit */ limit = 0xFFFF; } else if (get_vcpu_mode(vcpu) == PAGE_PROTECTED_MODE) { - descriptor_table idtb ; + descriptor_table idtb = {0, 0}; /* TODO: Should guest IDTR point to host IDTR ? */ asm volatile ("sidt %0"::"m" (idtb)); @@ -660,8 +660,8 @@ static void init_host_state(__unused struct vcpu *vcpu) uint64_t trbase_lo; uint64_t trbase_hi; uint64_t realtrbase; - descriptor_table gdtb; - descriptor_table idtb; + descriptor_table gdtb = {0, 0}; + descriptor_table idtb = {0, 0}; uint16_t tr_sel; pr_dbg("*********************");