Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753217AbdIDBo1 (ORCPT ); Sun, 3 Sep 2017 21:44:27 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:45089 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753120AbdIDBoZ (ORCPT ); Sun, 3 Sep 2017 21:44:25 -0400 X-IronPort-AV: E=Sophos;i="5.41,473,1498492800"; d="scan'208";a="25169361" Date: Mon, 4 Sep 2017 09:44:09 +0800 From: Chao Fan To: "Rafael J. Wysocki" CC: , , , , , , , , , , , , , , Subject: Re: [PATCH v2] kaslr: get ACPI SRAT table to avoid movable memory Message-ID: <20170904014408.GA23556@localhost.localdomain> References: <20170903143123.22031-1-fanc.fnst@cn.fujitsu.com> <2895411.GR6mzpbNLk@aspire.rjw.lan> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <2895411.GR6mzpbNLk@aspire.rjw.lan> User-Agent: Mutt/1.8.3 (2017-05-23) X-Originating-IP: [10.167.226.75] X-yoursite-MailScanner-ID: C243C4724E72.ABB44 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: fanc.fnst@cn.fujitsu.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1112 Lines: 34 On Mon, Sep 04, 2017 at 12:55:00AM +0200, Rafael J. Wysocki wrote: >On Sunday, September 3, 2017 4:31:23 PM CEST Chao Fan wrote: >> KASLR should choose the memory region of immovable node to extract kernel. >> So get ACPI SRAT table and store the memory region of movable node which >> kaslr shold avoid. > >Please elaborate. Hi Rafael, Sorry for that. The problem is: in a machine, some numa nodes are hotpluggable, some are not. The kernel should use the memory in unhotpluggable. But when extracting kernel, kaslr may chooose the memory in hotpluggable or unhotpluggable node. The ACPI SRAT table can show the node is hotpluggable or not. But the acpi_boot_table_init runs in setup_arch, which is after extracting kernel. So I imitate the initialization in acpi_boot_table_init to get the table before extracting kernel. And mark the memory region in hotpluggable node to avoid kaslr extracting kernel in these regions. Thanks, Chao Fan > >This is far too little information on what problem you are trying to address >and why you are trying to address it in this particular way. > >Thanks, >Rafael > > >