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

Re: [Xen-devel] [PATCH v4 2/2] x86/emulate: Send vm_event from emulate

>>> On 30.05.19 at 10:59, <aisaila@xxxxxxxxxxxxxxx> wrote:
>>> +        return false;
>>> +
>>> +    rc = hvmemul_linear_to_phys(gla, &gpa, bytes, &reps, pfec, &ctxt);
>> As said before - I don't think it's a good idea to do the page walk
>> twice: This and the pre-existing one can easily return different
>> results.
> What preexisting page walk are you talking about here?

Well, I'm afraid I don't know what to say (in a polite way). I'm sure
you're understanding the code you try to add to, so it would seem
natural to me that you can answer this question all by yourself:
Since you don't remove any linear->phys translations in your patch,
and since there necessarily is one prior to your patch, you adding
(another) one means there are now two of them.

So to answer your question directly: hvmemul_map_linear_addr()
calls hvm_translate_get_page(), and hvmemul_insn_fetch() ->
__hvmemul_read() -> linear_read() -> hvm_copy_from_guest_linear()
-> __hvm_copy() calls hvm_translate_get_page() as well.

As an aside - while I'm advocating the stripping of reply quoting that's
not needed as context, you surely went too far here: You've left in
place neither an indication when the mails were sent context of which
is still present above, nor enough context to re-construct what
function your additions go into. IOW I had to search the earlier parts
of this thread to gather enough context to actually be able to reply.

> I don't think 
> there is a way to get the gpa by passing it from somewhere.

Possibly, but that's also not what I did suggest. Instead what I
think you need to look into is how to restructure things, perhaps
just as to the place where you insert your new code.


Xen-devel mailing list



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