aboutsummaryrefslogtreecommitdiffstats
path: root/target-i386/kvm-gs-restore.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix signal handling for GS_RESTORE hackJiang Yunhong2012-01-121-34/+77
| | | | | | | | | | | | | | | | | | | | | | Currently we hack QEMU's signal handler because of the GS_BASE MSR KVM bug. The reason of the hack is, when signal happens during KVM_RUN ioctl, the GS_BASE is broken, we have to restore the correct gs before run the signal handler. However, currently we take signal even when signal is set as SIG_DFL/SIG_IGN, or the signal is set with SIG_SIGINFO. Currently "kill -13" to emulator causes emulator crash. This patch fixed it as: 1) If the signal handler is set as SIG_DFL or SIG_IGN, we don't take the signal 2) If the signal handler is set with SIG_SIGINFO, we will use sa_sigaction 3) Cover all potential signals One thing left is, if the signal handler is setup dynamically, this method may still have issue because currently the signal handlers are taken statically when first KVM_RUN ioctl. Luckily this does not happen now. Change-Id: Icfbe43db665a11f2b6eaf9593075b3e643783ee7 Signed-off-by: Jiang Yunhong <yunhong.jiang@intel.com>
* x86: Workaorund for the KVM GS_BASE MSR save/restore issue.Jun Nakajima2011-05-271-0/+144
In some versions of the kvm module in Ubuntu, the host's GS_BASE MSR is not save/restored correctly when running guests on 64-bit hosts if the qemu/emulator is 32-bit. This patch implements a workaround in the emulator code. Change-Id: If3ebe3cb49f377c5d0547c75f6ac3a3ceacdc375 Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com> Signed-off-by: Jun Nakajima <jun.nakajima@intel.com>