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

Re: [PATCH v2 11/18] AMD/IOMMU: return old PTE from {set,clear}_iommu_pte_present()


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 10 Dec 2021 13:59:02 +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=H5SQvSUTE08HRX1K3p0iFyW1h91xmLmURncx5MpE4Ms=; b=oMJ7MZWyRsboNr4bkej/oaUJr0bptD3VdpvoQ+JmflzfJ07Oi2NGMVg3bOTL1JfiVpsEwycIJje+c2jIdIm2TuzjRCjtUz8QMz+WyhHbxfn+x/avu9IGtB0ofRNHYVbRfiLHwF5NqQGRF+if5CBk4IetoMrhwJfG1uBnq8t24dLoWE2Rpa3G2Pk7BshXezeAKknqPKGSDW1VSNxoDla0h87deT4BGTlKIfx5NCKSUQ5yjZzeZ5Z1Ty8nART5VGtMXjpsPRf4yhdzKOTyNWZl/wZWkuP9oY5mBLQx13IpQDUtrdS19iy2BdeQuO+aBDRHBAYUqvo1eCP2EwPxdXJImg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gzhPqqPEswQaApaS1Wxiytlaon6WjrCqHtc4rZ6AohxoRihGTloO6OnWp7udRusZraHhhGaMtrT3RvMb3repyFvV0dBHGDbHpHJ8zgKgxmVXTCrKJkgY4jxHxRuqIBQ1WIG30CkZonBL5wcB+V7nX/jQ4iDoztClOxTah2zs0IfvoX538BC4uYz/Mz3HZgVRc7clmTCXKg6sVwQ1YBK1J5X/KAmP0OOJBTRgHE7eujzSysBrhk/m1YWIMPQElC9GASwbD4xo9vUu0jPdP0yan47y16Sh8YgFBAMDK8Nl31hPISetQpvyLYjUsJeVEE5NVRDn8UtpXM9RJkSX3UdMrQ==
  • 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>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>
  • Delivery-date: Fri, 10 Dec 2021 12:59:19 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 10.12.2021 13:05, Roger Pau Monné wrote:
> On Fri, Sep 24, 2021 at 11:51:40AM +0200, Jan Beulich wrote:
>> In order to free intermediate page tables when replacing smaller
>> mappings by a single larger one callers will need to know the full PTE.
>> Flush indicators can be derived from this in the callers (and outside
>> the locked regions). First split set_iommu_pte_present() from
>> set_iommu_ptes_present(): Only the former needs to return the old PTE,
>> while the latter (like also set_iommu_pde_present()) doesn't even need
>> to return flush indicators. Then change return types/values and callers
>> accordingly.
> 
> Without looking at further patches I would say you only care to know
> whether the old PTE was present (ie: pr bit set), at which point those
> functions could also return a boolean instead of a full PTE?

But looking at further patches will reveal that I then also need the
next_level field from the old PTE (to tell superpages from page tables).

Jan




 


Rackspace

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