Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Low] mm: build failure in ptep_get_lockless() with ARCH_HAS_HW_PTE_T
--

commit 5a58c0b37be320a1ff8bd51ae9ca94d50bf27375
Author: Muhammad Usama Anjum <[email protected]>

mm: convert PTE table entries in ptep_get()
    
ptep_get() now accepts a pointer to hw_pte_t storage but must continue to
return a software PTE value. Add __pte_from_hw for both generic hw_pte_t
definitions. Read the hw_pte_t table element atomically before converting
it to pte_t.

[ ... ]

> diff --git a/include/linux/pgtable_types.h b/include/linux/pgtable_types.h
> index 07da05d375c2c..d6c5a7548550b 100644
> --- a/include/linux/pgtable_types.h
> +++ b/include/linux/pgtable_types.h
> @@ -8,8 +8,10 @@
>  
>  #ifdef CONFIG_ARCH_HAS_HW_PTE_T
>  typedef struct __hw_pte_t { pte_t __pte; } hw_pte_t;
> +#define __pte_from_hw(pte)   ((pte).__pte)

[Severity: Low]
Does this wrapper struct cause a build failure in ptep_get_lockless()
when architectures using CONFIG_GUP_GET_PXX_LOW_HIGH (like x86-32 PAE) 
opt into ARCH_HAS_HW_PTE_T?

When hw_pte_t is a wrapper struct instead of a typedef, the direct member 
access fails to compile:

include/linux/pgtable.h:ptep_get_lockless() {
    ...
        do {
                pte.pte_low = ptep->pte_low;
                smp_rmb();
                pte.pte_high = ptep->pte_high;
                smp_rmb();
        } while (unlikely(pte.pte_low != ptep->pte_low));
    ...
}

Since ptep is a pointer to the wrapper struct, it lacks the pte_low and
pte_high members.

>  #else
>  #define hw_pte_t pte_t
> +#define __pte_from_hw(pte)   (pte)
>  #endif
>  
>  #endif /* !__ASSEMBLY__ */

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=4

Reply via email to