qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Qemu-devel] [Patch] Support translating Guest physical address to H


From: Zheng, Jiajia
Subject: RE: [Qemu-devel] [Patch] Support translating Guest physical address to Host virtual address.
Date: Mon, 8 Feb 2010 11:38:25 +0800

Anthony Liguori wrote:
> On 02/07/2010 10:31 AM, Avi Kivity wrote:
>>> Only insofar as you don't have to deal with getting at the VM fd.
>>> You can avoid the problem by having the kvm ioctl interface take a
>>> pid or something.
>> 
>> 
>> That's a racy interface.
> 
> The mechanism itself is racy.  That said, pid's don't recycle very
> quickly so the chances of running into a practical issue is quite
> small. 
> 
>> Well, we need to provide a reasonable alternative.
> 
> I think this is the sort of thing that really needs to be a utility
> that lives outside of qemu.  I'm absolutely in favor of exposing
> enough internals to let people do interesting things provided it's
> reasonably correct.
> 
>> One might be to use -mempath (which is hacky by itself, but so far we
>> have no alternative) and use an external tool on the memory object to
>> poison it.  An advantage is that you can use it independently of kvm.
> 
> It would help if the actual requirements were spelled out a bit more.
> What exactly needs validating?  Do we need to validate that a
> poisoning a host physical address results in a very particular guest
> page getting poisoned?
> 
> Is it not enough to just choose a random anonymous memory area within
> the qemu process, generate an MCE to that location, see whether qemu
> SIGBUS's.  If it doesn't, validate that an MCE has been received in
> the guest?

Hi Anthony, 
I think we have to poinson a very particular guest page rather than a random 
one.
We tried random poisoning before, which has potential issues. 
For random poisoning, it is possible that the poisoned page cannot be isolated 
in guest kernel in early kill time, hence some time later kvm tries to 
read/write the poisoned page, which triggered the late AR kill by which 
qume-kvm exits. 
For the above reason, a safe page should be selected inside kvm. So we do the 
following things in KVM RAS testing.
- Start a process in the guest OS, get the virtual address from guest
- Translate guest virtual address to guest physical address
- Translate guest physical address to host virtual address
- Translate host virtual address to host physical address
- Software inject an AO MCE at that physical address

bests, 
jiajia

> 
> But FWIW, I think a set of per-VM directories in sysfs could be very
> useful for this sort of debugging.
> 
> Maybe we should consider having the equivalent of a QMP-for-debugging
> session.  This would be a special QMP session that we basically
> provided no compatibility or even sanity guarantees that was
> specifically there for debugging.  I would expect that it be disabled
> in any production build (even perhaps even by default in the general
> build). 
> 
> Regards,
> 
> Anthony Liguori





reply via email to

[Prev in Thread] Current Thread [Next in Thread]