From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leonard Norrgard Subject: [PATCH] svm_set_idt() - don't store/get idt to/from LDT save Date: Fri, 19 Jan 2007 16:49:17 +0200 Message-ID: <45B0DA6D.9050406@refactor.fi> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org On AMD processors, executing "shutdown -r now" in a Linux guest actually reboots the host. While investigating that, I noticed this likely typo. This patch isn't in itself the complete fix the host reboot, so be prepared if you test the shutdown command in a Linux guest. Note: "shutdown -h now" works perfectly and closes the kvm window as expected. PS. When I first installed this patch, "shutdown -r now" _didn't_ reboot the _host_ for about 10 times, instead the guest OOPSed in slightly different situations. Currently I don't see guest OOPSes, but host reboots. --- kvm/trunk/kernel/svm.c 2007-01-14 17:29:39.000000000 +0200 +++ kvm-reset/trunk/kernel/svm.c 2007-01-19 15:42:18.000000000 +0200 @@ -680,14 +680,14 @@ static void svm_get_idt(struct kvm_vcpu *vcpu, struct descriptor_table *dt) { - dt->limit = vcpu->svm->vmcb->save.ldtr.limit; - dt->base = vcpu->svm->vmcb->save.ldtr.base; + dt->limit = vcpu->svm->vmcb->save.idtr.limit; + dt->base = vcpu->svm->vmcb->save.idtr.base; } static void svm_set_idt(struct kvm_vcpu *vcpu, struct descriptor_table *dt) { - vcpu->svm->vmcb->save.ldtr.limit = dt->limit; - vcpu->svm->vmcb->save.ldtr.base = dt->base ; + vcpu->svm->vmcb->save.idtr.limit = dt->limit; + vcpu->svm->vmcb->save.idtr.base = dt->base ; } static void svm_get_gdt(struct kvm_vcpu *vcpu, struct descriptor_table *dt) ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV