Re: [PATCH v3 28/34] s390/mm: Define KMSAN metadata for vmalloc and modules

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

 



On Tue, Jan 02, 2024 at 04:05:31PM +0100, Heiko Carstens wrote:
Hi Heiko,
...
> > @@ -253,9 +253,17 @@ static unsigned long setup_kernel_memory_layout(void)
> >  	MODULES_END = round_down(__abs_lowcore, _SEGMENT_SIZE);
> >  	MODULES_VADDR = MODULES_END - MODULES_LEN;
> >  	VMALLOC_END = MODULES_VADDR;
> > +#ifdef CONFIG_KMSAN
> > +	VMALLOC_END -= MODULES_LEN * 2;
> > +#endif
> >  
> >  	/* allow vmalloc area to occupy up to about 1/2 of the rest virtual space left */
> >  	vmalloc_size = min(vmalloc_size, round_down(VMALLOC_END / 2, _REGION3_SIZE));
> > +#ifdef CONFIG_KMSAN
> > +	/* take 2/3 of vmalloc area for KMSAN shadow and origins */
> > +	vmalloc_size = round_down(vmalloc_size / 3, _REGION3_SIZE);
> > +	VMALLOC_END -= vmalloc_size * 2;
> > +#endif
> 
> Please use
> 
> 	if (IS_ENABLED(CONFIG_KMSAN))
> 
> above, since this way we get more compile time checks.

This way we will get a mixture of CONFIG_KASAN and CONFIG_KMSAN
#ifdef vs IS_ENABLED() checks within one function. I guess, we
would rather address it with a separate cleanup?

Thanks!




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux