[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3976ef5d-a959-408a-b538-7feba1f0ab7a@intel.com>
Date: Thu, 21 Aug 2025 10:36:12 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Harry Yoo <harry.yoo@...cle.com>
Cc: Liam.Howlett@...cle.com, akpm@...ux-foundation.org, andreyknvl@...il.com,
aneesh.kumar@...ux.ibm.com, anshuman.khandual@....com, apopple@...dia.com,
ardb@...nel.org, arnd@...db.de, bp@...en8.de, cl@...two.org,
dave.hansen@...ux.intel.com, david@...hat.com, dennis@...nel.org,
dev.jain@....com, dvyukov@...gle.com, glider@...gle.com,
gwan-gyeong.mun@...el.com, hpa@...cr.com, jane.chu@...cle.com,
jgross@...e.de, jhubbard@...dia.com, joao.m.martins@...cle.com,
joro@...tes.org, kas@...nel.org, kevin.brodsky@....com,
linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, lorenzo.stoakes@...cle.com, luto@...nel.org,
maobibo@...ngson.cn, mhocko@...e.com, mingo@...hat.com, osalvador@...e.de,
peterx@...hat.com, peterz@...radead.org, rppt@...nel.org,
ryabinin.a.a@...il.com, ryan.roberts@....com, stable@...r.kernel.org,
surenb@...gle.com, tglx@...utronix.de, thuth@...hat.com, tj@...nel.org,
urezki@...il.com, vbabka@...e.cz, vincenzo.frascino@....com, x86@...nel.org,
zhengqi.arch@...edance.com
Subject: Re: [PATCH v2] mm: fix KASAN build error due to p*d_populate_kernel()
On 8/21/25 04:57, Harry Yoo wrote:
> However, {pgd,p4d}_populate_kernel() is defined as a function regardless
> of the number of page table levels, so the compiler may not optimize
> them away. In this case, the following linker error occurs:
This part of the changelog confused me. I think it's focusing on the
wrong thing.
The code that's triggering this is literally:
> pgd_populate(&init_mm, pgd,
> lm_alias(kasan_early_shadow_p4d));
It sure _looks_ like it's unconditionally referencing the
'kasan_early_shadow_p4d' symbol. I think it's wrong to hide that with
macro magic and just assume that the macros won't reference it.
If a symbol isn't being defined, it shouldn't be referenced in C code.:q
The right way to do it is to have an #ifdef in a header that avoids
compiling in the reference to the symbol.
But just changing the 'static inline' to a #define seems like a fragile
hack to me.
Powered by blists - more mailing lists