Re: [BUG + PATCH/Bugfix] x86/lguest: fix pgdir pmd index calculation

From: Rusty Russell
Date: Tue Mar 04 2008 - 07:07:55 EST


On Saturday 01 March 2008 06:58:38 Ingo Molnar wrote:
> * Ahmed S. Darwish <darwish.07@xxxxxxxxx> wrote:
> > On the lguest _guest_ side, 'cpu_has_tsc' is _always_ false (due to
> > lguest using his own clocksource ?), thus a guest with a pentium+ cpu
> > always panics with:
>
> does the "RDTSC" instruction work in an lguest guest? If not, then the
> lguest kernel is correct in not exposing it - and then the solution is
> to build a non-TSC guest kernel. Does the patch below help?
>
> but if the RDTSC instruction does work in an lguest guest, then the
> proper approach would be to expose it in the CPU features.

Yes, and after some investigation, I came up with two patches. I'll queue
both to you if that's ok, since they're dependent.

When lguest was being developed we didn't have a get_tsc_khz hook, so I had to
kill the TSC cpuid bit. Nowdays, the code can actually be much more natural:
the Host tells us the cpu khz, and if it's zero, we fall back to the
dumb "lguest" clock.

Thanks,
Rusty.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/