Re: [PATCH v1] mm: More ptep_get() conversion

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

 



On Tue, Nov 14, 2023 at 03:49:45PM +0000, Ryan Roberts wrote:
> Commit c33c794828f2 ("mm: ptep_get() conversion") converted all
> (non-arch) call sites to use ptep_get() instead of doing a direct
> dereference of the pte. Full rationale can be found in that commit's
> log.
> 
> Since then, three new call sites have snuck in, which directly
> dereference the pte, so let's fix those up.
> 
> Unfortunately there is no reliable automated mechanism to catch these;
> I'm relying on a combination of Coccinelle (which throws up a lot of
> false positives) and some compiler magic to force a compiler error on
> dereference (While this approach finds dereferences, it also yields a
> non-booting kernel so can't be committed).

Well ... let's see what we can come up with.

struct raw_pte {
	pte_t pte;
};

static inline pte_t ptep_get(struct raw_pte *rpte)
{
	return rpte.pte;
}

Probably quite a lot of churn to put that into place, but better than
a never-ending treadmill of fixing the places that people overlooked?




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux