From patchwork Wed Aug 1 07:58:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 10551799 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 18928157D for ; Wed, 1 Aug 2018 08:00:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0941E2AD09 for ; Wed, 1 Aug 2018 08:00:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 06AD82AF7F; Wed, 1 Aug 2018 08:00:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9B24B2AD09 for ; Wed, 1 Aug 2018 08:00:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=mEtGbVoMWV1+bu9Py2rcDkJZFmkSK8u6sKgkiDga6E4=; b=VC2r5ISc3KzTdPB5PC0c1R3QIW yEW+FLvx1XiWqHQUwjiPPDrvI4F5uAS2hPAqcWlRUWcxeCAVKpJYAtOi9Fg/qWGpeSdcpa9qVzRMK MEcURo+QwnB9xF2TmxLyt4252KcnAZMY7EZ9DcsQJoidFW6COrWrA6N/kDIPioVN34HBfzf6V8qGc NwXOSH2C7UqVNbmesaU4KklU+RDt985EQe/DGBv/MP7fgKy7wA++4DNzGVCcsO+zAKlHmLGdEoexn emWl4hIkzoqUmd5Q1QEZxtkdNU/ow571dWMb3BhNNWy6VP8NyvZ8hI0z7qaaFnD8wk3zBPDmiJnYu Bhfhf9Fg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fkm3V-0003js-2L; Wed, 01 Aug 2018 08:00:25 +0000 Received: from mail-pl0-x244.google.com ([2607:f8b0:400e:c01::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fkm35-0002pj-Pe for linux-arm-kernel@lists.infradead.org; Wed, 01 Aug 2018 08:00:04 +0000 Received: by mail-pl0-x244.google.com with SMTP id u11-v6so2870727plq.5 for ; Wed, 01 Aug 2018 00:59:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=68DGwEYhPm491eIfZZ6KO/KX2jzukwPpQsbkiYBWDXE=; b=Opukkf/0wWc9eGzUj6XgdTjU9cGErNSQjnL4XLZtEr66NATP3fC2Nd55/otDP6Jk41 LZYQnjeYFyqlGr+gcK9uAD+nWrfUWaoyoBG42/6bIST40Q2+NTrTDWXGA5plcmH2UbSn S+FFm5HCGuPvK9E1HKml56RfSWFQfIsB8b4Ig= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=68DGwEYhPm491eIfZZ6KO/KX2jzukwPpQsbkiYBWDXE=; b=DZ3mqWsGzLbicz2nfUQCYndylCYgFvYcYxoqTm3I0XdHm0YC/jJsRvHNLDYM7thpL/ EnhU4pWTiF5BM1w81267GiecxSqnnzrLWs2Lh/7KBvceO923xhzWskPBWW28Algjvu9p 1S7R7cB/iJL8S7r8Vp0gqWN9qCM5RJ7WQCz2B8ISKrdnUyCDQ2nHeLTiPgWXpQCoZqPc Iew1lBDAtSU+4sDL7nh7dGK9EepsMvMegHQpfRzsgWGNV9I7cGLDAmumq/sIlRtx32TQ XNZn/xbuac+EPTf+aTLso9pRbgzVRV+vdcg9AiYWyhOmag0eOJNMKBW5RsGEG9z0SRYU myNw== X-Gm-Message-State: AOUpUlELE3mS3t8w4nX9JUKN0xUbH5PlZEfVMwrMaMnNVBSqc22/tzKX qWAm3eq80yiqkIvUdb7PmuVnJw== X-Google-Smtp-Source: AAOMgpdHPnj3RppprbBSdZD1PUdyE6SMEmtZqbIlnESpFoIpLWJHfhTqjnjA48bVu0wNn9dNzzrPvw== X-Received: by 2002:a17:902:778e:: with SMTP id o14-v6mr15537568pll.198.1533110389383; Wed, 01 Aug 2018 00:59:49 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id g7-v6sm21547776pfi.175.2018.08.01.00.59.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Aug 2018 00:59:48 -0700 (PDT) From: AKASHI Takahiro To: catalin.marinas@arm.com, will.deacon@arm.com, dhowells@redhat.com, vgoyal@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, dyoung@redhat.com, bhe@redhat.com, arnd@arndb.de, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com Subject: [PATCH v13 03/16] s390, kexec_file: drop arch_kexec_mem_walk() Date: Wed, 1 Aug 2018 16:58:07 +0900 Message-Id: <20180801075820.3753-4-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180801075820.3753-1-takahiro.akashi@linaro.org> References: <20180801075820.3753-1-takahiro.akashi@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180801_010000_214438_70E66125 X-CRM114-Status: GOOD ( 13.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ard.biesheuvel@linaro.org, bhsharma@redhat.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, prudo@linux.ibm.com, AKASHI Takahiro , james.morse@arm.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Since s390 already knows where to locate buffers, calling arch_kexec_mem_walk() has no sense. So we can just drop it as kbuf->mem indicates this while all other architectures sets it to 0 initially. This change is a preparatory work for the next patch, where all the variant memory walks, either on system resource or memblock, will be put in one common place so that it will satisfy all the architectures' need. Signed-off-by: AKASHI Takahiro Reviewed-by: Philipp Rudo Cc: Martin Schwidefsky Cc: Heiko Carstens Cc: Dave Young Cc: Vivek Goyal Cc: Baoquan He --- arch/s390/kernel/machine_kexec_file.c | 10 ---------- kernel/kexec_file.c | 4 ++++ 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/arch/s390/kernel/machine_kexec_file.c b/arch/s390/kernel/machine_kexec_file.c index f413f57f8d20..32023b4f9dc0 100644 --- a/arch/s390/kernel/machine_kexec_file.c +++ b/arch/s390/kernel/machine_kexec_file.c @@ -134,16 +134,6 @@ int kexec_file_add_initrd(struct kimage *image, struct s390_load_data *data, return ret; } -/* - * The kernel is loaded to a fixed location. Turn off kexec_locate_mem_hole - * and provide kbuf->mem by hand. - */ -int arch_kexec_walk_mem(struct kexec_buf *kbuf, - int (*func)(struct resource *, void *)) -{ - return 1; -} - int arch_kexec_apply_relocations_add(struct purgatory_info *pi, Elf_Shdr *section, const Elf_Shdr *relsec, diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c index 63c7ce1c0c3e..bf39df5e5bb9 100644 --- a/kernel/kexec_file.c +++ b/kernel/kexec_file.c @@ -534,6 +534,10 @@ int kexec_locate_mem_hole(struct kexec_buf *kbuf) { int ret; + /* Arch knows where to place */ + if (kbuf->mem) + return 0; + ret = arch_kexec_walk_mem(kbuf, locate_mem_hole_callback); return ret == 1 ? 0 : -EADDRNOTAVAIL;