Hi Jan, all The pages mapped via paging_get_guest_pages() are mapped on TEMPORARY_MAPPING_BASE, and the mapping is over-written when another call to the function is made. This produces a race condition when two cells have two drivers calling this function. If one driver is not done using the mapping, and another over-writes it, bad things could happen. Of course, if it is the same driver in both cells, you could use a global locking construct for it, but neither is this a very clean fix, nor does it solve the case when two different drivers are in play.
One alternative is to lock TEMPORARY_MAPPING_BASE until a release function is called to release that mapping (using, say, paging_release_guest_pages()). If the base is locked, the call to paging_get_guest() can block. This is problematic when the locking is too long. Another option is to return NULL when the base is locked, and then it is the driver's job to re-try. The second alternative is to do away with TEMPORARY_MAPPING_BASE entirely, and use the remap pool instead. I personally like the second alternative better. Either way, all code using paging_get_guest_pages() needs to be updated. Luckily, it is only used in a handful of places so it should not be too difficult to update. Thoughts on this problem? Any better ideas than mine? -- Regards, Pratyush Yadav -- You received this message because you are subscribed to the Google Groups "Jailhouse" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jailhouse-dev/dfdf9509-c3e4-e700-e3f7-56cb1e189048%40ti.com. For more options, visit https://groups.google.com/d/optout.
