From: Jack Lange Date: Wed, 22 Oct 2008 02:06:25 +0000 (-0500) Subject: added GS.BASE save/restore X-Git-Tag: 1.0^2~23 X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=a6abc36ea941eb0f63783eb077d4073c8773719d added GS.BASE save/restore --- diff --git a/palacios/src/palacios/svm.c b/palacios/src/palacios/svm.c index 00a9ebd..4913513 100644 --- a/palacios/src/palacios/svm.c +++ b/palacios/src/palacios/svm.c @@ -301,11 +301,25 @@ static int start_svm_guest(struct guest_info *info) { while (1) { ullong_t tmp_tsc; + uint_t vm_cr_low = 0, vm_cr_high = 0; v3_enable_ints(); v3_clgi(); + { + + v3_get_msr(0xc0000101, &vm_cr_high, &vm_cr_low); + + PrintDebug("GS.Base: %x:%x\n", vm_cr_high, vm_cr_low); + /* + v3_get_msr(0xc0000102, &vm_cr_high, &vm_cr_low); + + PrintDebug("KernelGSBase: %x:%x\n", vm_cr_high, vm_cr_low); + */ + + } + PrintDebug("SVM Entry to rip=%x...\n", info->rip); rdtscll(info->time_state.cached_host_tsc); @@ -315,6 +329,21 @@ static int start_svm_guest(struct guest_info *info) { rdtscll(tmp_tsc); PrintDebug("SVM Returned\n"); + + + { + + v3_set_msr(0xc0000101, vm_cr_high, vm_cr_low); + + PrintDebug("GS.Base: %x:%x\n", vm_cr_high, vm_cr_low); + + /* + v3_get_msr(0xc0000102, &vm_cr_high, &vm_cr_low); + + PrintDebug("KernelGSBase: %x:%x\n", vm_cr_high, vm_cr_low); + */ + + } { uint_t x = 0; diff --git a/palacios/src/palacios/svm_lowlevel.S b/palacios/src/palacios/svm_lowlevel.S index e01f069..1e36bc9 100644 --- a/palacios/src/palacios/svm_lowlevel.S +++ b/palacios/src/palacios/svm_lowlevel.S @@ -139,6 +139,9 @@ v3_svm_launch: push %gs; PUSHA + + + pushq %rsi @@ -146,18 +149,21 @@ v3_svm_launch: Restore_SVM_Registers(%rsi); - + vmload; vmrun; vmsave; - Save_SVM_Registers(8(%rsp)); addq $8, %rsp + + + + POPA pop %gs; pop %fs;