* Bugs on MacBook, and proposed code change
@ 2006-12-11 4:47 Huihong Luo
[not found] ` <20061211044746.1006.qmail-jCIPyZ9Nm/SvuULXzWHTWIglqE1Y4D90QQ4Iyu8u01E@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Huihong Luo @ 2006-12-11 4:47 UTC (permalink / raw)
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
I tried to compile kvm on an Intel Mac (MacBook laptop
runing Linux 2.6.17). It does not work, qemu simply
hangs.
I spent sometime to fix the issues, can you correct
the issues? There are to do with the kernel module.
After the following 2 corrections, I can launch
windows XP SP2 on a MacBook.
(1) hvm_main.c
There seems to be extra put_cpu()
static void vcpu_put(struct kvm_vcpu *vcpu)
{
kvm_arch_ops->vcpu_put(vcpu);
/* put_cpu(); extra one Huihong */
mutex_unlock(&vcpu->mutex);
}
(2) in vmx.c:
static __init void hardware_enable(void *garbage)
{
int cpu = raw_smp_processor_id();
u64 phys_addr = __pa(per_cpu(vmxarea, cpu));
u32 eax, edx;
rdmsr(MSR_IA32_FEATURE_CONTROL, eax, edx);
if (eax & 1) {
if ((eax & 4) == 0) {
printk("VMX disabled by Feature Control MSR.\n");
return;
}
}
else {
/* enable and lock */
wrmsr(MSR_IA32_FEATURE_CONTROL, 5, 0);
}
#if 0 /* Huihong, original */
if ((old & 5) == 0)
/* enable and lock */
wrmsrl(MSR_IA32_FEATURE_CONTROL, old | 5);
#endif
Huihong
____________________________________________________________________________________
Need a quick answer? Get one in minutes from people who know.
Ask your question on www.Answers.yahoo.com
-------------------------------------------------------------------------
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
^ permalink raw reply [flat|nested] 2+ messages in thread[parent not found: <20061211044746.1006.qmail-jCIPyZ9Nm/SvuULXzWHTWIglqE1Y4D90QQ4Iyu8u01E@public.gmane.org>]
* Re: Bugs on MacBook, and proposed code change [not found] ` <20061211044746.1006.qmail-jCIPyZ9Nm/SvuULXzWHTWIglqE1Y4D90QQ4Iyu8u01E@public.gmane.org> @ 2006-12-11 9:35 ` Avi Kivity 0 siblings, 0 replies; 2+ messages in thread From: Avi Kivity @ 2006-12-11 9:35 UTC (permalink / raw) To: Huihong Luo; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f Huihong Luo wrote: > I tried to compile kvm on an Intel Mac (MacBook laptop > runing Linux 2.6.17). It does not work, qemu simply > hangs. > > I spent sometime to fix the issues, can you correct > the issues? There are to do with the kernel module. > After the following 2 corrections, I can launch > windows XP SP2 on a MacBook. > > (1) hvm_main.c > > There seems to be extra put_cpu() > static void vcpu_put(struct kvm_vcpu *vcpu) > { > kvm_arch_ops->vcpu_put(vcpu); > /* put_cpu(); extra one Huihong */ > mutex_unlock(&vcpu->mutex); > } > Yup, a bug. Will fix. > (2) in vmx.c: > > static __init void hardware_enable(void *garbage) > { > int cpu = raw_smp_processor_id(); > u64 phys_addr = __pa(per_cpu(vmxarea, cpu)); > u32 eax, edx; > > rdmsr(MSR_IA32_FEATURE_CONTROL, eax, edx); > > if (eax & 1) { > if ((eax & 4) == 0) { > printk("VMX disabled by Feature Control MSR.\n"); > return; > } > } > else { > /* enable and lock */ > wrmsr(MSR_IA32_FEATURE_CONTROL, 5, 0); > } > I don't understand this one. There are 4 possible values of [FEATURE_CONTROL.2, FEATURE_CONTROL.]: 00: disabled, unlocked: handled correctly by the original code 01: disabled, locked: cannot be handled, but should be caught by vmx_disabled_by_bios(). 10: enabled, unlocked: handled correctly by the original code 11: enabled, locked: handled correctly by the original code No? > #if 0 /* Huihong, original */ > if ((old & 5) == 0) > /* enable and lock */ > wrmsrl(MSR_IA32_FEATURE_CONTROL, old | 5); > #endif > > Huihong > > > -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- 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 ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-12-11 9:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-11 4:47 Bugs on MacBook, and proposed code change Huihong Luo
[not found] ` <20061211044746.1006.qmail-jCIPyZ9Nm/SvuULXzWHTWIglqE1Y4D90QQ4Iyu8u01E@public.gmane.org>
2006-12-11 9:35 ` Avi Kivity
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox