X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fsvm.c;h=0e37c4cdda8e3d09d5264d5c8d6d1a0298238732;hb=3650bf4aaa4f83afae52c8fee98fce6e3ee68deb;hp=d1125eef170aaade706f46412b7d466035f03f29;hpb=755eccfbd8dff71bfbd6be828ef3725ecdcd4d4d;p=palacios.git diff --git a/palacios/src/palacios/svm.c b/palacios/src/palacios/svm.c index d1125ee..0e37c4c 100644 --- a/palacios/src/palacios/svm.c +++ b/palacios/src/palacios/svm.c @@ -53,6 +53,10 @@ #include +#ifdef V3_CONFIG_MEM_TRACK +#include +#endif + #ifdef V3_CONFIG_TM_FUNC #include #endif @@ -633,12 +637,17 @@ int v3_svm_enter(struct guest_info * info) { // Conditionally yield the CPU if the timeslice has expired v3_schedule(info); +#ifdef V3_CONFIG_MEM_TRACK + v3_mem_track_entry(info); +#endif + // Update timer devices after being in the VM before doing // IRQ updates, so that any interrupts they raise get seen // immediately. v3_advance_time(info, NULL); v3_update_timers(info); + // disable global interrupts for vm state transition v3_clgi(); @@ -799,6 +808,7 @@ int v3_svm_enter(struct guest_info * info) { // reenable global interrupts after vm exit v3_stgi(); + // Conditionally yield the CPU if the timeslice has expired v3_schedule(info); @@ -808,6 +818,7 @@ int v3_svm_enter(struct guest_info * info) { v3_advance_time(info, NULL); v3_update_timers(info); + { int ret = v3_handle_svm_exit(info, exit_code, exit_info1, exit_info2); @@ -823,6 +834,10 @@ int v3_svm_enter(struct guest_info * info) { v3_handle_timeouts(info, guest_cycles); } +#ifdef V3_CONFIG_MEM_TRACK + v3_mem_track_exit(info); +#endif + return 0; } @@ -834,6 +849,25 @@ int v3_start_svm_guest(struct guest_info * info) { PrintDebug(info->vm_info, info, "Starting SVM core %u (on logical core %u)\n", info->vcpu_id, info->pcpu_id); + +#ifdef V3_CONFIG_MULTIBOOT + if (v3_setup_multiboot_core_for_boot(info)) { + PrintError(info->vm_info, info, "Failed to setup Multiboot core...\n"); + return -1; + } +#endif + +#ifdef V3_CONFIG_HVM + if (v3_setup_hvm_hrt_core_for_boot(info)) { + PrintError(info->vm_info, info, "Failed to setup HRT core...\n"); + return -1; + } +#endif + + + + + while (1) { if (info->core_run_state == CORE_STOPPED) { @@ -883,7 +917,6 @@ int v3_start_svm_guest(struct guest_info * info) { info->core_run_state = CORE_STOPPED; break; } - #ifdef V3_CONFIG_PMU_TELEMETRY v3_pmu_telemetry_start(info);