From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: [RFT] Fix for unhandled msr c0000081 problems under Intel cpus Date: Wed, 13 Dec 2006 11:45:29 +0200 Message-ID: <457FCBB9.5070800@qumranet.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030408020701050108080508" 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 This is a multi-part message in MIME format. --------------030408020701050108080508 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 --------------030408020701050108080508 Content-Type: text/x-patch; name="msr_star-intel-fix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="msr_star-intel-fix.patch" 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; } --------------030408020701050108080508 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- 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 --------------030408020701050108080508 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kvm-devel mailing list kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/kvm-devel --------------030408020701050108080508--