Received: by 10.213.65.68 with SMTP id h4csp1527947imn; Sun, 1 Apr 2018 08:03:35 -0700 (PDT) X-Google-Smtp-Source: AIpwx48aPgP4te/nOFgYo9JgtANMYSY0/es3KK/B/iiuSqcRP6y2YVQ6/VyVOqHekoBPLB1wUtgN X-Received: by 2002:a17:902:8482:: with SMTP id c2-v6mr6679540plo.295.1522595015383; Sun, 01 Apr 2018 08:03:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522595015; cv=none; d=google.com; s=arc-20160816; b=QE5dRutkNSVwlYKvYG2AhMhxeGhLs8wOWGFjCaq4WF/6EIca5Y3iIyC1DPI8ZgRa0g SIH79Fzmcyuz0JlFPUk+cjsJg9RToj3Lp2FP5/y7aEKAE2tKmfVbMGd5WovOVnH/Xkl8 hZnj6qqPODRtNc6WPwG6Y7Et1MjhrsoYqwY6DVvaBI33O2XN8HanFvfm49+ejt/8cyGv uGuUwatWHoe8rqP/kv3TT37T1yeriLtewSva3edpgaeQoDXSyt8pXkL4ZCWEu5+oMhRL Js7zZ1tO/R2DR3Qsvlyyo6uegcFgipd2Esp3w5bxcbOp8y1V10xchhGzgxtGxiBU9Bja N+jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=YdupbauBo6UITYV0eaOXsyZZdc4R0WNzPrpNYuGfOUo=; b=RWC2cJsmSeAkgSWLwmIbzZuikKNzddaHo1Q3er7ZmUIxjlNcLQtE2dXdPD8W5bRwxT bl+skdi+xPlLohbiDuLybO130f8usIUD4SWT3+rPLIWi03u2IFXfwj27QKMPiXbApkp0 Rdc/I4s2O1RNZ+g9DeE6NvMSDcAKGsUcVtoG4B5wwhbROQDfpYX5B4njWGhRR8uz8O2n bM8NwheGo55VyA4deE3SGvPfE8iwfABOhtohw5qDiM5tvOelkiaiN2Z1phKXbIEXc1Gb ojlzwxRJHZrSci9F3+91RNiI8vpeR062tprqVyZm9AMU8p60A0pQSuiopDcnD5Bhd18a ZCXQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v8-v6si8278474plg.68.2018.04.01.08.02.57; Sun, 01 Apr 2018 08:03:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753570AbeDAPAJ (ORCPT + 99 others); Sun, 1 Apr 2018 11:00:09 -0400 Received: from smtprelay0036.hostedemail.com ([216.40.44.36]:54936 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753519AbeDAPAI (ORCPT ); Sun, 1 Apr 2018 11:00:08 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay06.hostedemail.com (Postfix) with ESMTP id 09FF1180115A7; Sun, 1 Apr 2018 15:00:07 +0000 (UTC) X-Session-Marker: 7368656140736865616C6576792E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,,:::::,RULES_HIT:41:355:379:541:800:960:965:966:973:988:989:1260:1345:1359:1437:1534:1541:1711:1730:1747:1777:1792:1978:1981:2194:2196:2199:2200:2393:2559:2562:2892:3138:3139:3140:3141:3142:3352:3865:3866:3867:3868:3870:3871:3872:3874:4321:4385:4390:4395:4605:5007:6261:10004:10848:11026:11473:11658:11914:12555:12895:13069:13149:13161:13229:13230:13311:13357:14096:14181:14384:14394:14721:21080:21433:21451:21627:30012:30054:30056:30075,0,RBL:71.235.10.46:@shealevy.com:.lbl8.mailshell.net-62.14.0.191 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:20,LUA_SUMMARY:none X-HE-Tag: match19_7561532018e08 X-Filterd-Recvd-Size: 1981 Received: from localhost (c-71-235-10-46.hsd1.nh.comcast.net [71.235.10.46]) (Authenticated sender: shea@shealevy.com) by omf12.hostedemail.com (Postfix) with ESMTPA; Sun, 1 Apr 2018 15:00:06 +0000 (UTC) From: Shea Levy To: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Shea Levy Subject: [PATCH v6 01/16] initrd: Add weakly-linked generic free_initrd_mem. Date: Sun, 1 Apr 2018 10:59:15 -0400 Message-Id: <20180401145931.7932-1-shea@shealevy.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180329113207.30674-1-shea@shealevy.com> References: <20180329113207.30674-1-shea@shealevy.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This function is effectively identical across 14 architectures, and the generic implementation is small enough to be negligible in the architectures that do override it. Many of the remaining divergent implementations can be included in the common code path in future, further reducing code duplication and sharing improvements between architectures. Series boot-tested on RISC-V (which now uses the generic implementation) and x86_64 (which doesn't). v6: Add information about build/run testing. v5: Add more complete commit messages. v4: Use weak symbols instead of Kconfig. v3: Make the generic path opt-out instead of opt-in. v2: Mark generic free_initrd_mem __init. Signed-off-by: Shea Levy --- init/initramfs.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/init/initramfs.c b/init/initramfs.c index 7e99a0038942..c8fe150f958a 100644 --- a/init/initramfs.c +++ b/init/initramfs.c @@ -526,6 +526,11 @@ extern unsigned long __initramfs_size; #include #include +void __init __weak free_initrd_mem(unsigned long start, unsigned long end) +{ + free_reserved_area((void *)start, (void *)end, -1, "initrd"); +} + static void __init free_initrd(void) { #ifdef CONFIG_KEXEC_CORE -- 2.16.2