[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YUzZberbgZE+7HEo@linux.ibm.com>
Date: Thu, 23 Sep 2021 22:45:49 +0300
From: Mike Rapoport <rppt@...ux.ibm.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Mike Rapoport <rppt@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
devicetree <devicetree@...r.kernel.org>,
iommu <iommu@...ts.linux-foundation.org>,
kasan-dev <kasan-dev@...glegroups.com>,
KVM list <kvm@...r.kernel.org>,
alpha <linux-alpha@...r.kernel.org>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
linux-efi <linux-efi@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"open list:BROADCOM NVRAM DRIVER" <linux-mips@...r.kernel.org>,
Linux-MM <linux-mm@...ck.org>,
linux-riscv <linux-riscv@...ts.infradead.org>,
linux-s390 <linux-s390@...r.kernel.org>,
Linux-sh list <linux-sh@...r.kernel.org>,
"open list:SYNOPSYS ARC ARCHITECTURE"
<linux-snps-arc@...ts.infradead.org>,
linux-um <linux-um@...ts.infradead.org>,
linux-usb@...r.kernel.org,
linuxppc-dev <linuxppc-dev@...ts.ozlabs.org>,
linux-sparc <sparclinux@...r.kernel.org>,
xen-devel@...ts.xenproject.org
Subject: Re: [PATCH 0/3] memblock: cleanup memblock_free interface
Hi Linus,
On Thu, Sep 23, 2021 at 09:01:46AM -0700, Linus Torvalds wrote:
> On Thu, Sep 23, 2021 at 12:43 AM Mike Rapoport <rppt@...nel.org> wrote:
> >
> You need to be a LOT more careful.
>
> From a trivial check - exactly because I looked at doing it with a
> script, and decided it's not so easy - I found cases like this:
>
> - memblock_free(__pa(paca_ptrs) + new_ptrs_size,
> + memblock_free(paca_ptrs + new_ptrs_size,
>
> which is COMPLETELY wrong.
I did use a coccinelle script that's slightly more robust that a sed you've
sent, but then I did a manual review, hence the two small patches with
fixes. Indeed I missed this one, so to be on the safe side I'll rename only
the obvious cases where coccinelle can be used reliably and leave all the
rest as it's now. If somebody cares enough they can update it later.
> And no, making the scripting just replace '__pa(x)' with '(void *)(x)'
These were actually manual and they are required for variables that
used as virtual addresses but have unsigned long type, like e.g.
initrd_start. So it's either __pa(x) or (void *).
--
Sincerely yours,
Mike.
Powered by blists - more mailing lists