public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Leonard Norrgard <leonard.norrgard-g2GXA8XeJSExHbG02/KK1g@public.gmane.org>
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: [PATCH] svm_set_idt() - don't store/get idt to/from LDT save
Date: Fri, 19 Jan 2007 16:49:17 +0200	[thread overview]
Message-ID: <45B0DA6D.9050406@refactor.fi> (raw)

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

             reply	other threads:[~2007-01-19 14:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-19 14:49 Leonard Norrgard [this message]
2007-01-23 11:27 ` [PATCH] svm_set_idt() - don't store/get idt to/from LDTsave Uri Lublin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45B0DA6D.9050406@refactor.fi \
    --to=leonard.norrgard-g2gxa8xejsexhbg02/kk1g@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox