Hi folks. I'm continuing to try to iron out problems with KVM on ARM, and
the problem I'm working on specifically right now is that the mouse device
gets spurious bad command bytes which panics gem5.

What I've found so far is that the guest kernel will frequently time out
while waiting for an ACK to a byte it sent to the mouse, even though the
timeout looks like it should be 200ms, the simulation quantum I'm using is
1ms, and the delay between an event and the corresponding interrupt is
configured to be 1us. I think this eventually throws the PS2 driver out of
whack, and it ends up sending a data byte (or something else?) to the mouse
which the mouse misinterprets as a command, causing the panic.

My current theory for why that's happening is that even when the VM is not
running, the hardware supported virtual timer the CPU may have scheduled to
keep track of its timeout may be "running" in the sense that the kernel
will update it to reflect the descheduled time once the VM is running
again. That could mean that 200ms of real time could pass, looking like
200ms of simulated time to the VCPU even if a smaller amount of actual
execution time was supposed to happen. I'm not sure if that's a correct
interpretation, but this ASPLOS paper *seems* to say something like that is
possible.

http://www.cs.columbia.edu/~cdall/pubs/asplos019-dall.pdf

I've also seen very weird behavior as far as how many instructions KVM
thinks are being executed per tick, so I wouldn't discount there being
something off about how it's keeping track of time. I haven't been able to
attach GDB to the KVM VCPUs for instance, even though it looks like all the
pieces are there for that to work. It seems that KVM is supposed to exit
after a given number of instructions, but it's just not for some reason.


Anyway, my question is for people who are more familiar with ARM KVM than I
am. Does my theory about the timer make sense? There's supposed to be some
sort of offset value or register or something which lets you adjust time in
the VM. Does that exist, and would that be useful here? I don't see
anything in the gem5 code which looks like it's changing that value.

Gabe
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to