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:   Thu, 16 Mar 2023 12:10:28 -0700
From:   Florian Fainelli <f.fainelli@...il.com>
To:     Álvaro Fernández Rojas <noltari@...il.com>,
        Florian Fainelli <f.fainelli@...il.com>
Cc:     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 12:04, Álvaro Fernández Rojas wrote:
> El jue, 16 mar 2023 a las 19:13, Florian Fainelli
> (<f.fainelli@...il.com>) escribió:
>>
>> 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?
> 
> I tried doing it that way, but it still shows (ptrval):
> [    0.000000] irq_bcm6345_l1: registered BCM6345 L1 intc (IRQs: 32)
> [    0.000000] irq_bcm6345_l1:   CPU0 at MMIO 0x(ptrval) (irq = 2)

Well yes, if you don't remove the pr_info() you are still going to be 
printing it, and because map_base is the return of ioremap() which is a 
kernel virtual address, it is still hashed, also see Marc's message that 
came in. I guess I should have been way more explicit and also provide a 
tentative patch that also took out the pr_info().

> 
> I checked /proc/iomem and it's shown:
> root@...nWrt:/# cat /proc/iomem
> 00000000-03ffffff : System RAM
>    00010000-0068e96f : Kernel code
>    0068e970-008834ff : Kernel data
>    01610000-016458e7 : Kernel bss
> 08000000-0800ffff : BCM6348 PCI IO space
> 1e000000-1fffffff : 1e000000.nor nor@...00000
> 30000000-37ffffff : pci@...e1000
>    30000000-3000ffff : 0000:00:01.0
>      30000000-3000ffff : ath9k
> fffe0004-fffe0007 : fffe0004.clock-controller clock-controller@...e0004
> fffe000c-fffe0013 : interrupt-controller@...e000c
> fffe0034-fffe0037 : fffe0034.reset-controller reset-controller@...e0034
> fffe005c-fffe0067 : fffe005c.watchdog watchdog@...e005c
> fffe0100-fffe0117 : fffe0100.serial serial@...e0100
> fffe1000-fffe11ff : fffe1000.pci pci
> fffe1300-fffe13ff : fffe1300.usb usb@...e1300
> fffe1400-fffe14ff : fffe1400.usb usb@...e1400
> fffe1500-fffe1537 : fffe1500.usb-phy usb-phy@...e1500
> 
> Any idea why this could be hapenning?

We now have the desired resource listed using its physical address:

fffe000c-fffe0013 : interrupt-controller@...e000c

There could be a variety of improvements to how request_mem_region() is 
called if you want to provide a break down of each resource on a per-CPU 
basis.
-- 
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ