lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 28 Feb 2023 20:42:46 +0800
From:   Youling Tang <tangyouling@...ngson.cn>
To:     Jinyang He <hejinyang@...ngson.cn>
Cc:     Huacai Chen <chenhuacai@...nel.org>,
        WANG Xuerui <kernel@...0n.name>,
        Xi Ruoyao <xry111@...111.site>, loongarch@...ts.linux.dev,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 4/6] LoongArch: Drop pernode exception handlers



On 02/28/2023 04:02 PM, Jinyang He wrote:

> diff --git a/arch/loongarch/mm/tlb.c b/arch/loongarch/mm/tlb.c
> index 8bad6b0cff59..dda35eae1c49 100644
> --- a/arch/loongarch/mm/tlb.c
> +++ b/arch/loongarch/mm/tlb.c
> @@ -250,50 +250,10 @@ static void output_pgtable_bits_defines(void)
>  	pr_debug("\n");
>  }
>
> -#ifdef CONFIG_NUMA
> -unsigned long pcpu_handlers[NR_CPUS];
> -#endif
> -extern long exception_handlers[VECSIZE * 128 / sizeof(long)];
> -
>  void setup_tlb_handler(int cpu)
It may be necessary to rename the function after modification.

Youling.
>  {
>  	setup_ptwalker();
>  	local_flush_tlb_all();
> -
> -	/* The tlb handlers are generated only once */
> -	if (cpu == 0) {
> -		memcpy((void *)tlbrentry, handle_tlb_refill, 0x80);
> -		local_flush_icache_range(tlbrentry, tlbrentry + 0x80);
> -		set_handler(EXCCODE_TLBI * VECSIZE, handle_tlb_load, VECSIZE);
> -		set_handler(EXCCODE_TLBL * VECSIZE, handle_tlb_load, VECSIZE);
> -		set_handler(EXCCODE_TLBS * VECSIZE, handle_tlb_store, VECSIZE);
> -		set_handler(EXCCODE_TLBM * VECSIZE, handle_tlb_modify, VECSIZE);
> -		set_handler(EXCCODE_TLBNR * VECSIZE, handle_tlb_protect, VECSIZE);
> -		set_handler(EXCCODE_TLBNX * VECSIZE, handle_tlb_protect, VECSIZE);
> -		set_handler(EXCCODE_TLBPE * VECSIZE, handle_tlb_protect, VECSIZE);
> -	}
> -#ifdef CONFIG_NUMA
> -	else {
> -		void *addr;
> -		struct page *page;
> -		const int vec_sz = sizeof(exception_handlers);
> -
> -		if (pcpu_handlers[cpu])
> -			return;
> -
> -		page = alloc_pages_node(cpu_to_node(cpu), GFP_ATOMIC, get_order(vec_sz));
> -		if (!page)
> -			return;
> -
> -		addr = page_address(page);
> -		pcpu_handlers[cpu] = (unsigned long)addr;
> -		memcpy((void *)addr, (void *)eentry, vec_sz);
> -		local_flush_icache_range((unsigned long)addr, (unsigned long)addr + vec_sz);
> -		csr_write64(pcpu_handlers[cpu], LOONGARCH_CSR_EENTRY);
> -		csr_write64(pcpu_handlers[cpu], LOONGARCH_CSR_MERRENTRY);
> -		csr_write64(pcpu_handlers[cpu] + 80*VECSIZE, LOONGARCH_CSR_TLBRENTRY);
> -	}
> -#endif
>  }
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ