Skip to content
Permalink
Browse files

Merge pull request #223 from coxuintel/linux_build

Fix compiling warnings and errors on Linux.
  • Loading branch information...
wcwang committed Aug 5, 2019
2 parents 25b1856 + cf6d073 commit be7b3c6ba19870610b86c02d5d3e69447f58904c
Showing with 10 additions and 8 deletions.
  1. +1 −1 core/gpa_space.c
  2. +3 −1 core/include/vmx.h
  3. +4 −6 core/vcpu.c
  4. +2 −0 include/linux/hax_types_linux.h
@@ -244,7 +244,7 @@ int gpa_space_write_data(hax_gpa_space *gpa_space, uint64_t start_gpa, int len,
{
uint8_t *buf;
hax_kmap_user kmap;
bool writable;
bool writable = false;
int ret, nbytes;

if (!data) {
@@ -657,14 +657,16 @@ void vmx_vmwrite(struct vcpu_t *vcpu, const char *name,
#define vmwrite(vcpu, x, y) vmx_vmwrite(vcpu, #x, x, y)

#define VMREAD_SEG(vcpu, seg, val) \
do { \
((val).selector = vmread(vcpu, GUEST_##seg##_SELECTOR), \
(val).base = vmread(vcpu, GUEST_##seg##_BASE), \
(val).limit = vmread(vcpu, GUEST_##seg##_LIMIT), \
(val).ar = vmread(vcpu, GUEST_##seg##_AR)); \
{ \
if ((val).null == 1) \
(val).ar = 0; \
}
} \
} while (false)

#define VMREAD_DESC(vcpu, desc, val) \
((val).base = vmread(vcpu, GUEST_##desc##_BASE), \
@@ -1417,9 +1417,9 @@ static void fill_common_vmcs(struct vcpu_t *vcpu)
vmwrite(vcpu, HOST_GDTR_BASE, get_kernel_gdtr_base());
vmwrite(vcpu, HOST_IDTR_BASE, get_kernel_idtr_base());

#define WRITE_CONTROLS(vcpu, f, v) { \
uint32_t g = v & cpu_data->vmx_info.v##_1 | cpu_data->vmx_info.v##_0; \
vmwrite(vcpu, f, v = g); \
#define WRITE_CONTROLS(vcpu, f, v) { \
uint32_t g = (v & cpu_data->vmx_info.v##_1) | cpu_data->vmx_info.v##_0; \
vmwrite(vcpu, f, v = g); \
}

WRITE_CONTROLS(vcpu, VMX_PIN_CONTROLS, pin_ctls);
@@ -2527,6 +2527,7 @@ static void handle_cpuid_virtual(struct vcpu_t *vcpu, uint32_t a, uint32_t c)
struct vcpu_state_t *state = vcpu->state;
uint32_t hw_family;
uint32_t hw_model;
uint8_t physical_address_size;

static uint32_t cpu_features_1 =
// pat is disabled!
@@ -2575,8 +2576,6 @@ static void handle_cpuid_virtual(struct vcpu_t *vcpu, uint32_t a, uint32_t c)
cpu_features_ext |= FEATURE(RDTSCP);
}

uint8_t physical_address_size;

switch (a) {
case 0: { // Maximum Basic Information
state->_eax = 0xa;
@@ -3845,7 +3844,6 @@ static int exit_ept_violation(struct vcpu_t *vcpu, struct hax_tunnel *htun)
return HAX_RESUME;
}
// ret == 0: The EPT violation is due to MMIO
mmio_handler:
#endif
return vcpu_emulate_insn(vcpu);
}
@@ -33,7 +33,9 @@
#define HAX_LINUX_HAX_TYPES_LINUX_H_

#include <linux/types.h>
#define _ASM_X86_CPUFEATURES_H
#include <linux/string.h>
#undef _ASM_X86_CPUFEATURES_H
#include <linux/errno.h>

// Signed Types

0 comments on commit be7b3c6

Please sign in to comment.
You can’t perform that action at this time.