[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: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Kevin Lampis <kevin.lampis@xxxxxxxxxx>
  • Date: Wed, 16 Sep 2026 08:23:14 +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=7B3fv3RhboLg99eykgwSnE5v+dtq2chUexLkyAwo+8c=; b=PTfklA+y55uUHRsS5Xpr6jJWPc9ToDiyOWlC3rHSbbuTOcj0BANqVs1hbTFLbN4JKfSpMTA7TJ7AbHZCp2iY0oV5dtAQtRpL1KnDdRwKvIytkS1Ir/HwQ4b9kZTae+GY9k7tZO/a+RdZSp+XJn4CyBEul0G0zZNw6MAdpyc03MnCzrJaaBtCG4bNgqUstNbC6L1ufveE050lXMFKnYH+u22fGdjfXL5Qcr9vmfQc0uzfQG25vRRUiHNAuXyeaG4+TpAEjD75n3vHWibaUg9WGALPtV2TxcsD1q7NBBoeiO8Q+2fumd24eaStl4Np2We+E73u44dzh+W5Ff8fxJGJUw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CNvIdsGjYpropUhIAlAb3AboTwf+JVFbuAO2C2I9MMdxRri/OPFIoKyOoYyncMQsnlquA+hS5ErUSD+3PfXiXXMX0qM3SvHHecIq7XMSGQWpRYQ8xnOeW9BxfCtWvKLn0IE5ZXe+HVED/r+qEnF/ApAMQUKrOXMhqvCM/tN+DlVZiKRNuVQbVuojQdzu8fMSX9lICbJtAKvJ0qsTBvbWLNM+pgZs9yLOtYa/u3yGz+dlkC6KW/4DiQIsutuPDVKofxyjLcN4nw4W+W1COTn2VwtarSMKyD7TJUsu7pSTbdrN+DeF89vzLtKXUgCxsR6dxkz4E7bMWlcG5SXZErrowg==
  • 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: "teddy.astie@xxxxxxxxxx" <teddy.astie@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Delivery-date: Wed, 16 Sep 2026 08:23:28 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Msip_labels:
  • Thread-index: AQHdQWMYYuOEW7sUTEmdu2MmKUu4LbbJV30AgAaz+PaAAK8QAIAAK46o
  • Thread-topic: [PATCH v2 3/7] x86: extend update_intpte() to support atomic get-and-update

>The "flag set, pointer non-NULL" case wouldn't hit the "return 0" path

Correct.

But what about the "flag not set" case. When PTE_UPDATE_SWAP is not set then
UPDATE_ENTRY may return 0.

If UPDATE_ENTRY() returns 0 then mod_l1_entry() will give
the wrong ol1e value to put_page_from_l1e().

    static int mod_l1_entry( ... )
    {
        ...
        ol1e = UPDATE_ENTRY(l1, pl1e, ol1e, ...);
        ...
        put_page_from_l1e(ol1e, pt_dom);
        ...
    }

I think mod_l1_entry may need to store a copy of ol1e incase UPDATE_ENTRY()
returns 0. Or add some extra if/else around every call to UPDATE_ENTRY() to
only assign ol1e if we know we're on the new PTE_UPDATE_SWAP path.

And the mod_l{2,3,4}_entry() functions will probably have to do the same thing
too so I just wanted to get some input first.

 


Rackspace

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