|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v12 05/11] x86/mm: add HYPERVISOR_memory_op to acquire guest resources
Hi, On 19/10/17 14:35, Paul Durrant wrote: -----Original Message----- From: Julien Grall [mailto:julien.grall@xxxxxxxxxx] Sent: 19 October 2017 14:29 To: Paul Durrant <Paul.Durrant@xxxxxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>; Wei Liu <wei.liu2@xxxxxxxxxx>; Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>; George Dunlap <George.Dunlap@xxxxxxxxxx>; Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>; Ian Jackson <Ian.Jackson@xxxxxxxxxx>; Tim (Xen.org) <tim@xxxxxxx>; Julien Grall <julien.grall@xxxxxxx>; Jan Beulich <jbeulich@xxxxxxxx>; Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>; Roger Pau Monne <roger.pau@xxxxxxxxxx> Subject: Re: [Xen-devel] [PATCH v12 05/11] x86/mm: add HYPERVISOR_memory_op to acquire guest resources Hi, On 10/19/2017 01:57 PM, Paul Durrant wrote:-----Original Message----- From: Julien Grall [mailto:julien.grall@xxxxxxxxxx] Sent: 19 October 2017 13:23 To: Paul Durrant <Paul.Durrant@xxxxxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxxCc: Stefano Stabellini <sstabellini@xxxxxxxxxx>; Wei Liu <wei.liu2@xxxxxxxxxx>; Konrad Rzeszutek Wilk<konrad.wilk@xxxxxxxxxx>;George Dunlap <George.Dunlap@xxxxxxxxxx>; Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>; Ian Jackson <Ian.Jackson@xxxxxxxxxx>;Tim(Xen.org) <tim@xxxxxxx>; Julien Grall <julien.grall@xxxxxxx>; JanBeulich<jbeulich@xxxxxxxx>; Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>; Roger Pau Monne <roger.pau@xxxxxxxxxx> Subject: Re: [Xen-devel] [PATCH v12 05/11] x86/mm: add HYPERVISOR_memory_op to acquire guest resources Hi, On 17/10/17 14:24, Paul Durrant wrote:Certain memory resources associated with a guest are not necessarily present in the guest P2M. This patch adds the boilerplate for new memory op to allow such aresource For x86 maybe. For Arm, foreign mapping are also exposed to guest and we get a reference every time. It is probably an oversight on the x86 side. So there is no way to get/put a reference on that page. So I am unconvinced that this is very safe. Also looking at the x86 side, I can't find such reference in the foreign path in p2m_add_foreign. Did I miss anything?No, I don't think there is any reference counting there... but this is nodifferent to priv mapping. I'm not trying to fix the mapping infrastructure at this point.Note that x86 does not handle p2m teardown with foreign map at the moment (see p2m_add_foreign). You are by-passing this check and I can't see how this would be safe for the x86 side too.I don't follow. What check am I by-passing that is covered when priv Well a foreign domain can be nasty with you. Like removing the mapping from itself resulting to free the memory... So you may end up writing/read wrong mapping or even worth in another domain. But that's may not impact this new hypercall. [...]+ * will be populated with the MFNs of the resource. + * If the tools domain is HVM then it is expected that, on + * entry, frame_list will be populated with a list of GFNs + * that will be mapped to the MFNs of the resource. + * If -EIO is returned then the frame_list has only been + * partially mapped and it is up to the caller to unmap all + * the GFNs. + * This parameter may be NULL if nr_frames is 0. + */ + XEN_GUEST_HANDLE(xen_ulong_t) frame_list; +}; +typedef struct xen_mem_acquire_resourcexen_mem_acquire_resource_t; I am quite surprised of "it is tools-only" so it is fine to not protect it even if it is x86 only. That's probably going to bite us in the future. Cheers, -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |