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: <20220610011958.3263650-1-liyupeng@zbhlos.com>
Date:   Fri, 10 Jun 2022 09:19:58 +0800
From:   Yupeng Li <liyupeng@...los.com>
To:     chenhuacai@...nel.org, jiaxun.yang@...goat.com, tglx@...utronix.de,
        maz@...nel.org
Cc:     linux-mips@...r.kernel.org, linux-kernel@...r.kernel.org,
        caizp2008@....com, Yupeng Li <liyupeng@...los.com>
Subject: [PATCH 1/1]   irqchip/loongson-liointc: Guard uses of cpu_logical_map

  cpu_logical_map is only defined for CONFIG_SMP builds, when we are in an
  UP configuration, the boot CPU is 0. Some kernel compilation error 
  information is as follows:

  CALL    scripts/atomic/check-atomics.sh
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  CC      drivers/irqchip/irq-loongson-liointc.o
drivers/irqchip/irq-loongson-liointc.c: In function 'liointc_chained_handle_irq':
drivers/irqchip/irq-loongson-liointc.c:60:13: error: implicit declaration of function 'cpu_logical_map' [-Werror=implicit-function-declaration]
  int core = cpu_logical_map(smp_processor_id()) % LIOINTC_NUM_CORES;
             ^~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:249:drivers/irqchip/irq-loongson-liointc.o] error 1
make[1]: *** [scripts/Makefile.build:466:drivers/irqchip] error 2

Acked-by: Caicai <caizp2008@....com>
Signed-off-by: Yupeng Li <liyupeng@...los.com>
---
 drivers/irqchip/irq-loongson-liointc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/irqchip/irq-loongson-liointc.c b/drivers/irqchip/irq-loongson-liointc.c
index aed88857d90f..927e236bf18e 100644
--- a/drivers/irqchip/irq-loongson-liointc.c
+++ b/drivers/irqchip/irq-loongson-liointc.c
@@ -57,7 +57,11 @@ static void liointc_chained_handle_irq(struct irq_desc *desc)
 	struct liointc_handler_data *handler = irq_desc_get_handler_data(desc);
 	struct irq_chip *chip = irq_desc_get_chip(desc);
 	struct irq_chip_generic *gc = handler->priv->gc;
+#ifdef CONFIG_SMP
 	int core = cpu_logical_map(smp_processor_id()) % LIOINTC_NUM_CORES;
+#else
+	int core = 0;
+#endif
 	u32 pending;
 
 	chained_irq_enter(chip, desc);
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ