Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1175806pxx; Tue, 27 Oct 2020 09:58:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6Pt45pGXvDSEeQ3JcnKE8MsN6gwr76xZTpRQ1lXwWpLdr4uOXg+c+wtLhH6caVTns/ZsQ X-Received: by 2002:a50:e08e:: with SMTP id f14mr3144603edl.374.1603817885747; Tue, 27 Oct 2020 09:58:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603817885; cv=none; d=google.com; s=arc-20160816; b=05/Ji3nniHEhtj+PjQnqmA0MKm6+fYUioAq+BJQmIAhUqwdalDQqS1Djs5YkVGV5Rz Oj01l699HEzASo17yr0t4k0H0l3MsBIxkM0xuz0Fk4LbE7rP1Hs+g1lSxM8W6+A/3mby sqXb6jq25QgE5Wxm+lcDwexau++HEtD3voKA6EV82hkWbUJuvqYOsz9ywf1HiiHn5api cojYYJtZ8lUFddR2WP87zik0cPQOjH156BgUVt5jk43L623OpN1Z9RynlT4XHipECEBx zzrnbRMBAvzWZx/38lFsLCodGRzl0gMwils3rOykgji1J6UlhVxuNzgBAMdgdwhmpvdD kXSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=rJCzxyzOmY91yVYGTzPjFYY82hunDYljfli6E7JypIA=; b=idypPehREmYUdkNC+SEbXqwZLIWCbabzpc4FNeW1MlPvqe/8xhvPD7y95e1wsNhwM9 42Et1EawFCFmKWyS3zmVWpJ4L511qXGgt0ehjJ99Z84yqQY0ZwIPgg9Vesi/RXZZUsHf DazxcXCVWMG1Oer3Lw8+Qbo1TaixuIpCcqIl5Tz1Bt5MvYYbIf96XZhbjKBgqr6i7RZj tCSOEfvTjU9hF0b/huYsmn/++ZNSX1jf02jZK96jZukBQ6hM9Lf/1lZPlG7Eu5nb+y3J IP78eZWqafOac+98CdVyBU/iX6kvKe5Uumo6o7Z9MspTqJwBwHOVzIDF18KiTbhbNiPc stsg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o10si1333395ejr.482.2020.10.27.09.57.25; Tue, 27 Oct 2020 09:58:05 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1806211AbgJ0QGD (ORCPT + 99 others); Tue, 27 Oct 2020 12:06:03 -0400 Received: from mx2.suse.de ([195.135.220.15]:44850 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1802375AbgJ0PrA (ORCPT ); Tue, 27 Oct 2020 11:47:00 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id D8814AFE8; Tue, 27 Oct 2020 15:46:59 +0000 (UTC) Date: Tue, 27 Oct 2020 16:46:58 +0100 From: Joerg Roedel To: "Kirill A. Shutemov" Cc: Arvind Sankar , x86@kernel.org, linux-kernel@vger.kernel.org, "Kirill A. Shutemov" , Kees Cook Subject: Re: RFC x86/boot/64: BOOT_PGT_SIZE definition for compressed kernel Message-ID: <20201027154658.GG22179@suse.de> References: <20201025004158.GA767345@rani.riverdale.lan> <20201027124007.xkkseswwgerlzlsl@box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201027124007.xkkseswwgerlzlsl@box> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 27, 2020 at 03:40:07PM +0300, Kirill A. Shutemov wrote: > BTW, what happens if we underestimate BOOT_PGT_SIZE? Do we overwrite > something? The boot code will print an error and stop the machine when allocating a page-table page fails. I also think that bumping BOOT_PGT_SIZE up to have more pages available is a good short-term solution. Recycling pages will also need to take page encryption attributes into account, as for SEV-ES the GHCB page needs to be mapped unencrypted. Another option to safe some memory is to make use of GB pages in the decompression code. Machines where the current BOOT_PGT_SIZE is too small will likely support GB pages too. Regards, Joerg