|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v5 5/8] xen/arm: Add additional reference to owner domain when the owner is allocated
Hi Penny, On 20/06/2022 06:11, Penny Zheng wrote: NIT: I think this comment wants to be just above the 'if' and expanded to explain why the "dom_io" is not included. AFAIU, this is because "dom_io" is not described in the Device-Tree, so it would not be taken into account for nr_shm_domain.Borrower domain will fail to get a page ref using the owner domain during allocation, when the owner is created after borrower. So here, we decide to get and add the right amount of reference, which is the number of borrowers, when the owner is allocated. Signed-off-by: Penny Zheng <penny.zheng@xxxxxxx> Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx> --- v5 change: - no change --- v4 changes: - no change --- v3 change: - printk rather than dprintk since it is a serious error --- v2 change: - new commit --- xen/arch/arm/domain_build.c | 62 +++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index d4fd64e2bd..650d18f5ef 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -799,6 +799,34 @@ static mfn_t __init acquire_shared_memory_bank(struct domain *d,} +static int __init acquire_nr_borrower_domain(struct domain *d, + *nr_borrowers = bootinfo.reserved_mem.bank[bank].nr_shm_domain - 1; TBH, given the use here. I would have consider to not increment nr_shm_domain if the role was owner in parsing code. This is v5 now, so I would be OK with the comment above. But I would suggest to consider it as a follow-up.
Typo: s/let/letting/ + * additional reference as the number of borrowers when the owner + * is allocated, since there is a chance that owner is created + * after borrower. What if the borrower is created first? Wouldn't this result to add pages in the P2M without reference? If yes, then I think this is worth an explaination. + */ + page = mfn_to_page(smfn); Where do you validate the range [smfn, nr_pages]? Cheers, -- Julien Grall
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |