|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH RFC 07/10] domain: map/unmap GADDR based shared guest areas
Hi Jan, On 28/11/2022 10:01, Jan Beulich wrote: I would expect an OS to allocate the region using the generic physical allocator. This allocator may decide that '0' is a valid address and return it.On 24.11.2022 22:29, Julien Grall wrote:On 19/10/2022 09:43, Jan Beulich wrote: So I think your approach could potentially complicate the OS implementation. I think it would be better to use an all Fs value as this cannot be valid for this hypercall (we require at least 4-byte alignment).
In general, my preference is to always use the typesafe version because it reduces the number of "unsigned long". [...] The first function will set v->is_running to false (see vcpu_context_saved()). So I think the "area" could be touched even afte vcpu_pause() is returned. Therefore, I think we will need _update_runstate_area() (or update_runstate_area()) to be called first. You are right. Sorry I misread the code.
Ah, I missed that. Thanks! Should we add an ASSERT()?I was going from unmap_vcpu_info(), which had the same requirement, while also only recording it by way of a comment. I certainly could add an ASSERT(), but besides this being questionable as to the rules set forth in ./CODING_STYLE I also view assertions of "paused" state as being of limited use - the entity in question may become unpausedon the clock cycle after the check was done. That's correct. However, that race you mention is unlikely to happen *every* time. So there are a very high chance the ASSERT() will hit if miscalled. And that's fine to not provide the full guarantee. You are still probably going to catch 95% (if not more) of the callers that forgot to call it with the spin lock held.(But yes, such are no different from e.g. the fair number of spin_is_locked() checks we have scattered around, which don't really provide guarantees either.) At least for me, those ASSERTs() were super helpful during development in more than a few cases. Cheers, -- Julien Grall
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |