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

Re: [Xen-devel] [for-4.7 2/2] xen/arm: p2m: Release the p2m lock before undoing the mappings

Hi Stefano,

On 18/05/2016 11:10, Stefano Stabellini wrote:
All right, so the use case that should haved worked before (but didn't
because the implementation was broken) and wouldn't work anymore with
this patch is the following:

- vcpu1 asks region1 to be mapped at gpaddrA
  the mapping fails at least partially
- vcpu2 asks region2 to be mapped at gpaddrA
  the mapping succeeds

This doesn't work anymore because the second mapping could be done in
between the two halves of the first mapping, resulting in a partially
mapped region2.

If we leave aside the buggy code, this use case has never worked and will never work. Xen might handle the request from vcpu2 before vcpu1.

It is not because of the implementation, but because the pCPU running vCPU1 may be slower or receive an interrupt...

So the use case you described is already unpredictable. The guest has to use an internal lock if it wants the request from vCPU2 to be handled after the one from vCPU1. And in this case, it is not possible to have vCPU2 messing in the middle of the vCPU1 transaction.


Julien Grall

Xen-devel mailing list



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