From patchwork Tue Jun 25 12:08:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: liangxi Liu X-Patchwork-Id: 13710964 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18E42C2BBCA for ; Tue, 25 Jun 2024 12:09:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8CBBE6B02F1; Tue, 25 Jun 2024 08:09:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 87B7E6B02F3; Tue, 25 Jun 2024 08:09:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 71BF76B02F5; Tue, 25 Jun 2024 08:09:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 4E6546B02F1 for ; Tue, 25 Jun 2024 08:09:10 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 053A0A2EF2 for ; Tue, 25 Jun 2024 12:09:10 +0000 (UTC) X-FDA: 82269290460.20.78AD907 Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) by imf14.hostedemail.com (Postfix) with ESMTP id 4119710000C for ; Tue, 25 Jun 2024 12:09:07 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=KlXEWMLE; spf=pass (imf14.hostedemail.com: domain of lgs156412@gmail.com designates 209.85.208.177 as permitted sender) smtp.mailfrom=lgs156412@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719317337; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=WYzS4EBHhS7vO35ycW7A0EBe9omb3PKh3Y0hm6C42W0=; b=lixzZ1gYd7FwFAkDx0yrYCyLJRMIIzCtd6lO3VRRRcCgDiQhZEz5plTJvQENYCrW+AOajC OMi1Qr+odXlthjK4IX9NZ3CNYStOOGhTJb/IzDaImzIxTQAEbYOPfchhD9bWbK5qOsXDsL KvJpxZo90dOD2AkH3m8uuO8+FhRI5KQ= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=KlXEWMLE; spf=pass (imf14.hostedemail.com: domain of lgs156412@gmail.com designates 209.85.208.177 as permitted sender) smtp.mailfrom=lgs156412@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719317337; a=rsa-sha256; cv=none; b=Mz/MWxSjbRJzkYDGFZ3cpQEYPIJOCLpezZ6uBnCYhxaZdyrmN4toAQ5v+Uzpkvs3nJEQpv +vtU+8ItHwhjCIvipTo1i7lTne54bj5M9hLJ6kaNaNhaDI5a+37v8sorTVmNUNDc/4DDmN rpcwZA2sGnZA4d5atUr0OWURcFz3x4Q= Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2ebe6495aedso57600641fa.0 for ; Tue, 25 Jun 2024 05:09:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719317346; x=1719922146; darn=kvack.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=WYzS4EBHhS7vO35ycW7A0EBe9omb3PKh3Y0hm6C42W0=; b=KlXEWMLE8QCaYzyA/+rsMmkEbpBsZrTr5blh+6qsPXc2QkBuVPGg3EQN9Cb/RoLoFj Eu1J4OO2tDyj21HaRphFsperJg1JLJuuq8k9ad5ZRN/yfib2HkcZI3Rk6RHmGVRmz+8A 07Wr97x4WwB8+8awcWXmcDX0jgsSi1POo2RNLQh7VWyDB2+ZUARVTAY5kwSQyEgWBW5X F3+9RStvG2aRCaAHhkhNZUmB75DxoFwx0o6isz2ebBqfcZB4TmP5CJPk9FGaLP79lOX8 OIRofiBQKYNIwzJXc8dc/zJNNp+xG5+WYbdf+OJ0L70UgTKijNeeIBDozPs0gj7JWcFN HBVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719317346; x=1719922146; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=WYzS4EBHhS7vO35ycW7A0EBe9omb3PKh3Y0hm6C42W0=; b=KFn1fd1oQtn6Pb47w9tO6jG5J9yvlWJ99HIClzrJq/onX6AaDVEAMEe5TD5u3acH3a Ue9u9YvUUgoft+lYacv3I4f9tQXnFDcKUq5G/8O9uhMiDi3wM7YTiRN/WmqPQSshWpfj GMR9t42NBPwc7mZRbnwrc8dAZVptWERg9Dmgc2bKl/N7JDb1H2VSXOGTyu7nbmGRnQoT RKX+P+Fdw8Hve9fbc2HzXXQk5VHYePOYZPN1E/nQJ9Z235w+DIUal57o6kzP4cApkcSi +HfOhgbam30lfsmh7tiak/S1WmIPmg915kcWKFH1Sh/gPN65YJYhUfveppVe4VwlGUSz b8kQ== X-Gm-Message-State: AOJu0YwzJCrQZpR02eQQM+SAVm1nXx7En3wYzPvCzeE7Exp3hWSawbTR S1+K9aPYulSBajWrULspWhU8BjQWEKTSKXaIH4J1qeatOwr6lZzNq3V4Oqy+LcvN77usNhmmVTQ 7TpslrkmtEVQzZqdv9x6L5oQiX10YlQ== X-Google-Smtp-Source: AGHT+IHPI+QTIBunutTji/UVC7YcqyvlXo4igeMO6xwPFdg1O7lt+G0bXlfr6dVt1G33Reww0QcJlfteIdD1P5NInSI= X-Received: by 2002:a19:435b:0:b0:52c:df8a:df4 with SMTP id 2adb3069b0e04-52ce1865a2emr3903576e87.69.1719317345703; Tue, 25 Jun 2024 05:09:05 -0700 (PDT) MIME-Version: 1.0 References: <20240625115825.1163653-1-lgs156412@gmail.com> In-Reply-To: <20240625115825.1163653-1-lgs156412@gmail.com> From: liangxi Liu Date: Tue, 25 Jun 2024 20:08:51 +0800 Message-ID: Subject: Fwd: [PATCH v2] memblock: export memblock_free() to free reserved memory. To: linux-mm@kvack.org, linux-kernel@vger.kernel.org X-Stat-Signature: cwddn4kwdaxjnmnzsxyijw3uh1eq6nzp X-Rspam-User: X-Rspamd-Queue-Id: 4119710000C X-Rspamd-Server: rspam02 X-HE-Tag: 1719317347-711496 X-HE-Meta: U2FsdGVkX192juhBpqQiOduQADtFHXWCU8UP8ca5wy9EIdDAqRH3s2ktn/rGehrQ9QnJQLoHQB1eBdayi5Lj2pr0y4ipgvPgsi0IsEs83tJsEh0sPJYhVfCU4E/0x454TgTh2r1sSVA3h054hQ6wpQFQ2HOy7sRlp61ryLLlE+X+3f7JMC7zVegmoz7IzYfJzOgWhAkp7vXzCwdUASwqcsxXWuOYEIjLcYsZGmMDo7hWfrsrgN1BbyPRc8/PfSgpVxGPrwh1tpJ84h3q1mG81hMxUSJjBd3Sz4RJY9MrACRXeDnKp+dxR+94yG2T+Z4L7xjDy6dUWqvS9sJFkRbcoiOUtnno1WZ2LuO9TYCjea8NOgBFZa8YNyFC4Rd8+16o4VThopstmR4srZRHfBAcH0JQEkV0NYtRNO9ZzVeM6HDNXpJ68dxNadXuKNFV/SpC94OqGTbnc3y1c+K3+K04M6huMbxg/caTLrLnpqwng5IhUi+GG5EczlQqw6ZHZAE16+F/pLsc0IErvdEB2FXHaeWAE1ag/o3CWLmeHROF6SxQy26pa/E5DzXw1m4pttlmdwfOp8CVqX2IZ3DXjMv2vcx9/T4xjkzx2EdjQbwd9yvHv7zf5YGUBs18YmLrGbVmufRsNL2s907yvLkI6LPc3NhtXbmiiI/qMQk3pEVP+uUtMXXJ44iFkxzBSJBiIMg1gcwLd2611FBHOQf5D6PVBOp7YUTazqy6h/ZcrIbggXfF9mkJFHIlkDgLttce5S06k2bkhoy2hHHzEZHqpGYpBGzja+6QoGR9iIWE89Bl2GGCQWcNoNFeWEfx+yd6LVyxsRz0oE+JpvbgGUbY3ADovtVyBQCZLNJ9xCL9tX/vY3Qxm3epKbcrrlqwTbXdaWtWrq+VeB/Zs1DRffBO2jiWzlwlkUreTUscG5Gv5inXojJiapfv+FcWBj+nCIzNobrnfdxvG7InMH3m8ksznUN mO9/yiMh qb4lJfK77/k/nb6h2L1efyo1vo2eyC3mz1y6Z1a02epTdEwDQzr4rxQk1av3daVe5Rz7wTYBXP+lFqDYbpo6MMzJuEKEPNTbGii85MZ+1LLJVO2zuSExWVgI9kiZgOuUWU/HTBOh90ccXT/yB/uH6SpVcCUMdRrdsoBObV67ZYhklIU7l7b3FYqE0I4fetUnnAADwP9HKgKCBQass5ufTM93WF/f7ELH2tryBrooatRjYMBvutYk1xtC2q0IOyAbMwJ+S+eUKJHHKPugB8jUdQRlO5rSe9g0ZEECa577C1ak89Y7dEV+gsBfKz+R2YRZRn9NxbhxXm/vcRFqBA4UVZqGA6vZE6WH8qYY91E2hxv7K36be4439rBgbEbxEUiqf8JKmjPcPhe3MPs3OMJoSh3WkL3CRWrAHtU1Kaplmxt2mEZ+MT4YFObz3pli6fyBbrh0yHcYSlcqkrEoY+/LMeVkumHsR0y25LbNxrkjGd1Vr6OkeLvLDw1q8fQR/deAkX22zh4entEiY6JIkpgo8P84+B21rssuesZxUw0JCWVVvKH/wB4RAqiMttynmq/kSTa9I7TWYzFnxQck= 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: List-Subscribe: List-Unsubscribe: ---------- Forwarded message --------- From: Guanshun Liu Date: Tue, Jun 25, 2024 at 7:58 PM Subject: [PATCH v2] memblock: export memblock_free() to free reserved memory. To: Cc: , Guanshun Liu On architectures that support the preservation of memblock metadata after __init, allow drivers to call memblock_free() to free a reservation configured in dts. This is a hack to support the freeing of bootsplash reservations passed to Linux by the bootloader. Signed-off-by: Guanshun Liu --- mm/memblock.c | 3 +++ 1 file changed, 3 insertions(+) * memblock_phys_free - free boot memory block diff --git a/mm/memblock.c b/mm/memblock.c index 6d18485571b4..20e7f81fc076 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -848,6 +848,9 @@ void __init_memblock memblock_free(void *ptr, size_t size) if (ptr) memblock_phys_free(__pa(ptr), size); } +#ifdef CONFIG_ARCH_KEEP_MEMBLOCK +EXPORT_SYMBOL_GPL(memblock_free); +#endif /**