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]
Message-ID: <aa72bcfb-b366-f373-60c5-99404109c482@gmail.com>
Date:   Thu, 16 Mar 2023 11:13:45 -0700
From:   Florian Fainelli <f.fainelli@...il.com>
To:     Álvaro Fernández Rojas <noltari@...il.com>,
        f.fainelli@...il.com, jonas.gorski@...il.com,
        bcm-kernel-feedback-list@...adcom.com, tglx@...utronix.de,
        maz@...nel.org, linux-mips@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] irqchip/bcm-6345-l1: show MMIO address

On 3/16/23 11:07, Álvaro Fernández Rojas wrote:
> It's safe to show MMIO address.
> 
> Signed-off-by: Álvaro Fernández Rojas <noltari@...il.com>

This is going to be the kernel virtual address, and while on MIPS it is 
easy to resolve to the physical address because these platforms map 
registers through KSEG0/1, on other platforms like ARM/ARM64 the kernel 
virtual addresses are pretty meaningless unless what you want to debug 
is how ioremap() mapped the address.

I would rather do the following change:

diff --git a/drivers/irqchip/irq-bcm6345-l1.c 
b/drivers/irqchip/irq-bcm6345-l1.c
index 1bd0621c4ce2..832957d363a4 100644
--- a/drivers/irqchip/irq-bcm6345-l1.c
+++ b/drivers/irqchip/irq-bcm6345-l1.c
@@ -261,6 +261,8 @@ static int __init bcm6345_l1_init_one(struct 
device_node *dn,
         if (!cpu->map_base)
                 return -ENOMEM;

+       request_mem_region(res.start, sz, res.name);
+
         for (i = 0; i < n_words; i++) {
                 cpu->enable_cache[i] = 0;
                 __raw_writel(0, cpu->map_base + reg_enable(intc, i));

such that this shows up in /proc/iomem. WDYT?

> ---
>   drivers/irqchip/irq-bcm6345-l1.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/irqchip/irq-bcm6345-l1.c b/drivers/irqchip/irq-bcm6345-l1.c
> index 6899e37810a8..55a2d9b31597 100644
> --- a/drivers/irqchip/irq-bcm6345-l1.c
> +++ b/drivers/irqchip/irq-bcm6345-l1.c
> @@ -335,7 +335,7 @@ static int __init bcm6345_l1_of_init(struct device_node *dn,
>   	for_each_cpu(idx, &intc->cpumask) {
>   		struct bcm6345_l1_cpu *cpu = intc->cpus[idx];
>   
> -		pr_info("  CPU%u at MMIO 0x%p (irq = %d)\n", idx,
> +		pr_info("  CPU%u at MMIO 0x%px (irq = %d)\n", idx,
>   				cpu->map_base, cpu->parent_irq);
>   	}
>   

-- 
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ