|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2] dm_op: Add xendevicemodel_modified_memory_bulk.
On 23/03/17 08:35, Jan Beulich wrote: On 22.03.17 at 20:55, <Jennifer.Herbert@xxxxxxxxxx> wrote: --- a/xen/arch/x86/hvm/dm.c +++ b/xen/arch/x86/hvm/dm.c @@ -119,56 +119,89 @@ static int set_isa_irq_level(struct domain *d, uint8_t isa_irq, }static int modified_memory(struct domain *d, Ok, I can set cont_check_interval = 0x100; and leave the comment as 256.
Having an indication of which extent failed seem a sensible idea. We'd need that parameter to be initially set to something that can represent none of the extents, such that if there is an error before we get to precessing the extents, this is clear. If we used nr_extents - the caller can check its the same value they passed in. If the value is the same, then the error occurred before processing an extent. If we used error_on_extent (previously known as pfns_processed), we could not use zero, as it might be the first extent to fail. In this case, we'd need to specify it was defaulted to 0xFFFFFFFF. Should probably define a constant - NO_EXTENT. Internally, we could just invert the value for using as a pfn_processed intermediately. However, both of these ideas suffer a problem, that if a continuation fails before processing the remaining extents, the returned value would be incorrect. For reusing nr_extents, it would appear to be the previous extent - potentially very confusing. Using error_on_extent would give you a totally different value, although very likely, one that is greater then the number of extents passed in.Both of these schemes can be solved by only allowing 31 bit number of extents and pfns, and having the fields signed, to make it more obvious.For both schemes, you could return -extent_nr, where only a negative value indicates and extent number. This would allow you to have the initial value of 0 for error_on_extent. Alternatively, for the error_on_extent scheme, the pfns_processed could be stored as a negative, which would mean that if a negative value got returned it was was no specific extent. The value would need initialised by the caller as -1.An alternative to using signed values would be to use a combination of the two values. If nr_extents == 0, then error_on_extent hold the extent number. It allows full 32 bit values but is kinda odd. I'm happy to do any of the 4 schemes - they all have pros and cons. What do you think? Cheers, -jenny _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |