[PATCH v2 1/6] riscv: Split early and final KASAN population functions

Conor Dooley conor at kernel.org
Mon Jan 23 14:15:43 PST 2023


Hey Alex,

FYI this patch has a couple places with spaces used rather than tabs for
indent.

>  static void __init kasan_populate_p4d(pgd_t *pgd,
> -				      unsigned long vaddr, unsigned long end,
> -				      bool early)
> +				      unsigned long vaddr, unsigned long end)
>  {
>  	phys_addr_t phys_addr;
>  	p4d_t *p4dp, *base_p4d;
>  	unsigned long next;
>  
> -	if (early) {
> -		/*
> -		 * We can't use pgd_page_vaddr here as it would return a linear
> -		 * mapping address but it is not mapped yet, but when populating
> -		 * early_pg_dir, we need the physical address and when populating
> -		 * swapper_pg_dir, we need the kernel virtual address so use
> -		 * pt_ops facility.
> -		 */
> -		base_p4d = pt_ops.get_p4d_virt(pfn_to_phys(_pgd_pfn(*pgd)));
> -	} else {
> -		base_p4d = (p4d_t *)pgd_page_vaddr(*pgd);
> -		if (base_p4d == lm_alias(kasan_early_shadow_p4d)) {
> -			base_p4d = memblock_alloc(PTRS_PER_PUD * sizeof(p4d_t), PAGE_SIZE);
> -			memcpy(base_p4d, (void *)kasan_early_shadow_p4d,
> -				sizeof(p4d_t) * PTRS_PER_P4D);
> -		}
> -	}
> +	base_p4d = (p4d_t *)pgd_page_vaddr(*pgd);
> +	if (base_p4d == lm_alias(kasan_early_shadow_p4d)) {
> +		base_p4d = memblock_alloc(PTRS_PER_PUD * sizeof(p4d_t), PAGE_SIZE);
> +        memcpy(base_p4d, (void *)kasan_early_shadow_p4d,
> +                sizeof(p4d_t) * PTRS_PER_P4D);
> +    }

^^  here.

Thanks,
Conor.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20230123/329c8daa/attachment.sig>


More information about the linux-riscv mailing list