public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [RFT] Fix for unhandled msr c0000081 problems under Intel cpus
@ 2006-12-13  9:45 Avi Kivity
       [not found] ` <457FCBB9.5070800-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 17+ messages in thread
From: Avi Kivity @ 2006-12-13  9:45 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

[-- 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

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2006-12-28 15:05 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-13  9:45 [RFT] Fix for unhandled msr c0000081 problems under Intel cpus Avi Kivity
     [not found] ` <457FCBB9.5070800-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2006-12-13 17:04   ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox