Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp1051826rdb; Fri, 19 Jan 2024 06:55:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IFjUUd+AIJO0aoWLuRW0Y59i+0KoAzxM82vs4vyh1Xg+ui+Lsk+/rs/6Qq26RpvjV1WNrYW X-Received: by 2002:a05:6870:5693:b0:210:a37b:c32c with SMTP id p19-20020a056870569300b00210a37bc32cmr2838702oao.110.1705676133432; Fri, 19 Jan 2024 06:55:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705676133; cv=pass; d=google.com; s=arc-20160816; b=jEaZnz7ida+KgZ2CN2sjRuGjbM43ddwp61gAgqNYkGSrbc4gpxIASKPyusLpblErvi JpRP8if76ffQTdxTZ7GRsjqV7H4JvNNikpbNW1FMyYeMtXoFRvFtd2gQQG2nr/2bT6vP Rh5ldr5XrLiLts+ZrtLDqRW4JJ+1YktXEwxv2hDfcDQIRwG7+D/wN5lzDZrf0qyajk9O sZLmkSWTSLbzwV9wCJIsnQnkaR9hoARpbW9x76K44yjLOFoXBEscHMN3bSm10RlgGJWj ZzLm84bNyZwVjKgeV9lK7wkXO0D/JkPku2YLflJ0WVqhs1YJu/9ySm+yeAmAiPUTTG/1 j/ug== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=1ELQbTPNyx4L6Rjica+79k486cYCM/jEDd+jz77hDLU=; fh=zRw2lYWZmEZ+xk8Dyhrd0rqHIpogjnUXaVblO2ikfrI=; b=ZkIP2rer/QAk+qp9iF0ekZ9uXwJaJ7llQUmSv2ALPZFkG457FXXElfmz8DNc6ehBj8 mWLnNCsdWU68QyMVSBuMo/5nQP7Isk2nGKS1DiyIRg7B2h8PEZacafLuSUAuBtcS8dcE xbrdu4bp2vKtZTQuqz9oGiW1OF9Dtj7BADrNgNAqa6RJLZuSLMlo+8QRCLNVhJWDv1oe 85CbYKpmLjRGH1TfCqtG8v1bKRKbwqsHMeGAEKEDZc7oyjMXxezhaSpIOtY67bqqh/cV LPss9hPsJyh5Qy3L/QggtQje5wMx3JOEceDbUUcUl/UGo8Ja0z/m8epj701cC2VABHKC Wiww== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YvOlIrFk; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-31285-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31285-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x64-20020a636343000000b005cec867ecf0si3487924pgb.105.2024.01.19.06.55.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 06:55:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-31285-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YvOlIrFk; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-31285-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31285-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 124AA2851FD for ; Fri, 19 Jan 2024 14:55:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3E10254750; Fri, 19 Jan 2024 14:54:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="YvOlIrFk" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 102B054BEA for ; Fri, 19 Jan 2024 14:54:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705676048; cv=none; b=rlplJ52LfS0losxJecbbm/C98IzPgLGv297hVJskLlJa0+S+DOLmH7tXyR/59o3NV4xzv8CWa0sJPKi/m0oifGgfv/WRJM84H41QXxtXTRyGc//hZAPKVvv5DaeaVK+Xhd1dveZWYeBAMxKWM40kbkehB0JmaQGAmrBTaoRuFOU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705676048; c=relaxed/simple; bh=4OLku53QZ0JcIhWOC5lpSpfsCOe7WyE8PhE4np3c32c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-type; b=paNZ9qHLx7MM3RPKX2dJ82x8rHk4xRfSmQ1nxJzDv6GUgINAS+4CG7748e/dZO3uWIr6+691aCYWM+qkfrzDKHkIZl0t5cujp9TsVInCvMg0hS8VzS4NGRjI/8guB5225wW8psZhztODUwxOXGdU+8INuz9iw5owmsjQY6CAtCQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=YvOlIrFk; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1705676046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1ELQbTPNyx4L6Rjica+79k486cYCM/jEDd+jz77hDLU=; b=YvOlIrFkdSTtHZCGEKy3VyNVdXo2A1KB09b6G3y4XyOyeRUf8WMtiA6+whK28MXYXZQn59 57ZGIey+/v7hTO8amXq0B/ujfJzUyUx54GyoQJ6Z037qiKwYDMF/OVEWx3fDBGAukM/y0X cqVl53gHRkMg3tG1FnSJDOw098yNuik= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-422-KYkDc-tBOHakDPqfCoeT5g-1; Fri, 19 Jan 2024 09:54:03 -0500 X-MC-Unique: KYkDc-tBOHakDPqfCoeT5g-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9B53284FA80; Fri, 19 Jan 2024 14:54:02 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (unknown [10.72.116.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 77D8C5012; Fri, 19 Jan 2024 14:53:55 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: kexec@lists.infradead.org, x86@kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org, loongarch@lists.linux.dev, akpm@linux-foundation.org, ebiederm@xmission.com, hbathini@linux.ibm.com, piliu@redhat.com, viro@zeniv.linux.org.uk, Baoquan He Subject: [PATCH v2 09/14] s390, crash: wrap crash dumping code into crash related ifdefs Date: Fri, 19 Jan 2024 22:52:36 +0800 Message-ID: <20240119145241.769622-10-bhe@redhat.com> In-Reply-To: <20240119145241.769622-1-bhe@redhat.com> References: <20240119145241.769622-1-bhe@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 Now crash codes under kernel/ folder has been split out from kexec code, crash dumping can be separated from kexec reboot in config items on s390 with some adjustments. Here wrap up crash dumping codes with CONFIG_CRASH_DUMP ifdeffery. Signed-off-by: Baoquan He --- arch/s390/kernel/kexec_elf.c | 2 ++ arch/s390/kernel/kexec_image.c | 2 ++ arch/s390/kernel/machine_kexec_file.c | 10 ++++++++++ 3 files changed, 14 insertions(+) diff --git a/arch/s390/kernel/kexec_elf.c b/arch/s390/kernel/kexec_elf.c index 9da6fa30c447..4d364de43799 100644 --- a/arch/s390/kernel/kexec_elf.c +++ b/arch/s390/kernel/kexec_elf.c @@ -40,8 +40,10 @@ static int kexec_file_add_kernel_elf(struct kimage *image, buf.bufsz = phdr->p_filesz; buf.mem = ALIGN(phdr->p_paddr, phdr->p_align); +#ifdef CONFIG_CRASH_DUMP if (image->type == KEXEC_TYPE_CRASH) buf.mem += crashk_res.start; +#endif buf.memsz = phdr->p_memsz; data->memsz = ALIGN(data->memsz, phdr->p_align) + buf.memsz; diff --git a/arch/s390/kernel/kexec_image.c b/arch/s390/kernel/kexec_image.c index af23eff5774d..a32ce8bea745 100644 --- a/arch/s390/kernel/kexec_image.c +++ b/arch/s390/kernel/kexec_image.c @@ -24,8 +24,10 @@ static int kexec_file_add_kernel_image(struct kimage *image, buf.bufsz = image->kernel_buf_len; buf.mem = 0; +#ifdef CONFIG_CRASH_DUMP if (image->type == KEXEC_TYPE_CRASH) buf.mem += crashk_res.start; +#endif buf.memsz = buf.bufsz; data->kernel_buf = image->kernel_buf; diff --git a/arch/s390/kernel/machine_kexec_file.c b/arch/s390/kernel/machine_kexec_file.c index 8d207b82d9fe..c2bac14dd668 100644 --- a/arch/s390/kernel/machine_kexec_file.c +++ b/arch/s390/kernel/machine_kexec_file.c @@ -105,6 +105,7 @@ static int kexec_file_update_purgatory(struct kimage *image, if (ret) return ret; +#ifdef CONFIG_CRASH_DUMP if (image->type == KEXEC_TYPE_CRASH) { u64 crash_size; @@ -121,6 +122,7 @@ static int kexec_file_update_purgatory(struct kimage *image, sizeof(crash_size), false); } +#endif return ret; } @@ -134,8 +136,10 @@ static int kexec_file_add_purgatory(struct kimage *image, data->memsz = ALIGN(data->memsz, PAGE_SIZE); buf.mem = data->memsz; +#ifdef CONFIG_CRASH_DUMP if (image->type == KEXEC_TYPE_CRASH) buf.mem += crashk_res.start; +#endif ret = kexec_load_purgatory(image, &buf); if (ret) @@ -158,8 +162,10 @@ static int kexec_file_add_initrd(struct kimage *image, data->memsz = ALIGN(data->memsz, PAGE_SIZE); buf.mem = data->memsz; +#ifdef CONFIG_CRASH_DUMP if (image->type == KEXEC_TYPE_CRASH) buf.mem += crashk_res.start; +#endif buf.memsz = buf.bufsz; data->parm->initrd_start = data->memsz; @@ -223,8 +229,10 @@ static int kexec_file_add_ipl_report(struct kimage *image, data->kernel_buf + offsetof(struct lowcore, ipl_parmblock_ptr); *lc_ipl_parmblock_ptr = (__u32)buf.mem; +#ifdef CONFIG_CRASH_DUMP if (image->type == KEXEC_TYPE_CRASH) buf.mem += crashk_res.start; +#endif ret = kexec_add_buffer(&buf); out: @@ -268,10 +276,12 @@ void *kexec_file_add_components(struct kimage *image, memcpy(data.parm->command_line, image->cmdline_buf, image->cmdline_buf_len); +#ifdef CONFIG_CRASH_DUMP if (image->type == KEXEC_TYPE_CRASH) { data.parm->oldmem_base = crashk_res.start; data.parm->oldmem_size = crashk_res.end - crashk_res.start + 1; } +#endif if (image->initrd_buf) { ret = kexec_file_add_initrd(image, &data); -- 2.41.0