X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_barrier.c;h=a94e40f157eb5d82c2b370886ce2022eb2d73d85;hb=3586c3bd6260bf79c57baebf66a26d7e8158d411;hp=35efe0fb108536dce8f05d1e5f0796de4988b621;hpb=700ce14388ea852b7599b73b0d5a9f94fd873045;p=palacios.git diff --git a/palacios/src/palacios/vmm_barrier.c b/palacios/src/palacios/vmm_barrier.c index 35efe0f..a94e40f 100644 --- a/palacios/src/palacios/vmm_barrier.c +++ b/palacios/src/palacios/vmm_barrier.c @@ -120,6 +120,7 @@ int v3_wait_for_barrier(struct v3_vm_info * vm_info, struct guest_info * local_c break; } + // return immediately and spin if there is no one to yield to v3_yield(local_core,-1); } @@ -197,6 +198,13 @@ int v3_wait_at_barrier(struct guest_info * core) { if (barrier->active == 0) { return 0; } +#ifndef V3_CONFIG_FP_SWITCH + v3_get_fp_state(core); // snapshot FP state now +#else +# ifdef V3_CONFIG_LAZY_FP_SWITCH + v3_get_fp_state(core); // snapshot FP state now regardless of lazy eval +# endif +#endif V3_Print(core->vm_info, core, "Core %d waiting at barrier\n", core->vcpu_id); @@ -211,8 +219,17 @@ int v3_wait_at_barrier(struct guest_info * core) { // wait for cpu bit to clear while (v3_bitmap_check(&(barrier->cpu_map), core->vcpu_id)) { + // Barrier wait will spin if there is no competing work v3_yield(core,-1); } +#ifndef V3_CONFIG_FP_SWITCH + core->fp_state.need_restore=1; // restore FP on next entry +#else +# ifdef V3_CONFIG_LAZY_FP_SWITCH + core->fp_state.need_restore=1; // restore FP on next entry +# endif +#endif + return 0; }