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] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 28 Feb 2023 20:42:36 +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 3/6] LoongArch: Create a exception handlers section

Hi, Jinyang

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

> diff --git a/arch/loongarch/kernel/vmlinux.lds.S b/arch/loongarch/kernel/vmlinux.lds.S
> index ad2ce1a0908e..e99b50359900 100644
> --- a/arch/loongarch/kernel/vmlinux.lds.S
> +++ b/arch/loongarch/kernel/vmlinux.lds.S
> @@ -21,6 +21,11 @@
>   */
>  PECOFF_FILE_ALIGN = 0x200;
>  PECOFF_SEGMENT_ALIGN = 0x10000;
> +EX_HANDLER_ALIGN = SZ_512;
> +EX_HANDLER_SIZE = SZ_512;
> +EX_HANDLER_TOTAL = 78; /* 64 Exceptions + 14 Interrupts */

You can define EXCCODE_NUM as 78 in loongarch.h, and remove the unused
EXCCODE_INT_END and EXCCODE_INT_NUM in PATCH4.

Youling.

> +EXCEPTION_ENTRY_ALIGN = SZ_64K;
> +TLBR_ENTRY_ALIGN = SZ_4K;
>
>  OUTPUT_ARCH(loongarch)
>  ENTRY(kernel_entry)
> @@ -54,6 +59,17 @@ SECTIONS
>  	. = ALIGN(PECOFF_SEGMENT_ALIGN);
>  	_etext = .;
>
> +	. = ALIGN(EXCEPTION_ENTRY_ALIGN);
> +	.ex_handlers : {
> +		__ex_handlers = .;
> +		*(SORT_BY_INIT_PRIORITY(.exception_handlers.*))
> +		. = ALIGN(EX_HANDLER_ALIGN);
> +		__ex_handlers_end = .;
> +		. = ALIGN(TLBR_ENTRY_ALIGN);
> +		__tlbr_entry = .;
> +		*(.tlbrhandler)
> +	}
> +
>  	/*
>  	 * struct alt_inst entries. From the header (alternative.h):
>  	 * "Alternative instructions for different CPU types or capabilities"
> @@ -154,3 +170,6 @@ SECTIONS
>  		*(.eh_frame)
>  	}
>  }
> +
> +ASSERT(__ex_handlers_end == (__ex_handlers + EX_HANDLER_SIZE * EX_HANDLER_TOTAL),
> +       "The amount of exception handlers does not match!");

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ