[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 3/7] x86: extend update_intpte() to support atomic get-and-update
- To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Kevin Lampis <kevin.lampis@xxxxxxxxxx>
- Date: Tue, 15 Sep 2026 19:37:25 +0000
- Accept-language: en-GB, en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=Jge8zOljOUYlG2uCmO5vY/sOGSjD131OalvqMCXWsDk=; b=ldvONQiHCDKFm/ZSEZ7txEAY+5lBCM2VFoJV3tIg+MvWUoZkEYa92d2Dr61940F3d2UwuGqXU3M+y2VS5kqkGSkzOilEX5e6uio0//YAiAzWnNNmQ8XMZNLS61S1BD9nQQuZBdqxJt5lKxyfb2FHhzOLF3y5teUO0V/k77BlaPgLwbTqJlvsG+YK9JpWBKbMCe4i2Lv9jFcQ3WKvFVD63b7AxonFVuxdQRvaBeQEndj+HCg0dnONjcJoQEp8mkh0ThEhP9fGh1uY7aXsFHyLypFVK3rElCQjFuBxYa4SO/pTJHConlMNygA8hQ4wZE/NmzDUCL8LLF91aq6Mi7BrYg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NbSYQXNOIULcFVUMqtGecV97BIAlT9UUghOCZb22RDDBIbf2KabehI1gLUD2zpdr2/jmBuB4LyuehKUfRCxDxTL9PbO75kFpAo2IwgKzxTublF2L59e7z54XG+A7vwmQm3CfzBFPtbyV+EvVkJMecnMu9VOik1a+lYkFzDMx1/hIce9uSOKZm+mVbmbf8cCx+1R2ArYAbtOvOpUpEja+ZXpJOnFLg/hqOX20nhl7nimwczpWtiY555KnAClcqXyPjpkBs3s6+L2agKMuVN+QgO8d8dSbdZkHCjJLS4jhr1QNHE7x73/tEgJb78T7aBDXf6AD43fFE85xgAWzmv2yPQ==
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: "jbeulich@xxxxxxxx" <jbeulich@xxxxxxxx>, "teddy.astie@xxxxxxxxxx" <teddy.astie@xxxxxxxxxx>
- Delivery-date: Tue, 15 Sep 2026 19:37:43 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Msip_labels:
- Thread-index: AQHdQWMYYuOEW7sUTEmdu2MmKUu4LbbJV30AgAaz+PY=
- Thread-topic: [PATCH v2 3/7] x86: extend update_intpte() to support atomic get-and-update
>This seems unwise. I think you want a return 0 in the
>paging_write_guest_entry() case because returning the input cannot
>possibly lead to anything good.
This would make the calling code in mod_l1_entry() more complicated.
At the moment it shakes out like this
static int mod_l1_entry(l1_pgentry_t *pl1e,
...,
l1_pgentry_t *ol1e_out)
{
l1_pgentry_t ol1e = l1e_read(pl1e);
...
ol1e = UPDATE_ENTRY(l1, pl1e, ol1e, ...);
...
put_page_from_l1e(ol1e, pt_dom);
...
if ( ol1e_out )
*ol1e_out = ol1e;
}
But if UPDATE_ENTRY() sometimes returns 0 depending on what internal path it
takes then we'll need two local ol1e variables, one that is always valid to
give to put_page_from_l1e() and a different one to maybe assign to *ol1e_out.
When you say "returning the input cannot possibly lead to anything good", the
current version of this patch series actually depends on it.
I guess I just wanted to clarify before adding more complexity to mod_l1_entry.
|