From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9867C433F5 for ; Thu, 23 Sep 2021 19:46:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4413E61241 for ; Thu, 23 Sep 2021 19:46:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4413E61241 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 76694900002; Thu, 23 Sep 2021 15:46:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7158F6B0071; Thu, 23 Sep 2021 15:46:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6044F900002; Thu, 23 Sep 2021 15:46:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0232.hostedemail.com [216.40.44.232]) by kanga.kvack.org (Postfix) with ESMTP id 4D4396B006C for ; Thu, 23 Sep 2021 15:46:03 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 13856180300FB for ; Thu, 23 Sep 2021 19:46:03 +0000 (UTC) X-FDA: 78619869006.26.5603D34 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf24.hostedemail.com (Postfix) with ESMTP id 8C5D8B0000A4 for ; Thu, 23 Sep 2021 19:46:02 +0000 (UTC) Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 18NJW36f031236; Thu, 23 Sep 2021 15:45:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=pp1; bh=OlfxwL5SxCQJGsEygNnP+Bd9S5CycoibyIwI1T9qbFQ=; b=o2g9xUdg4iWokOSpifGukNkZK7jrG3PCnBFvuz4C7oP+gzjHDglARWvYTHBDYKWgrmUN nywTanPgUpTOTd5/xMfhi1L+mJwrCvVoKxej3UCLp5sG7C25GVynwAmr4q0nxjw5T5YF XfSS+haqO/MAAWW7EoLHEph+pIjpH8koxcOuzA2lkqyOwZ+Lt0jX5schDBGsmjxT7nCn nj0KpCKZ1MAIxT1dHKe+ArroeI/VY7R10b19vbUGLmbRaxdWWrC+tHtvcRU2gpGyiZee fQz965XLLMlLTgvc9SCxBhiIocufoeoMuCL9s+OrHLUbKOqWsHzC5EoSrMfU3XKh1xK9 Bg== Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 3b8wkuupat-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Sep 2021 15:45:58 -0400 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 18NJRuDe003688; Thu, 23 Sep 2021 19:45:56 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma03fra.de.ibm.com with ESMTP id 3b7q6kd587-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Sep 2021 19:45:56 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 18NJjrxv44106172 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 Sep 2021 19:45:53 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A19734C04A; Thu, 23 Sep 2021 19:45:53 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 903DC4C05A; Thu, 23 Sep 2021 19:45:51 +0000 (GMT) Received: from linux.ibm.com (unknown [9.145.159.121]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Thu, 23 Sep 2021 19:45:51 +0000 (GMT) Date: Thu, 23 Sep 2021 22:45:49 +0300 From: Mike Rapoport To: Linus Torvalds Cc: Mike Rapoport , Andrew Morton , devicetree , iommu , kasan-dev , KVM list , alpha , Linux ARM , linux-efi , Linux Kernel Mailing List , "open list:BROADCOM NVRAM DRIVER" , Linux-MM , linux-riscv , linux-s390 , Linux-sh list , "open list:SYNOPSYS ARC ARCHITECTURE" , linux-um , linux-usb@vger.kernel.org, linuxppc-dev , linux-sparc , xen-devel@lists.xenproject.org Subject: Re: [PATCH 0/3] memblock: cleanup memblock_free interface Message-ID: References: <20210923074335.12583-1-rppt@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-TM-AS-GCONF: 00 X-Proofpoint-GUID: NmcKtlYbna1qS7iyZ4wr-YnA7UP6mwwQ X-Proofpoint-ORIG-GUID: NmcKtlYbna1qS7iyZ4wr-YnA7UP6mwwQ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-09-23_06,2021-09-23_01,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 mlxscore=0 malwarescore=0 spamscore=0 priorityscore=1501 bulkscore=0 clxscore=1015 suspectscore=0 mlxlogscore=691 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109200000 definitions=main-2109230115 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 8C5D8B0000A4 X-Stat-Signature: 4egm971uqg1its8hcihdtwfzw9n6751o Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=o2g9xUdg; spf=pass (imf24.hostedemail.com: domain of rppt@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=rppt@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com X-HE-Tag: 1632426362-803323 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 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.