[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Ping: [PATCH] Argo: don't obtain excess page references
- To: Christopher Clark <christopher.w.clark@xxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Mon, 21 Nov 2022 13:41:51 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
- 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=XEx6ECnOSFnF6BliBWg13i61lRLETnt3SNgJJ4neH6E=; b=Ztf1vj7Ae5JylqmgkF4TiYFvJgrkH6F+nuK8kWNOqtZmG/U3sZ5/fqBPoHyGids6RBTq4s9c95r+514emcNIkdSMUx8PiVse9h+9gMQfD2FRw+WmaRE70fEUyd/ToICNXScqlYqR6A9y4l7B9qrSJZh9YES4RGAUzyzNGi81PICwsBaEsQ7N6k4pFH0Vg5BGf5PidBEQWVCw3TD+fR2XUC2Cl2X40w2TKv0OetI6UdYgJQKx37P+QGTqi4Xf8QXniwjdM5QnDI3fn8GHtoX9KBI2fkCWfXQweD3yu75ZIy9VVeDyCYbpuTOdC2QESuvxFE0V91dlPq60DVUYEVfIhg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BnDEY7yqNH7Z+nECNdBSEnqJ/o4AZ5M90Lt/AQeyORCk2xClWwmFNZoFKmqU8LmF4k7+V4o4/N5XLz6Yw9T+fWN1BQjaZxlemX5cw1N6Gc1plbNpNohI2CJLRkpd/RGGIL7SGLgZFi3kVJYRM4VzfPWQQR3+r3bMutTAtn5DM1lSRPz+eHwWKBvuZUqWU+oi4oIbQSds/O7TzWCchc375EsfHkLzsnoUcUiHQkM9VF9NQl7rABctcUdu3Loq9VMOUkWQQD0aUB1dM7dlnlV63HrPyW2GHfXDdnLcZWaZTNIOJ/6ZO2GW5nvJCBQbr2VCE55XrmLQzIWdUbTHA/Be3Q==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Mon, 21 Nov 2022 12:42:16 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 11.10.2022 11:28, Jan Beulich wrote:
> find_ring_mfn() already holds a page reference when trying to obtain a
> writable type reference. We shouldn't make assumptions on the general
> reference count limit being effectively "infinity". Obtain merely a type
> ref, re-using the general ref by only dropping the previously acquired
> one in the case of an error.
>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Ping?
> ---
> I further question the log-dirty check there: The present P2M type of a
> page doesn't really matter for writing to the page (plus it's stale by
> the time it is looked at). Instead I think every write to such a page
> needs to be accompanied by a call to paging_mark_dirty().
>
> --- a/xen/common/argo.c
> +++ b/xen/common/argo.c
> @@ -1429,10 +1429,11 @@ find_ring_mfn(struct domain *d, gfn_t gf
> ret = -EAGAIN;
> #endif
> else if ( (p2mt != p2m_ram_rw) ||
> - !get_page_and_type(page, d, PGT_writable_page) )
> + !get_page_type(page, PGT_writable_page) )
> ret = -EINVAL;
>
> - put_page(page);
> + if ( unlikely(ret) )
> + put_page(page);
>
> return ret;
> }
>
|