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

RE: [PATCH v11 6/6] xen: retrieve reserved pages on populate_physmap


  • To: Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Penny Zheng <Penny.Zheng@xxxxxxx>
  • Date: Fri, 2 Sep 2022 07:10:34 +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=M8/CfeCztkl9UZ0Gv642GE2S/5O7CvFEFtWFvLIHtO8=; b=b03KQdl8P/ugUzomRPQ7ydL/fuHwPY9S76Jy9oOUyEFFH7Og6ULvQ+N03z5POVpSXqeGzoP6XS+UtYw9bF+orvnS0yceSBSwAN0i/V5Ix3wQ+kjArZk1M6m217IJ3bYhNcQ75jKjTOOeLnaH4NtZRWa705cmT7gnWpuL4q9MnCA5TTRVWHYwfjB5gm9ysLt6bSi0lCC9b8aeQO7nc8LbJiFCgq+485c54vq9vmEQZTEYvEKNC5DGUDKU+iUlAMcCZ8OZFGkslsT7yzRUEZqJDhzjBtlT+yDKpOXy9BoNXGfYl/xVltaTKLWq6x5yUll3DVhY/Jfeh+z8HeF8t3Tkcg==
  • 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=M8/CfeCztkl9UZ0Gv642GE2S/5O7CvFEFtWFvLIHtO8=; b=I0tXA0W3LAn68rOZE/3C3XBSMjmvN9E15arOv0IJCfb98/BtaSc5Kxf42fziikGe/tIU9aIEfAGzs6OhxuaeGfS7likRD0yny25cTsdcwWJ5CYExRoLTIp2svUH+GpEb8iCj79IpM4EvTsifKXQv4Z0ge4IM2axdFwkbBDGvht1Ly18fD4Ba7k9LPnse5ujAH6n2yWnjJlcTtuD3V6Zuckd+DQH5q8GfcyITt8i7qkPTbU3CoVw7Xc1PAWdLg7T+djpeE66aXGenbM37nb3+cVI88/5wPAeNGkuVMCNguTikxINj0HgR6/Q3JoAE0Dv8h5olDni+LtUDcbsTrEmgnw==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=iXzV0VeDxoIzcXlybg34vV4nKxDs2nxFdCzQE9GLD3VdaKZSNBJDeazha36CemI6YopfC6zZ0ktEKrOTMGv87Jsqaeta/LUVooOmxdB8xxx3Py3KbKFPkcKd0DagRsoHSspEuZaXINUe7aRiz/Yybu5EAmh4VyyXkKfRTp8fB1lS2BkaTOp7v5IwOjbFv2OUPdUvcb/MI2guz9FKhNdbs+SWC4l67ICQ0Kcgvem0xxw8I4HWt3k4dSR5PqAS+zLpAxoqCI1kbwx5ONuNgqaKMpX2vSgPmE37mz62Pble2bcTdO7FBHWRz/6YQfb4xTDWpvlebZPG3u5EI7tPVOCiUg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eSZ0mzcL3jMPweRz0qajR9RmV163IuWBdo9EJrczVmd9Muc2qA2NfErAb0gC7Xh53sQLLJGSxyftrvhl5r7slzUO/QK+DuugrkxxSNKzX6qGH5ofg+aC1GMwgVNtV/HHqgVUseaAHmrbe8T9/MGi759ysXe4kE/f2vIAua99icGSJqrvSZdC1jVU2MHk1dh+aU3RUSTcY2WgOy02pwrGv6vS2kIypcTRfqH0WwBVI4AHkeJ53APR8EeyHmjNEaUt2eQC8jPYS1EEs0NWsOK7mg/OCo6e/njyECgvwAYOHkx4vG4jsTBk4WSW74b80VV1eWDlKeHLGl4gRjNxQC2Acw==
  • 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>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Fri, 02 Sep 2022 07:10:50 +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: AQHYvOMsvYdyv+g/RU6qDpjhWsAPd63KmnWAgAEgCQA=
  • Thread-topic: [PATCH v11 6/6] xen: retrieve reserved pages on populate_physmap

Hi Julien

> -----Original Message-----
> From: Julien Grall <julien@xxxxxxx>
> Sent: Thursday, September 1, 2022 9:53 PM
> To: Penny Zheng <Penny.Zheng@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx
> Cc: Wei Chen <Wei.Chen@xxxxxxx>; Andrew Cooper
> <andrew.cooper3@xxxxxxxxxx>; George Dunlap <george.dunlap@xxxxxxxxxx>;
> Jan Beulich <jbeulich@xxxxxxxx>; Stefano Stabellini <sstabellini@xxxxxxxxxx>;
> Wei Liu <wl@xxxxxxx>
> Subject: Re: [PATCH v11 6/6] xen: retrieve reserved pages on
> populate_physmap
> 
> Hi Penny,
> 
> On 31/08/2022 03:40, Penny Zheng wrote:
> > +/*
> > + * Acquire a page from reserved page list(resv_page_list), when
> > +populating
> > + * memory for static domain on runtime.
> > + */
> > +mfn_t acquire_reserved_page(struct domain *d, unsigned int memflags)
> > +{
> > +    struct page_info *page;
> > +
> > +    ASSERT_ALLOC_CONTEXT();
> > +
> > +    /* Acquire a page from reserved page list(resv_page_list). */
> > +    spin_lock(&d->page_alloc_lock);
> > +    page = page_list_remove_head(&d->resv_page_list);
> > +    spin_unlock(&d->page_alloc_lock);
> > +    if ( unlikely(!page) )
> > +        return INVALID_MFN;
> > +
> > +    if ( !prepare_staticmem_pages(page, 1, memflags) )
> > +        goto fail;
> > +
> > +    if ( assign_domstatic_pages(d, page, 1, memflags) )
> > +        goto fail_assign;
> > +
> > +    return page_to_mfn(page);
> > +
> > + fail_assign:
> > +    unprepare_staticmem_pages(page, 1, false);
> 
> Looking at assign_domstatic_pages(). It will already call
> unprepare_staticmem_pages() in one of the error path. It doesn't look like
> the latter can be called twice on a page.
> 
> To be honest, I find a bit odd that assign_domstatic_pages() is calling
> unprepare_staticmem_pages() because the former doesn't call the "prepare"
> function.
> 
> AFAICT, this is an issue introduced in this patch. So I would remove the call
> from assign_domstatic_pages() and then let the caller calls
> unprepare_staticmem_pages() (this would need to be added in
> acquire_domstatic_pages()).
> 

True, true, thanks for pointing out!!

> Also, I think it would be good to explain why we don't need to scrub.
> Something like:
> 
> "The page was never accessible by the domain. So scrubbing can be skipped".
> 

Ok,  I'll add in-code comment

> Cheers,
> 
> --
> Julien Grall

 


Rackspace

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