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 X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90FA5C5ACCC for ; Thu, 18 Oct 2018 04:23:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 48D0F21480 for ; Thu, 18 Oct 2018 04:23:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 48D0F21480 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727453AbeJRMWX (ORCPT ); Thu, 18 Oct 2018 08:22:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56192 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727332AbeJRMWX (ORCPT ); Thu, 18 Oct 2018 08:22:23 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B49E23081254; Thu, 18 Oct 2018 04:23:23 +0000 (UTC) Received: from localhost (ovpn-8-17.pek2.redhat.com [10.72.8.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E2B8F1057043; Thu, 18 Oct 2018 04:23:22 +0000 (UTC) Date: Thu, 18 Oct 2018 12:23:20 +0800 From: Baoquan He To: Chao Fan Cc: linux-kernel@vger.kernel.org, x86@kernel.org, linux-efi@vger.kernel.org, linux-acpi@vger.kernel.org, bp@alien8.de, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, keescook@chromium.org, msys.mizuma@gmail.com, indou.takao@jp.fujitsu.com, caoj.fnst@cn.fujitsu.com Subject: Re: [PATCH v9 7/8] x86/boot/KASLR: Walk srat tables to filter immovable memory Message-ID: <20181018042320.GE1885@192.168.1.4> References: <20181017102012.872-1-fanc.fnst@cn.fujitsu.com> <20181017102012.872-8-fanc.fnst@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181017102012.872-8-fanc.fnst@cn.fujitsu.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Thu, 18 Oct 2018 04:23:23 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/17/18 at 06:20pm, Chao Fan wrote: > If CONFIG_MEMORY_HOTREMOVE enabled, walk through the acpi srat memory > tables and store those immovable memory regions so that kaslr can get > where to choose for randomization. This patch only adds invocation of get_immovable_mem() inside mem_avoid_init(). It's not doing what you said in patch log. Can it be merged with other patch, e.g patch 6 or 8? > > Signed-off-by: Chao Fan > --- > arch/x86/boot/compressed/kaslr.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c > index 9ed9709d9947..0c3567bc231c 100644 > --- a/arch/x86/boot/compressed/kaslr.c > +++ b/arch/x86/boot/compressed/kaslr.c > @@ -417,6 +417,11 @@ static void mem_avoid_init(unsigned long input, unsigned long input_size, > /* Mark the memmap regions we need to avoid */ > handle_mem_options(); > > +#ifdef CONFIG_MEMORY_HOTREMOVE > + /* Mark the immovable regions we need to choose */ > + get_immovable_mem(); > +#endif > + > #ifdef CONFIG_X86_VERBOSE_BOOTUP > /* Make sure video RAM can be used. */ > add_identity_map(0, PMD_SIZE); > -- > 2.17.2 > > >