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

RE: [PATCH v3 5/8] xen/arm: Add additional reference to owner domain when the owner is allocated


  • To: Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Penny Zheng <Penny.Zheng@xxxxxxx>
  • Date: Fri, 13 May 2022 02:42:09 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+YhhWiMDlK172WESsK+wdy5yEx61PMBjjPC0aN5sFxI=; b=h9Z3Q3YyEsUd/oy0ltbXTmD+CYgCQuIzUQ55xtLL8gx9pPLZSxf91HXEcVKWc1fk9UudwNjKVD4nsK9BIYJLAimj2Oxs8IykBEFXUF9zzkNCQB0wPqR0EpSOggYgEB4jS4TnhhnRmGBGcSPus1yxackgf8R1AISyuLkD3I1lx8t4gpx5s1tMU/lkFuGutGSrb1yfnHX9sAU7z5B4HQLYx/Ab5JysZc34qbDOyevqpyGHahTnsNBBVYZsrPlzvWpyZfY1RN+J/nbn/Vq56G8fwV7cht4yB8IjheWsRRSI16Dn0iNT2FkQkCiCGb6cWmAxMTfbRRXHiuXrbIuMl7Wajw==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+YhhWiMDlK172WESsK+wdy5yEx61PMBjjPC0aN5sFxI=; b=lMh4BSd5knt5EaUeWDvWJ23GFixQ5JPUJ5/tJkHlCXIgEcmNWOh2q4HYRCAY7CSJ5mKZxR0UiTyXR/3iowDYkT0i4ra3TVI3/UOMBahG7RiFfFLAfDf3An3qoFLlxSDQZQ4OCMjHYamVuuS5zb9sYAZxKCdtoqcC/5nnfY6naiXELrt2wcNMWePE9JG446uK/coQ+r2UGahHTSpjqvNOw/TyQMs8AmmmFyPMI8+rzIHrS/9qxTw6NCrQNcucgU5mvrTrpLxvDdE5+Fzkz79W9sXvu0IFf1fYtlDT4Jylag7zxOj2VAwmqEhriW4JcAcJE8mAWTVKsttyUWrl89Smgg==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=Ex8yfYye9ucAgMOT+T9EsuC0YtV4k7kkrMrBCy0TCvCV+nvUINs7yKIazfOqtBegwrCnvwdiT7LRDzICJeSh+Nx86BQnAukY4CrWOG93bHtXEvb2onDQD3nbFwp59DFqYljS3uy6B9kD1uX0Qf9/Jfys+YlXepr1PvjzTlQymAwqjB6xUtvCLo0h7B+AOWTBbXprQiz5q/qI9w4bVLpDbTk8r3wTlxgnAbYirIbvdzKoMktgLhGoR0KXZ3+7Fe6h7uboocFP26KWS+DtfwdOpbvfwXq+ei0p1m6o+7c0+E7oORSI76D/8eDR0vB/EMmrfyyHq5jYD1AcjPwRra4xfw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nEtryKVLgStzm1C8JkJ5sGn6OwHgneIt7r0raTqLCNZJax0PA+B7/ozPFvHmvfDYVRGXYKy3xdGwo/d/3FPwTtDOQhIEijROcAdICYauOuPCzMc714/1KW4f78vfTB39WVWrVDiNa/RSJkfgU4/o42+gMtDiv7KImXG8d3E9K0yP1Nc6s1ze2rgGidT1Dt4gb06etlpuYVBgEKiMtHl6/Uw7sJvxCzZDkS51cPO+T0x3qSORjBjY90ZcRqKILp61DH5TudAPOeg3zXpdeJmTSElsHZzylBoC5q+Ke6XOQmLia3653pquc8R+yhhxJQj5fqDmcY0BrdFCCiHKOKNVJw==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Wei Chen <Wei.Chen@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Fri, 13 May 2022 02:42:29 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYZeBsChCHxU3E+kiLDNmMZ1+Ip60bEXqAgAD3CMA=
  • Thread-topic: [PATCH v3 5/8] xen/arm: Add additional reference to owner domain when the owner is allocated

Hi Julien

> -----Original Message-----
> From: Julien Grall <julien@xxxxxxx>
> Sent: Thursday, May 12, 2022 6:54 PM
> To: Penny Zheng <Penny.Zheng@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx
> Cc: Wei Chen <Wei.Chen@xxxxxxx>; Stefano Stabellini
> <sstabellini@xxxxxxxxxx>; Bertrand Marquis <Bertrand.Marquis@xxxxxxx>;
> Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
> Subject: Re: [PATCH v3 5/8] xen/arm: Add additional reference to owner
> domain when the owner is allocated
> 
> 
> 
> On 12/05/2022 10:11, Penny Zheng wrote:
> > @@ -827,6 +858,37 @@ static int __init allocate_shared_memory(struct
> domain *d,
> >           }
> >       }
> >
> > +    /*
> > +     * Get the right amount of references per page, which is the number of
> > +     * borrow domains.
> > +     */
> > +    ret = acquire_nr_borrower_domain(d, pbase, psize, &nr_borrowers);
> > +    if ( ret )
> > +        return ret;
> > +
> > +    /*
> > +     * Instead of let borrower domain get a page ref, we add as many
> > +     * additional reference as the number of borrowers when the owner
> > +     * is allocated, since there is a chance that owner is created
> > +     * after borrower.
> > +     */
> > +    page = mfn_to_page(smfn);
> Where do you check that the range [smfn, smfn + nr_pages] is actual RAM?
> If there are none, then you should use mfn_valid() for each mfn to ensure
> there will be a struct page for it.
>

Actually, before this, in acquire_shared_memory_bank, we will finally call into
acquire_staticmem_pages to acquire [smfn, smfn + nr_pages], and in there, we
will do the check. See xen/common/page_alloc.c:acquire_staticmem_pages:2676
 
> Cheers,
> 
> --
> Julien Grall

 


Rackspace

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