From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chao Fan Subject: Re: [PATCH v8 0/3] x86/boot/KASLR: Parse ACPI table and limit kaslr in immovable memory Date: Thu, 11 Oct 2018 09:30:16 +0800 Message-ID: <20181011013015.GA6667@localhost.localdomain> References: <20181010084119.17539-1-fanc.fnst@cn.fujitsu.com> <20181010171616.GD5533@zn.tnic> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Return-path: Content-Disposition: inline In-Reply-To: <20181010171616.GD5533@zn.tnic> Sender: linux-kernel-owner@vger.kernel.org To: Borislav Petkov Cc: linux-kernel@vger.kernel.org, x86@kernel.org, linux-efi@vger.kernel.org, linux-acpi@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, keescook@chromium.org, bhe@redhat.com, rjw@rjwysocki.net, lenb@kernel.org, ard.biesheuvel@linaro.org, indou.takao@jp.fujitsu.com, caoj.fnst@cn.fujitsu.com List-Id: linux-acpi@vger.kernel.org On Wed, Oct 10, 2018 at 07:16:16PM +0200, Borislav Petkov wrote: >On Wed, Oct 10, 2018 at 04:41:16PM +0800, Chao Fan wrote: >> In the earliest time, I tried to dig ACPI tabls to solve this problem. >> But I didn't splite the code in 'compressed/' and ACPI code, so the patch >> is hard to follow so refused by community. >> Somebody suggest to add a kernel parameter to specify the >> immovable memory so that limit kaslr in these regions. Then I make >> a new patchset. After several versions, Ingo gave a suggestion: >> https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1634024.html >> Follow Ingo's suggestion, imitate the ACPI code to parse the acpi >> tables, so that the kaslr can get necessary memory information in >> ACPI tables. >> I think ACPI code is an independent part, so copy the codes >> and functions to 'compressed/' directory, so that kaslr won't >> influence the initialization of ACPI. > >You say "copy". I'm still about to look at the code but can those >functions be carved out in a separate compilation unit which ACPI *and* >KASLR can both link with so that there's no duplication? Sorry for my poor English, I used 'copy' but they are not same. Maybe 'imitate' is better. Just like I said in my log, The ACPI part need to handle the map between physical address and virtual address. But in KASLR part, I remove these operations. So my code is simplified version. Thanks, Chao Fan > >-- >Regards/Gruss, > Boris. > >Good mailing practices for 400: avoid top-posting and trim the reply. > >