lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1bc53fc1-fdf0-4f4b-98ab-bab53384b765@redhat.com>
Date: Mon, 18 Dec 2023 18:02:22 +0100
From: David Hildenbrand <david@...hat.com>
To: Ryan Roberts <ryan.roberts@....com>, linux-kernel@...r.kernel.org
Cc: linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>,
 "Matthew Wilcox (Oracle)" <willy@...radead.org>,
 Hugh Dickins <hughd@...gle.com>, Yin Fengwei <fengwei.yin@...el.com>,
 Mike Kravetz <mike.kravetz@...cle.com>, Muchun Song <muchun.song@...ux.dev>,
 Peter Xu <peterx@...hat.com>
Subject: Re: [PATCH v1 14/39] mm/rmap: introduce
 folio_add_anon_rmap_[pte|ptes|pmd]()


>> -	if (flags & RMAP_EXCLUSIVE)
>> -		SetPageAnonExclusive(page);
>> -	/* While PTE-mapping a THP we have a PMD and a PTE mapping. */
>> -	VM_WARN_ON_FOLIO((atomic_read(&page->_mapcount) > 0 ||
>> -			  (folio_test_large(folio) && folio_entire_mapcount(folio) > 1)) &&
>> -			 PageAnonExclusive(page), folio);
>> +
>> +	if (flags & RMAP_EXCLUSIVE) {
>> +		switch (mode) {
>> +		case RMAP_MODE_PTE:
>> +			for (i = 0; i < nr_pages; i++)
>> +				SetPageAnonExclusive(page + i);
>> +			break;
>> +		case RMAP_MODE_PMD:
>> +			SetPageAnonExclusive(page);
> 
> Just to check; I suppose only setting this on the head is ok, because it's an
> exclusive mapping and therefore by definition it can only be mapped by pmd?

Yes. And when PTE-remapping, we will push the flag to all tail pages. No 
change in behavior :)

-- 
Cheers,

David / dhildenb


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ