From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 034CEC433F5 for ; Fri, 29 Apr 2022 13:11:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4E5336B0072; Fri, 29 Apr 2022 09:11:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 493746B0073; Fri, 29 Apr 2022 09:11:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3346D6B0074; Fri, 29 Apr 2022 09:11:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id 23C316B0072 for ; Fri, 29 Apr 2022 09:11:13 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id F18B52081A for ; Fri, 29 Apr 2022 13:11:12 +0000 (UTC) X-FDA: 79409952384.08.339BEEE Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf14.hostedemail.com (Postfix) with ESMTP id 1687B100051 for ; Fri, 29 Apr 2022 13:11:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651237871; 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: in-reply-to:in-reply-to:references:references; bh=aQ+nnU9b+AK9j8XZkLHMkU6d8KFt4vZ+1q0g2FKJ16w=; b=d1Xnqn3qAvgIgwo/AjkCVbbg38lXpglOzDB0N6R/GM8awmG+pNqTJ3BzQvSjAl2CXUfOWy 29d+0uOlRsah8sn0EughQMK1nODOf19CPKgrTwtlycJzpdbmdFk4mjra7n9XGv6akh3iro AKRXUtEHaEIhHhOK68ka32GQJkgneoM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-169-vtfQNIQqO66r_fu8YkYLGQ-1; Fri, 29 Apr 2022 09:11:06 -0400 X-MC-Unique: vtfQNIQqO66r_fu8YkYLGQ-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 369B485A5A8; Fri, 29 Apr 2022 13:11:05 +0000 (UTC) Received: from fedora (unknown [10.22.16.76]) by smtp.corp.redhat.com (Postfix) with SMTP id F0C7E43F704; Fri, 29 Apr 2022 13:10:59 +0000 (UTC) Date: Fri, 29 Apr 2022 10:10:58 -0300 From: Wander Lairson Costa To: "Kirill A. Shutemov" Cc: Borislav Petkov , Andy Lutomirski , Sean Christopherson , Andrew Morton , Joerg Roedel , Ard Biesheuvel , Andi Kleen , Kuppuswamy Sathyanarayanan , David Rientjes , Vlastimil Babka , Tom Lendacky , Thomas Gleixner , Peter Zijlstra , Paolo Bonzini , Ingo Molnar , Varad Gautam , Dario Faggioli , Dave Hansen , Brijesh Singh , Mike Rapoport , David Hildenbrand , x86@kernel.org, linux-mm@kvack.org, linux-coco@lists.linux.dev, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCHv5 06/12] x86/boot/compressed: Handle unaccepted memory Message-ID: References: <20220425033934.68551-1-kirill.shutemov@linux.intel.com> <20220425033934.68551-7-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220425033934.68551-7-kirill.shutemov@linux.intel.com> X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-Rspamd-Queue-Id: 1687B100051 X-Stat-Signature: 6gqdt7nwsb5j3ehxjd1nhahkj5xswitf Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=d1Xnqn3q; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf14.hostedemail.com: domain of wander@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=wander@redhat.com X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1651237870-577093 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Apr 25, 2022 at 06:39:28AM +0300, Kirill A. Shutemov wrote: > The firmware will pre-accept the memory used to run the stub. But, the > stub is responsible for accepting the memory into which it decompresses > the main kernel. Accept memory just before decompression starts. > > The stub is also responsible for choosing a physical address in which to > place the decompressed kernel image. The KASLR mechanism will randomize > this physical address. Since the unaccepted memory region is relatively > small, KASLR would be quite ineffective if it only used the pre-accepted > area (EFI_CONVENTIONAL_MEMORY). Ensure that KASLR randomizes among the > entire physical address space by also including EFI_UNACCEPTED_MEMOR nit: s/EFI_UNACCEPTED_MEMOR/EFI_UNACCEPTED_MEMORY./ [snip]