From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: [RFT] Fix for unhandled msr c0000081 problems under Intel cpus
Date: Wed, 13 Dec 2006 11:45:29 +0200 [thread overview]
Message-ID: <457FCBB9.5070800@qumranet.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 250 bytes --]
If you've experienced this problem, please test the attached patch (to
qemu, not the kernel module) and report back. The patch basically tells
the guest that the msr doesn't exist.
--
error compiling committee.c: too many arguments to function
[-- Attachment #2: msr_star-intel-fix.patch --]
[-- Type: text/x-patch, Size: 1021 bytes --]
Index: qemu/qemu-kvm.c
===================================================================
--- qemu/qemu-kvm.c (revision 4089)
+++ qemu/qemu-kvm.c (working copy)
@@ -408,6 +408,7 @@
{
CPUState **envs = opaque;
CPUState *saved_env;
+ uint32_t eax = *rax;
saved_env = env;
env = envs[0];
@@ -421,6 +422,27 @@
*rcx = env->regs[R_ECX];
*rbx = env->regs[R_EBX];
*rax = env->regs[R_EAX];
+ // don't report long mode/syscall if no native support
+ if (eax == 0x80000001) {
+ unsigned long h_eax = eax, h_edx;
+
+
+ // horrible hack to workaround gcc 3 register pressure trouble
+ asm (
+#ifdef __x86_64__
+ "push %%rbx; push %%rcx; cpuid; pop %%rcx; pop %%rbx"
+#else
+ "push %%ebx; push %%ecx; cpuid; pop %%ecx; pop %%ebx"
+#endif
+ : "+a"(h_eax), "=d"(h_edx));
+
+ // long mode
+ if ((h_edx & 0x20000000) == 0)
+ *rdx &= ~0x20000000ull;
+ // syscall
+ if ((h_edx & 0x00000800) == 0)
+ *rdx &= ~0x00000800ull;
+ }
env = saved_env;
return 0;
}
[-- Attachment #3: Type: text/plain, Size: 347 bytes --]
-------------------------------------------------------------------------
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
[-- Attachment #4: Type: text/plain, Size: 186 bytes --]
_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel
next reply other threads:[~2006-12-13 9:45 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-13 9:45 Avi Kivity [this message]
[not found] ` <457FCBB9.5070800-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2006-12-13 17:04 ` [RFT] Fix for unhandled msr c0000081 problems under Intel cpus Michael Riepe
2006-12-13 19:26 ` Michael Riepe
[not found] ` <45805400.3060308-0QoEqw4nQxo@public.gmane.org>
2006-12-14 9:22 ` Avi Kivity
[not found] ` <458117E4.4010807-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2006-12-14 10:14 ` Avi Kivity
[not found] ` <45812407.7010803-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2006-12-28 13:14 ` Ingo Molnar
[not found] ` <20061228131445.GA1438-X9Un+BFzKDI@public.gmane.org>
2006-12-28 13:21 ` Avi Kivity
[not found] ` <4593C4CE.4040203-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2006-12-28 13:26 ` Ingo Molnar
[not found] ` <20061228132602.GA3392-X9Un+BFzKDI@public.gmane.org>
2006-12-28 13:48 ` Ingo Molnar
[not found] ` <20061228134845.GA7446-X9Un+BFzKDI@public.gmane.org>
2006-12-28 13:56 ` Avi Kivity
[not found] ` <4593CD12.7010603-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2006-12-28 14:02 ` Ingo Molnar
[not found] ` <20061228140223.GA9418-X9Un+BFzKDI@public.gmane.org>
2006-12-28 14:09 ` Avi Kivity
[not found] ` <4593D011.9020808-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2006-12-28 14:08 ` Ingo Molnar
[not found] ` <20061228140836.GB10033-X9Un+BFzKDI@public.gmane.org>
2006-12-28 14:12 ` Ingo Molnar
[not found] ` <20061228141242.GA11229-X9Un+BFzKDI@public.gmane.org>
2006-12-28 14:21 ` Avi Kivity
[not found] ` <4593D2D5.3020102-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2006-12-28 14:58 ` Ingo Molnar
[not found] ` <20061228145825.GA16057-X9Un+BFzKDI@public.gmane.org>
2006-12-28 15:05 ` Avi Kivity
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=457FCBB9.5070800@qumranet.com \
--to=avi-atkuwr5tajbwk0htik3j/w@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