[DragonFlyBSD - Bug #2561] Fwd: Re: DragonFly x86_64 won't boot on qemu-kvm
Venkatesh Srinivas via Redmine
bugtracker-admin at leaf.dragonflybsd.org
Sat May 18 09:55:43 PDT 2013
Issue #2561 has been updated by vsrinivas.
I think we tracked this down this morning, a fix is being tested.
I think the problem boils down to:
pcb2->pcb_cr3 |= PG_RW | PG_U | PG_V;
On x86 and x86-64, the CR3 register points to the root of the page tables for an address space. The bottom three bits of the address in CR3 are supposed to be zero, (AMD64 documentation states 'should be zero'), but DFly has been setting them with the corresponding flags from page table entries. This has worked out okay on real hardware, as the AMD docs only say 'should be zero' (Intel says 'ignored').
When (qemu-)KVM is used on hardware without two-dimensional paging, it has to handle writes to CR3 itself. The code to do so is in Linux's arch/x86/kvm/emulate.c, check_cr_write(). If any of the reserved bits in CR3 are set on a store, we see a #GP. This is perhaps arguably a bug.
To fix this, just remove that line in vm_machdep.c and try it.
Bug #2561: Fwd: Re: DragonFly x86_64 won't boot on qemu-kvm
Forwarding to bugs@ - relavent threads contain
-------- Original Message --------
Subject: Re: DragonFly x86_64 won't boot on qemu-kvm
Date: Wed, 15 May 2013 21:48:22 -0500
From: Chris Turner <c.turner at 199technologies.com>
To: users at dragonflybsd.org
On 05/15/13 11:41, Michael Neumann wrote:
> I am having exactly the same problems as described in:
Indeed I am also having this problem as well
(RHEL6-stock host/kernel/etc/virt-manager on a core2-duo)
Have not yet reported since I know I haven't had time to get a debug
env properly setup.
I've tested x86-64 from ~1-2wks back, and also had tested around
september last year - have been using 32bit as a workaround since
it suits my purposes in this situation.
> It seem like FreeBSD has a similar problem:
I'm not clear from your email - did any of the workarounds work?
setting cpu flags, the kvm modprobe option, etc?
I was able to boot up when using 'pure emulation' QEMU,
(as outlined in original thread IIRC) but this is hardly ideal :D
> For now, the only solution seems to be to use i386 on that particual host (or wait that this is fixed in kvm).
> I am wondering why it fails on DF but not for example on Linux. Are they doing things differently?
It does appear that the panic happens consistently for me after 'low level' init
and right before mounting the root filesystem - IIRC this is when the actual
buffer cache/VM etc is setup, and so presumably lots would be going on w/r/t
memory pages/interrupts/etc in a fairly OS-dependent manner.
My thought was to add some spurious printfs here and maybe throw in some ASM
noops in the right places to see if that allows any narrowing down of the
problem, but again, I haven't had a chance to get a proper dev env setup
in this environment.
Unfortunately my time will likely be short until at least mid summer.
GRR! need more unix time!
... and while I'm at it - this + Bug#2133, etc.
seem like excellent examples of the 'why keeping >=2 platforms going is a good idea'
will forward to bugs@ to get a thread going there.
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account
More information about the Bugs