Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3600962pxj; Tue, 15 Jun 2021 04:43:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyU9HISrnw3AeW5rI8RZIvNkEDOCS0rhwcV7l8+uI244vtzLbdLsnrf089YP1YU1nkoAAkW X-Received: by 2002:a02:ce89:: with SMTP id y9mr21487472jaq.78.1623757379927; Tue, 15 Jun 2021 04:42:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623757379; cv=none; d=google.com; s=arc-20160816; b=oRJWHSggQa2i6/kuUGi99sZg7X+ShlmjL0tQew/nlsekTmV7gMSs1puFyNWnc83/Be tyiX5ta5IN+xGEs/ee49Mdrzb9RJGkzsliVaWNCMAm37Wk8dyNeZ8CQKUwC2k0vSiFo1 OGbAqg2ZcRkIBKbcJ3OpcLp1z6/7VJLmLcMOp+Rcp1y+WJoge7F6oZHVJFqCLDBKji1O bpOOJEdSqMSNVbOQeU/pbKRVsugzeVNa3qW55vpBlRbkubF0+wffn+zm3uySVEpM7E9Q FziJoe37KbE1e9YeEqveoE7Of03rDXnGn+2SjGrqtKUM8trgiZQyfXYJkROww+//FKgI X9wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=CYDncFNuUvtFCPbJvAJNhxcp0bRwM7nHPoRx8JOBLSQ=; b=Jtod9w1V9cvs5Vo6K02dhcUXByIQexeP/Y9bFin7gEGMra0QWXC+YlQN/t+5Capzm3 7bPrG6f/gaW706kBa8cUD6/kScYLEBbSsI9AAYs4V+OixHvtXO1JiLn+Bt9LuE6Y8rzL DBs93YbIwNhCE8RHjhE3OmU9dRM/6cA3MnKML5MaC/G0+aWm3eQ/MMuVRR7jyu7eXQsd vRPD0I86IJZ3YbWvq09PzlIMMvCYhWEHqzQ0LTN2FtLKKUCRla7uzsiSkTrw3xaiCOz7 6hGDVBdRNkui70/3MruRq/J/zfWtBFJELp7OsxbJiYsRp823km03vaUgVVpIGqnYJrKR chSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j16si21508446ioo.11.2021.06.15.04.42.44; Tue, 15 Jun 2021 04:42:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229993AbhFOLoQ (ORCPT + 99 others); Tue, 15 Jun 2021 07:44:16 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:57110 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229977AbhFOLoK (ORCPT ); Tue, 15 Jun 2021 07:44:10 -0400 Received: from mail-wr1-f70.google.com ([209.85.221.70]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lt7SH-0007bo-OE for linux-kernel@vger.kernel.org; Tue, 15 Jun 2021 11:42:05 +0000 Received: by mail-wr1-f70.google.com with SMTP id z4-20020adfe5440000b0290114f89c9931so8450062wrm.17 for ; Tue, 15 Jun 2021 04:42:05 -0700 (PDT) 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:mime-version :content-transfer-encoding; bh=CYDncFNuUvtFCPbJvAJNhxcp0bRwM7nHPoRx8JOBLSQ=; b=n2Msq6X+bCvq+wTFh/JKBguZaSbIizNkAEqUBi4EKygEgeXDXWHEJfHQq5uCzmKRT9 wC2nOtDP4NW+rmooI1QjXE+qk4ZLF4AtKZBtQS65XwN2yntsco6noNAhzaI0pQMn2IjF P7U23iUhLVFE2WQAXUGSYwnGlUa//qwJFJsQ6g0kkEnslDc2KMx6LebG0eRIFs5DdClz 79Xcm06ouEAwTKa+O2J5q3q6dchlHsDudAwC9vzSChM56+nc5txuzmun9POCKqkuA1JO 4iIgf8HxFdsdcy7inN0jGr3rhJRjZ0sWpmD69K3dd3JrbdPG22rkeA6g/iYi+UP9XJzZ 5kVQ== X-Gm-Message-State: AOAM5326tdex8G+Q1BCcWoewp0frEf8d7CE54sXLrnsOsVJEIcNPu1O8 NtefxU6S9EKZZ53qIXY80iWCuYsrxp3gdJ6foTCECnp4APjcYaDTMrb5ZLHKcQMNW8n1feG1Cro 07RQIFR7eusO8TfOw7P9CGI1AncOcCmW3AOn2qgz/bQ== X-Received: by 2002:adf:f990:: with SMTP id f16mr25183219wrr.340.1623757325208; Tue, 15 Jun 2021 04:42:05 -0700 (PDT) X-Received: by 2002:adf:f990:: with SMTP id f16mr25183194wrr.340.1623757324976; Tue, 15 Jun 2021 04:42:04 -0700 (PDT) Received: from localhost ([2a01:4b00:85fd:d700:dc22:6ba5:a376:4d8d]) by smtp.gmail.com with ESMTPSA id r2sm19428181wrv.39.2021.06.15.04.42.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Jun 2021 04:42:04 -0700 (PDT) From: Dimitri John Ledkov To: linux-kernel@vger.kernel.org Cc: Dimitri John Ledkov , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , linux-s390@vger.kernel.org Subject: [PATCH] s390/boot: add zstd support Date: Tue, 15 Jun 2021 12:41:50 +0100 Message-Id: <20210615114150.325080-1-dimitri.ledkov@canonical.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Enable ztsd support in s390/boot, to enable booting with zstd compressed kernel when configured with CONFIG_KERNEL_ZSTD=y. BugLink: https://bugs.launchpad.net/bugs/1931725 Signed-off-by: Dimitri John Ledkov cc: Heiko Carstens cc: Vasily Gorbik cc: Christian Borntraeger cc: linux-s390@vger.kernel.org --- arch/s390/Kconfig | 1 + arch/s390/boot/compressed/Makefile | 4 ++++ arch/s390/boot/compressed/decompressor.c | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index b4c7c34069f8..fdbf584e13eb 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig @@ -172,6 +172,7 @@ config S390 select HAVE_KERNEL_LZO select HAVE_KERNEL_UNCOMPRESSED select HAVE_KERNEL_XZ + select HAVE_KERNEL_ZSTD select HAVE_KPROBES select HAVE_KPROBES_ON_FTRACE select HAVE_KRETPROBES diff --git a/arch/s390/boot/compressed/Makefile b/arch/s390/boot/compressed/Makefile index de18dab518bb..75660aaaa7a3 100644 --- a/arch/s390/boot/compressed/Makefile +++ b/arch/s390/boot/compressed/Makefile @@ -14,6 +14,7 @@ obj-y := $(if $(CONFIG_KERNEL_UNCOMPRESSED),,decompressor.o) info.o obj-all := $(obj-y) piggy.o syms.o targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 targets += vmlinux.bin.xz vmlinux.bin.lzma vmlinux.bin.lzo vmlinux.bin.lz4 +targets += vmlinux.bin.zst targets += info.bin syms.bin vmlinux.syms $(obj-all) KBUILD_AFLAGS := $(KBUILD_AFLAGS_DECOMPRESSOR) @@ -63,6 +64,7 @@ suffix-$(CONFIG_KERNEL_LZ4) := .lz4 suffix-$(CONFIG_KERNEL_LZMA) := .lzma suffix-$(CONFIG_KERNEL_LZO) := .lzo suffix-$(CONFIG_KERNEL_XZ) := .xz +suffix-$(CONFIG_KERNEL_ZSTD) := .zst $(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) FORCE $(call if_changed,gzip) @@ -76,6 +78,8 @@ $(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) FORCE $(call if_changed,lzo) $(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y) FORCE $(call if_changed,xzkern) +$(obj)/vmlinux.bin.zst: $(vmlinux.bin.all-y) FORCE + $(call if_changed,zstd22) OBJCOPYFLAGS_piggy.o := -I binary -O elf64-s390 -B s390:64-bit --rename-section .data=.vmlinux.bin.compressed $(obj)/piggy.o: $(obj)/vmlinux.bin$(suffix-y) FORCE diff --git a/arch/s390/boot/compressed/decompressor.c b/arch/s390/boot/compressed/decompressor.c index 3061b11c4d27..02fd0d245c7e 100644 --- a/arch/s390/boot/compressed/decompressor.c +++ b/arch/s390/boot/compressed/decompressor.c @@ -61,6 +61,10 @@ static unsigned long free_mem_end_ptr = (unsigned long) _end + BOOT_HEAP_SIZE; #include "../../../../lib/decompress_unxz.c" #endif +#ifdef CONFIG_KERNEL_ZSTD +#include "../../../../lib/decompress_unzstd.c" +#endif + #define decompress_offset ALIGN((unsigned long)_end + BOOT_HEAP_SIZE, PAGE_SIZE) unsigned long mem_safe_offset(void) -- 2.27.0