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-next>] [day] [month] [year] [list]
Message-ID: <20230829002323.28303-1-rdunlap@infradead.org>
Date:   Mon, 28 Aug 2023 17:23:23 -0700
From:   Randy Dunlap <rdunlap@...radead.org>
To:     linux-kernel@...r.kernel.org
Cc:     Randy Dunlap <rdunlap@...radead.org>,
        Qing Zhang <zhangqing@...ngson.cn>, Hui Li <lihui@...ngson.cn>,
        Binbin Zhou <zhoubinbin@...ngson.cn>,
        Huacai Chen <chenhuacai@...nel.org>,
        WANG Xuerui <kernel@...0n.name>, loongarch@...ts.linux.dev
Subject: [PATCH 2/2] Loongarch: KGDB: fix build when CPU_HAS_LBT not set

Fix build errors when CONFIG_CPU_HAS_LBT is not set:

loongarch64-linux-ld: arch/loongarch/kernel/kgdb.o: in function `dbg_get_reg':
arch/loongarch/kernel/kgdb.c:154:(.text+0xc7c): undefined reference to `_save_lbt'
loongarch64-linux-ld: arch/loongarch/kernel/kgdb.o: in function `dbg_set_reg':
arch/loongarch/kernel/kgdb.c:229:(.text+0x13a4): undefined reference to `_restore_lbt'

Fixes: 8968eb010689 ("LoongArch: Add basic KGDB & KDB support")
Signed-off-by: Randy Dunlap <rdunlap@...radead.org>
Cc: Qing Zhang <zhangqing@...ngson.cn>
Cc: Hui Li <lihui@...ngson.cn>
Cc: Binbin Zhou <zhoubinbin@...ngson.cn>
Cc: Huacai Chen <chenhuacai@...nel.org>
Cc: WANG Xuerui <kernel@...0n.name>
Cc: loongarch@...ts.linux.dev
---
 arch/loongarch/kernel/kgdb.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff -- a/arch/loongarch/kernel/kgdb.c b/arch/loongarch/kernel/kgdb.c
--- a/arch/loongarch/kernel/kgdb.c
+++ b/arch/loongarch/kernel/kgdb.c
@@ -150,7 +150,8 @@ char *dbg_get_reg(int regno, void *mem,
 	}
 
 	/* Handle LBT registers */
-	if ((regs->csr_euen & CSR_EUEN_LBTEN)) {
+	if (IS_ENABLED(CONFIG_CPU_HAS_LBT) &&
+	    (regs->csr_euen & CSR_EUEN_LBTEN)) {
 		_save_lbt(&current->thread.lbt);
 
 		switch (regno) {
@@ -211,7 +212,8 @@ int dbg_set_reg(int regno, void *mem, st
 	}
 
 	/* Handle LBT registers */
-	if ((regs->csr_euen & CSR_EUEN_LBTEN)) {
+	if (IS_ENABLED(CONFIG_CPU_HAS_LBT) &&
+	    (regs->csr_euen & CSR_EUEN_LBTEN)) {
 		switch (regno) {
 		case DBG_FTOP:				/* Process the ftop */
 			memcpy((char *)&current->thread.fpu.ftop, mem, reg_size);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ