Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp967026ybb; Wed, 25 Mar 2020 13:01:30 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv04N3T6YYV4NL2kSyCUjfw3WjIPpBcPEtYAQ0WNYW2MD9WMhxc1/p4gs7iWTaq6KrOg058 X-Received: by 2002:aca:49d8:: with SMTP id w207mr3824623oia.85.1585166489857; Wed, 25 Mar 2020 13:01:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585166489; cv=none; d=google.com; s=arc-20160816; b=ngikONYKDowS+NzoZKdkVMRAaCkAap0qlegNqwihC+Wpq9OYyEOXHXZ5oHygdxcyd5 IZm/5floqZDE9VV5FH2En8qhclsPfTJHkNeZDq1xQZSqzciQXVHB33zgabjbVryL27cV dFvbbhIbg7UTfIycgOXBFe/cuWFqTHXpqYpLsrZdpxlHie3L1lsJIQDR3WAUkRDe56n0 4W4qG5tYH5bd2OzTZuRxFFVv/GeUh2kkMvzoiXhVYhc5RrTtY50Pqa/xp1MY8zRGc50h hKe2JcUTBlW4jXTbPygY1Rs/iXT9mN8TYC13xFcszqyIEeegAVBH+ocguC6CLmZHi701 iaGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WRe0CDur4+QyYBsqVasmKkHEv01IAC5YsJAw+ZG6o6Q=; b=ShsBGlbiYZnVVnULBhBdA4LjL7So3CuSWsd/GQkhCmO9dTcSMPjRCLjeWWt8X7Z+aN Bcwd0Gy80T04wgV80qP1K+rsuYVJlGX9E2uXOSk00/UdihzxOUkNiJX1G+oS/t+fs0se X7OI4wiUN0XGdKok/iOEJJgr18O8z7QGaejsiWVXjj/VyQbb1yQPeTXwi5ed7KlklMz7 WcLmb9IO2E+0UqBxDeAHiCqJVeD751klI6XFVJbJ2yAzD2h5DeRO3TluHv20yPUkm61q qP6+1l/A+qSFtFEn8Rcu0IWri1i54A0h+em9/ezq6+CvMUzBCs7FSfkaBkrNytcKtwWY 75aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Lb+plGHi; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j18si19602oib.191.2020.03.25.13.01.16; Wed, 25 Mar 2020 13:01:29 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Lb+plGHi; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727655AbgCYT7K (ORCPT + 99 others); Wed, 25 Mar 2020 15:59:10 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:46321 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727328AbgCYT7K (ORCPT ); Wed, 25 Mar 2020 15:59:10 -0400 Received: by mail-pl1-f194.google.com with SMTP id s23so1210147plq.13; Wed, 25 Mar 2020 12:59:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WRe0CDur4+QyYBsqVasmKkHEv01IAC5YsJAw+ZG6o6Q=; b=Lb+plGHidr/zatDeYeYaLIbpXpVMviYlLwxRsoejw2Ls6GWObgI8rK2/7EmA6NZVZR z8r0q+btXD3WnG8Eif129D5qiO6wvxKEi3jDVvghtkuKV8WzT0s8WKhgXXDEi7mtmDLr LG7J6nW///svzdYdW2l1ngs/NYuPJNv31L62YUDY0c/XSLW3+HFcR1eVMnnnxoHftBEj cmcHnupftkWXOGRjEzk/9FWhj2B1MWubizdecYK6kasx+79msosfHD2GHD3alY9z5eTA T9jcFVT0uQUF+/WQomiK2fQhN+4eCrncDw2PbGj/uhXTJjlqb8k7fuzo0njXIOrw9MGd mgaw== 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:mime-version:content-transfer-encoding; bh=WRe0CDur4+QyYBsqVasmKkHEv01IAC5YsJAw+ZG6o6Q=; b=gPMtrSA0e9GTJmZya1TPtIMLL59CHdgqL/glJNffS1Sm3X40tKFw0u7VgQzueidJL2 xhCGsEIsFzp2/IwfWDsv04tKhsMt+OYb/Rcyt0lGrwLgjHkcSNq0xRorV3FI3O0MaoP6 hARRvN8UrNFP6n8YpaQWroklIXMJygp8AwUpFqCR1DcZL575d/jUPSYSenaMN4de0BEP HjpY1XZsp/BEP4kGZndcWexNJn5Zen9V9D9+WCZXxzGliF1reSA6YRdzw9ydN7YJ0ThU uIu6NSp2CNhFPauiN35cPkWE++HhNWVsMBbUj5soBz1l81AfHM2+0yAyS4OtRDr2YsJG PJvQ== X-Gm-Message-State: ANhLgQ25294EoCDCVSBltPWiDXrMeG5pq/MSMvv+BHfPFMX1pI9jc9FE zTWjBviqxKR+yGIkQ2ads8A= X-Received: by 2002:a17:902:9b8b:: with SMTP id y11mr4891627plp.189.1585166348810; Wed, 25 Mar 2020 12:59:08 -0700 (PDT) Received: from nickserv.localdomain (c-67-188-225-242.hsd1.ca.comcast.net. [67.188.225.242]) by smtp.gmail.com with ESMTPSA id d7sm19341374pfr.17.2020.03.25.12.59.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Mar 2020 12:59:08 -0700 (PDT) From: Nick Terrell To: Nick Terrell Cc: linux-kernel@vger.kernel.org, Chris Mason , linux-kbuild@vger.kernel.org, x86@kernel.org, gregkh@linuxfoundation.org, Petr Malat , Kees Cook , Kernel Team , Nick Terrell , Adam Borowski , Patrick Williams , rmikey@fb.com, mingo@kernel.org, Patrick Williams Subject: [PATCH v3 6/8] x86: bump ZO_z_extra_bytes margin for zstd Date: Wed, 25 Mar 2020 12:58:47 -0700 Message-Id: <20200325195849.407900-7-nickrterrell@gmail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200325195849.407900-1-nickrterrell@gmail.com> References: <20200325195849.407900-1-nickrterrell@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nick Terrell Bump the ZO_z_extra_bytes margin for zstd. Zstd needs 3 bytes per 128 KB, and has a 22 byte fixed overhead. Zstd needs to maintain 128 KB of space at all times, since that is the maximum block size. See the comments regarding in-place decompression added in lib/decompress_unzstd.c for details. Signed-off-by: Nick Terrell --- arch/x86/boot/header.S | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S index 97d9b6d6c1af..b820875c5c95 100644 --- a/arch/x86/boot/header.S +++ b/arch/x86/boot/header.S @@ -536,8 +536,14 @@ pref_address: .quad LOAD_PHYSICAL_ADDR # preferred load addr # the size-dependent part now grows so fast. # # extra_bytes = (uncompressed_size >> 8) + 65536 +# +# ZSTD compressed data grows by at most 3 bytes per 128K, and only has a 22 +# byte fixed overhead but has a maximum block size of 128K, so it needs a +# larger margin. +# +# extra_bytes = (uncompressed_size >> 8) + 131072 -#define ZO_z_extra_bytes ((ZO_z_output_len >> 8) + 65536) +#define ZO_z_extra_bytes ((ZO_z_output_len >> 8) + 131072) #if ZO_z_output_len > ZO_z_input_len # define ZO_z_extract_offset (ZO_z_output_len + ZO_z_extra_bytes - \ ZO_z_input_len) -- 2.25.1