Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3337165iob; Sun, 1 May 2022 14:09:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8r5F2I6RRrWGmrXxa/sv6WCNTym39sVR1evpSTvnrKc7E0g5wgRZSmWW6Yvs6KseW80IK X-Received: by 2002:a05:6a00:1494:b0:50d:4b12:8dfa with SMTP id v20-20020a056a00149400b0050d4b128dfamr8346188pfu.43.1651439393791; Sun, 01 May 2022 14:09:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651439393; cv=none; d=google.com; s=arc-20160816; b=0zfs7Sqqh4Mjr15BdMfXQxpTYEOgwmba8xFc9+2ec067oThS5L1s29x4l3D7DtynIX 1ZaUwHW7gAhBEGkoLqCgJIgE1iABPKR3GV+vOTPGqrjIcOs70MRPrUnFcDMr2MYLtGGX bmahWeXbyaaHUC5GAax9gF2oULtIYFtos0Y82QpCiykMFaYCFEvj11CWA7yZ+lPaWLW5 6WzUQTSW5leabYw7h+TJzcscmuusPdMs1dQhtgN5A8sXROSQPQ0jzI0K3MD14fqyU1rV KaayoKvoTmRF5DKreFROelBQiQ8sw9HPChaKZMsf+Q3WCAiQ2SXIPw0zdFZTnuVd+II4 lKMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=aQ+nnU9b+AK9j8XZkLHMkU6d8KFt4vZ+1q0g2FKJ16w=; b=hJhwIiu6cyJPFsT0jxqxbDA31h1lJ6AsFWcN4wTEZ7euEt5ZZtVCwvkGrUyJ8wPsKY YOCDkXnjw02g6hCmn8TUWTv5T3DKn3KhTwKKH1xwZf3bg1ALiMFPFV9KcqzrYxkP7q/D VpQsM4qS4K8UTwW81HeDEpiknPcwNuXw6QrN83MbIQx6Lyp6NGEBP1cJpirtOt8e+KX8 vaWbkojjcn0WTOX2cbtr3VVtZwY/wuTxl2y12bGKvQsZfcp38y/RMY7SDrG1v8vPG0N2 kXVQvCjjyjxLfwStXFWR4KpIWrKAVu73bG66nf8FXLq2XJuzcB0XXYspCkXEHJHlOHDw H6Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=d1Xnqn3q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x11-20020a63170b000000b003c1eb460705si3387705pgl.33.2022.05.01.14.09.25; Sun, 01 May 2022 14:09:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=d1Xnqn3q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359708AbiD2NOd (ORCPT + 99 others); Fri, 29 Apr 2022 09:14:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232435AbiD2NOb (ORCPT ); Fri, 29 Apr 2022 09:14:31 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C69E918E1C for ; Fri, 29 Apr 2022 06:11:12 -0700 (PDT) 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-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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]