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

Re: [Xen-devel] [PATCH RFC] x86/emulate: implement hvmemul_cmpxchg() with an actual CMPXCHG



>>> On 03.04.17 at 20:36, <rcojocaru@xxxxxxxxxxxxxxx> wrote:
> Another log, making sure that the MMIO emulation fail really happens on
> the same processor as the preceding (identical bytes) fail:
> 
> (XEN) [8] gfn: 0x276f
> (XEN) [11] virtual address: 0x8276f09c, rc: 0
> (XEN) [8] virtual address: 0x8276f09c, rc: 4
> (XEN) Dump follows for VCPU 8
> (XEN) Mem event (RETRY) emulation failed: d3v8 32bit @ 0008:826a3861 ->
> f0 0f ba 30 00 72 07 8b cb e8 da 4b ff ff 8b 45

So what does your code do following this? Namely is there any exit
back to guest context prior to the retried operation succeeding (e.g.
are you allowing the instruction to be re-executed)? If there is, I'd
suspect you don't clean up some internal state and ...

> (XEN) [11] gfn: 0x276f
> (XEN) [11] virtual address: 0x8276f0d0, rc: 0
> (XEN) [11] gfn: 0x276f
> (XEN) [11] virtual address: 0x8276f09c, rc: 0
> (XEN) [11] gfn: 0x276f
> (XEN) [11] virtual address: 0x8276f0cc, rc: 0
> (XEN) [11] gfn: 0x276f
> (XEN) [11] virtual address: 0x8276f09c, rc: 0
> (XEN) [8] gfn: 0xfed00
> (XEN) !page
> (XEN) hvmemul_vaddr_to_mfn() fail
> (XEN) [8] virtual address: 0xffd080f0, rc: 1
> (XEN) Dump follows for VCPU 8
> (XEN) MMIO emulation failed: d3v8 32bit @ 0008:8263df3c -> f0 0f ba 30
> 00 72 07 8b cb e8 da 4b ff ff 8b 45

... this then happens in the context of an interrupt taken on
the instruction to be re-executed (i.e. before it actually gets
re-executed). "Normal" retry processing is not supposed to
reach guest context again, i.e. the retry is being performed
from (iirc) hvm_do_resume(). Hence it can re-use previously
collected information on the instruction and its operand(s).
Any exit to guest context, otoh, would require invalidation of
such internally cached state.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.