|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v6 3/4] x86/ioreq server: Handle read-modify-write cases for p2m_ioreq_server pages.
On 9/9/2016 1:26 PM, Yu Zhang wrote: Thanks, I think we do not need this variable with hvm_copy_from_guest_phys(). > + ASSERT(offset + size < PAGE_SIZE); Surely <= ? Yes. Thanks. > + if ( !page ) > + return X86EMUL_UNHANDLEABLE; > + > + p = __map_domain_page(page); > + p += offset; > + memcpy(data, p, size); > + > + unmap_domain_page(p); > + put_page(page); But anyway - I think rather than all this open coding you would better call hvm_copy_from_guest_phys(). Agree. How about ioreq_server_read/ops? It is only for this special p2m type.
OK. I prefer to add the unlikely(). And the comment ahead of the if() now also needs adjustment (perhaps you want to merge the one you add into that one).
OK. And IIUC, you mean merge to the original comments above the "if (!s)"?
Like this:
/*
* For p2m_ioreq_server pages accessed with read-modify-write
* instructions, we provide a read handler to copy the data to
* the buffer. For other cases, if there is no suitable backing
* DM, we just ignore accesses.
*/
if ( !s )
Jan Thanks Yu _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |