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

Re: [PATCH v4 17/21] AMD/IOMMU: replace all-contiguous page tables by superpage mappings


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 18 May 2022 12:40:59 +0200
  • 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=EdH0keCRnrVv4uaQo/ur6zD6UHS4DcgosJK3el563VM=; b=YZtgAXYf2phPqjysxFghKtpK1k0JBb5WLA8evj7qTSK+7WxEdrDsurZGT/E/LXQ2wTMG9/4EaYbR7pJ8Faj8MAfNsopi9NN3z4PsyiEDttR2rymlnNSx42vMGnv26azCXQ8nKR49sZXhUwFgP+pFRG8XnXPEyDAqDSl3IcWkeinIGNpg54O/10u5bKDnHeNFLT+1c9C2q6TbiJ/sEiCENfdyKWdypV77huhu4MN4RPJGijXsz3p2md6x6Yl08VmGL/KVUgqXulaUG6tIP9TUYmVCl2+aMm/LBTlXd/VCzhNtNj3UBschzj4AInQmTxSsgnOvCTZgP18JM25uXVN9mw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WnsJoqm0kueRWLuhupJefE0rg07bV0EtmUFYa03sno7nUzylr5fqUoLswqPDyulAZCAKTmOFmQNWyVUIEZmjabHiEdTyvcYgIeU+NHSMCPsNJGssIxqVqhMrXEybq4qkcaJk+R2E+0d8nu5rzeTq2eqHWV8YB5dqBwphblmB4rtt3L6JU4rl/DmIVax5PuvGAsfI6hUJJqYEioXp8JEEeLcNHN/BgAHR7chyRbC5Md4AjbnDnA9nOaNO2OvskRCx+WHk9cncD0QAZMGeF9Kg9brIguuUREh2b56iU9CGivxEzSDHJII85i1I2lFbp5FaL8DwqFry/nnvc78pNeDUHA==
  • 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: Wed, 18 May 2022 10:41:11 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 10.05.2022 17:31, Roger Pau Monné wrote:
> On Mon, Apr 25, 2022 at 10:43:16AM +0200, Jan Beulich wrote:
>> @@ -94,11 +95,15 @@ static union amd_iommu_pte set_iommu_pte
>>           old.iw != iw || old.ir != ir )
>>      {
>>          set_iommu_pde_present(pde, next_mfn, 0, iw, ir);
>> -        pt_update_contig_markers(&table->raw, pfn_to_pde_idx(dfn, level),
>> -                                 level, PTE_kind_leaf);
>> +        *contig = pt_update_contig_markers(&table->raw,
>> +                                           pfn_to_pde_idx(dfn, level),
>> +                                           level, PTE_kind_leaf);
>>      }
>>      else
>> +    {
>>          old.pr = false; /* signal "no change" to the caller */
>> +        *contig = false;
> 
> So we assume that any caller getting contig == true must have acted
> and coalesced the page table?

Yes, except that I wouldn't use "must", but "would". It's not a
requirement after all, functionality-wise all will be fine without
re-coalescing.

> Might be worth a comment, to note that the function assumes that a
> previous return of contig == true will have coalesced the page table
> and hence a "no change" PTE write is not expected to happen on a
> contig page table.

I'm not convinced, as there's effectively only one caller,
amd_iommu_map_page(). I also don't see why "no change" would be a
problem. "No change" can't result in a fully contiguous page table
if the page table wasn't fully contiguous already before (at which
point it would have been replaced by a superpage).

Jan




 


Rackspace

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